0
我是python的新手,因此我需要一些幫助: AIM:我有一個包含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