0
저는 파이썬에 초보입니다. 따라서 도움이 필요합니다. 목표 : 10 개의 이미지가 포함 된 이미지 데이터베이스가 있습니다. 색조 추출기를 사용하여 각 이미지에서 색조를 추출하여 목록에 저장하고 데이터 베에 속하지 않는 다른 이미지의 색조와 목록을 비교하십시오. 이제이 코드는 단일 이미지에 대해 저에게 잘 작동합니다. 예 :simpleCV의 이미지 데이터베이스에서 피쳐 추출
print __doc__
from SimpleCV import*
from SimpleCV import HueHistogramFeatureExtractor, np
import numpy as np
image1 = ...
image2 = ...
hue = HueHistogramFeatureExtractor() # define the extractor
x = np.array(hue.extract(image1)) # extract features
y = np.array(hue.extract(image2)) # extract features
xandy = np.sum(np.square(x-y)) # compare extracted features
print xandy
('#######################################################')
Of course avoiding to write each image seperatly from a database I tried:
imageDatabase = "/.../dir/car/" #load image database
car_images = ImageSet(imageDatabase)
hue = HueHistogramFeatureExtractor() # define the extractor
car_hue = [hue.extract(car_images) for c in car_image] # extract hue features from image database???
print hue # print hue feature list
올바른 방향으로 가고 있습니까? 제게 일할 방향을 알려주세요.
세부 사항을 추가하십시오. 너는 무엇을 기대 하느냐? 어떤 문제가 발생하고 있습니까? – Macmade