How can I get keypoints for given location in MATLAB
I am working in MATLAB, i connected MATLAB with opencv through mexopencv. I want to extract BRIEF descriptors for some keypoints. I am getting keypoints by following code.
detector = cv.FeatureDetector('STAR');
keypoints = detector.detect(im);
extractor = cv.DescriptorExtractor('BRIEF');
descriptors = extractor.compute(im, keypoints);
This code is working fine. But I want dont want to use this command.
keypoints = detector.detect(im);
Instead, I want to get keypoints on my specific location. For example... I want to do this...
keypoint1 = cv.KeyPoint (16,16);
But this is not working...
How can I get keypoints for my specific location? Thank you, Best Regards,
This is not working because as someone else already answer you (http://answers.opencv.org/question/57737/how-to-extract-brief-descriptor-for-the-keypoint-on-given-location/), keypoints carry other information than just the 2D coordinate.
In C++: http://docs.opencv.org/modules/features2d/doc/common_interfaces_of_feature_detectors.html#keypoint-keypoint, in Matlab I do not kow.
Yes, I know Keypoints carry other information, but I am not able to call cv2.KeyPoint() method in MATLAB... cv.KeyPoint() is not working/available... is there any alternate?
Why matlab?
@thdrksdfthmn... I have already written a lot of code in MATLAB and used other descriptors such as SURF, BRISK, FREAK etc... and I want to replace BRIEF descriptor only in the code.
As Eduardo says, maybe you shall try
KeyPoint(16, 16, 16)
orKeyPoint(16, 16, 16, -1, 0, 0, -1)
...I tried, it didn't work. Thank you btw... I resolved the issue by another way (By editing the location of randomly obtained keypoints)..
What do you mean by "editing the location of randomly obtained keypoints"? You can post the answer...
Though Its not a standard way. I used the same code as above.
detector = cv.FeatureDetector('STAR'); keypoints = detector.detect(im);
Then I took first keypoint and changed the location as followed.
keypoint1 = keypoints(1);
keypoint1.pt = [16,16];
And computed the descriptor for my desired point.
extractor = cv.DescriptorExtractor('BRIEF'); descriptors = extractor.compute(im, keypoint1);
(In my case, point location is important, size, angle etc of keypoint does not matter)
So you are saying that each detector returns features in different locations and you want to "compare" the different extractors based on the same feature location? Why not using Dense and different extractors (and because extractors are of different sizes, just eliminate keypoints on the border of the image)?
Or you are saying that detect finds keypoints in different places even if the image is the same?
I wanted to compute BRIEF descriptors on my specified locations. This is part of another task that I am doing.