그래서 ... 실용적인 컴퓨터 비전 with SimpleCV, 제 5 장 - 온라인 자습서 here과 같은 예입니다. 노란 차의 평균 색에 대해 매우 다른 값을 얻었으므로 예제 코드를 다시 읽고 몇 가지 코멘트를 추가하고 각 단계에서 이미지를 표시하고 깨끗하게 닫습니다.SimpleCV 자동차 감지 예제
from SimpleCV import Image
import time
# Load images.
car_in_lot = Image("parking-car.png")
car_not_in_lot = Image("parking-no-car.png")
# Crop image to region-of-interest.
car = car_in_lot.crop(470,200,200,200)
car.show()
time.sleep(5)
car.show().quit()
# Create greyscale image showing how far from yellow various colors are.
yellow_car = car.colorDistance(Color.YELLOW)
yellow_car.show()
time.sleep(5)
yellow_car.show().quit()
# Subtract greyscale image from cropped image to show just the yellow portions.
only_car = car - yellow_car
only_car.show()
time.sleep(5)
only_car.show().quit()
print only_car.meanColor()
(0.6376000000000001, 2.096775, 5.170425)
의 결과를 반환
대신 (25.604575, 18.880775, 4.4940750000000005)
은 책과 자습서 모두에 주어진.
자른 주차 공간의 첫 번째 이미지는 괜찮아 보이지만 그레이 스케일 이미지는 사물이 분명히 이상하게 보이는 곳입니다. 내가 얻은 이미지는 90도 회전되어 예에서와 같이 전혀 보지 않습니다. 여기 Dropbox에 link이 있습니다.
그리고 거기에서 ... 색상과 함께 멀리 떨어진 곳에서 it should be ... 평균 색상 값이 제대로 나오지 않습니다.
colorDistance()
단계에서 펑키 회전 된 그레이 스케일 이미지가 반환 된 이유에 대한 아이디어 나 제안 사항이 있습니까?