bikz05 / bag-of-words

Python Implementation of Bag of Words for Image Recognition using OpenCV and sklearn
218 stars 105 forks source link

A problem for stacking all the descriptors vertically in a numpy array #3

Closed willard-yuan closed 9 years ago

willard-yuan commented 9 years ago

Hi, bikz05

There is another problem in findFeatures.py. The code:

# Stack all the descriptors vertically in a numpy array
descriptors = des_list[0][1]
for image_path, descriptor in des_list[0:]:
    descriptors = np.vstack((descriptors, descriptor))  

I think it's should be as follows:

# Stack all the descriptors vertically in a numpy array
descriptors = des_list[0][1]
for image_path, descriptor in des_list[1:]:
    descriptors = np.vstack((descriptors, descriptor))  
bikz05 commented 9 years ago

Hi willard-yuan,

You are right. This needs to be correctly. Because of the incorrect code descriptor 1 (index 0) is being added twice.

I will correct the code and thanks for the correction.

Best bikz05