I am using opencv 2.4.8. Declaring orb as such:

int patchSize = 31;
ORB orb(1000,1.0f,1,patchSize,0,2,ORB::HARRIS_SCORE,patchSize);

Doesn't the patch size mean that there should be (patchsize-1)/2 space around the keypoint?

I am providing keypoints at coordinates with 15 pixels margins vertically and horizontally, but such positions fail to produce descriptors.

For example, for an image 240x320 the point (15,15) fails to be described, even though there are enough pixels ( 0,1,....14 -> 15 pixels).

有帮助吗?

解决方案

OpenCV uses KeyPointsFilter::runByImageBorder with the selected edgeThreshold (which is your patchSize) to eliminate keypoints close to the image border for the ORB computation (the file is modules/features2d/src/orb.cpp, if you want to have a look; line 669 in computeKeyPoints).

So your margin is actually 31, and not 15.

Hope that helps!

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top