Ask Your Question

B-Man's profile - activity

2019-01-21 06:36:07 -0500 received badge  Popular Question (source)
2015-12-31 09:21:28 -0500 received badge  Student (source)
2014-03-18 18:06:46 -0500 commented answer Bag of (visual) Words - Locate Object in Image

Ok, thanks again for your input and help!

You clarified lots of things for me :-)

Cheers!

2014-03-17 18:52:13 -0500 commented answer Bag of (visual) Words - Locate Object in Image

Hi Guanta! Thanks for your input!

I'm a little confused by your first point. I thought that for each detected keypoint (which is just one pixel) an area around the keypoint is considered to build the descriptor/feature vector

(e.g. 16x16 for SIFT, see http://www.aishack.in/wp-content/uploads/2010/06/sift-fingerprint.jpg ).

That's why I choose a ROI of 20x20 at first...

Regarding your second point, would this be a valid approach to just detect the keypoints?

detector.detect(img2, keypoint2);

vector<keypoint> keypoint3;

for(int i=0; i<keypoint2.size(); i++)

{

Rect ROI = Rect(keypoint2[i].pt.x-10, keypoint2[i].pt.y-10, 20, 20)

detector.detect(img2(ROI), keypoint3);

bowDE.compute(img2(ROI), keypoint3, bowDescriptor2)

float response = svm.predict(bowDescriptor2);

}

Thanks!

2014-03-15 20:59:20 -0500 received badge  Scholar (source)
2014-03-15 20:52:39 -0500 commented answer Bag of (visual) Words - Locate Object in Image

Hi Guanta! Thanks, I got the idea now! I was thinking if it is possible to speed up things by just examining the detected keypoints in the image, and predict for each keypoint (area around it), to which class it might belong? e.g. (don't know if this is correct):

detector.detect(img2, keypoint2);

// Just examine the area around detected keypoint (e.g. 20x20 area)

for(int i=0; i<keypoint2.size(); i++)

{

Rect ROI = Rect(keypoint2[i].pt.x-10, keypoint2[i].pt.y-10, 20, 20)

bowDE.compute(img2(ROI), keypoint2, bowDescriptor2)

float response = svm.predict(bowDescriptor2);

}

Afterwards you would build a bounding box only around the keypoints that have been predicted to belong to the target class...

Anyway, you helped me really out with your support! Thanks again for that! Cheers!

2014-03-13 23:06:15 -0500 received badge  Supporter (source)
2014-03-13 23:05:25 -0500 commented answer Bag of (visual) Words - Locate Object in Image

Hi Guanta! Thank you very much for your answer! The code I found for testing purposes was from this website: http://alum.sharif.ir/~mostajabi/Tutorial.html (see "feature extraction.cpp" in rar file).

My problem is now: You said, that I should partition each image in small rectangles/windows and analyse that block, i.e. do a sliding window approach. But I'm confused for what I should search in that block. In the code (see link) the SVM predicts the class of a object by examining the histogram of the visual words of the whole image (here: "bowDescriptor2"). But a histogram contains no location info...

Do you know of any sample code where I can see how analysis is done on these subwindows? That would be great! Thanks!

P.S.: Cascade classifier gives me too many false positives...

2014-03-12 23:56:53 -0500 received badge  Editor (source)
2014-03-12 18:50:12 -0500 asked a question Bag of (visual) Words - Locate Object in Image

Hi everybody,

I was dealing with the Bag of (visual) Words (BOW) approach in OpenCV recently. I found some code in the Internet where you can predict by means of a trained Support Vector Machine if a certain object is present in the image or not.

My problem is now, that this BOW approach indeed to some extent accurately recognizes your object, but it doesn't tell you where the object is located in the image.

My goal is to put a bounding box around the detected object. Is there any way I can use the BOW approach and still locate that object?

Any help, suggestion or idea would be helpful! Thanks!