Ask Your Question

briansrls's profile - activity

2015-11-15 10:02:25 -0600 received badge  Necromancer (source)
2015-11-15 00:35:15 -0600 asked a question Next step in image recognition? cv 2.4.11 on python

Hello all,

I'm trying to do image recognition using BOW and SIFT feature descriptors. So far, I've created my dictionary using BOW and my training images. Now, I'm going through my testing images, getting my descriptors. How do I compare each of the test images descriptors to that of the dictionary using SVM? Any help getting started would be appreciated :)

2015-11-15 00:32:34 -0600 received badge  Scholar (source)
2015-11-15 00:13:16 -0600 received badge  Editor (source)
2015-11-15 00:12:49 -0600 answered a question How to use BOWImgDescriptorExtractor in python - openCV ?

I know this is a bit late, but this should solve the issue for me.

sift2 = cv2.DescriptorExtractor_create("SIFT")
bowDiction = cv2.BOWImgDescriptorExtractor(sift2, cv2.BFMatcher(cv2.NORM_L2))

I believe the problem is that sift is not only a descriptor extractor, but also a feature finder. So, sending this function only cv2.SURF() or cv2.SIFT() will not be the appropriate type. Send it the descriptor extractor portion of your favorite feature detector (replacing SIFT with SURF etc should work fine)

NOTE: This is using opencv 2.4.11

2015-11-14 23:53:38 -0600 commented question BOWKMeansTrainer cluster Python issue

I love you! take my updoots

2015-11-14 22:42:47 -0600 asked a question BOWKMeansTrainer cluster Python issue

Hello all,

I'm trying to use cluster from the BOWKMeansTrainer class on python. Here's a snippet of code to give you an idea

sift = cv2.SIFT() print names_path

descriptors_unclustered = []

for p in training_paths:
    image = cv2.imread(p)
    gray = cv2.cvtColor(image, cv2.CV_LOAD_IMAGE_GRAYSCALE)
    kp, dsc= sift.detectAndCompute(gray, None)
    descriptors_unclustered.append(dsc)
     dictionarySize = 5

desc = np.empty(len(descriptors_unclustered), dtype=object) for i in range(len(descriptors_unclustered)):
    desc[i] = descriptors_unclustered[i]

print desc BOW = cv2.BOWKMeansTrainer(dictionarySize)

dictionary = BOW.cluster(desc)

print dictionary

I'm getting the error

TypeError: descriptors data type = 17 is not supported

When passing my numpy array to clusters(). Any idea what causes this, or what data type it's supposed to accept?

2015-10-20 00:32:06 -0600 asked a question Help with SIFT and SURF

Hello all,

I'm using opencv with python on windows 7. I'm trying to use SIFT but as we all know it's been moved to the other repo. To set up opencv 3.0 all I had to do was copy cv2.pyd to my python lib, but now I was considering going down to 2.4.x as that may be easier. I tried doing so, however when I copy the opencv 2.4.x cv2.pyd to python and print the version it still shows 3.0.0. Does anyone know what I'm doing wrong? Is there an easier way to get access to SIFT and SURF?

Thanks for any help.