I am new to python, therefore I need some help: AIM: I have an image database containing 10 images. I want to use a hue feature extractor to extract the hue from each image and store it in a list and compare the list with hues from other images not belonging to the databae Now this code works fine for me for a single image e.g.:
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
Do I am on the right track? Please give me direction to work to.