简体   繁体   中英

OpenCV: Orb parameters

I am wondering about the parameter for the orb feature detector. I am using it as keypoint extractor and descriptor. As matcher I use the BFMatcher.

At the moment I use it like this:

ORB orb(25, 1.0f, 2, 10, 0, 2, 0, 10);

Because I am looking at small images and fast performance I reduced the number of features to about 25. Which seems to still work fine with my application. And the problem start with the second parameter. Its default value is 1.2. I set it to 1 a while ago but found out that it is much fast with a higher value there. The thing is, I am starting to get this problem:

OpenCV Error: Assertion failed ((type == CV8U && dtype == CV_32S) ||dtype == CV_32F) in cv_batchDistance, file..........stat.cpp, line 2480

Then up next is the parameter for pyramid levels. Default is 8. I set it to 2 which gave me another great performance improvement. But if I set it to 1 it will throw the same error as above.

Since I am working with small pictures I tried to set it to a lower value. But it does not seem to change anything. The same applies to the last parameter (patchSize). It states that these parameters should roughly match.

I am not interested in the remaining parameters.

As I have explained in other questions already I am trying to track an object in a video. For that I am extracting for every bounding box its features and try to match it with a bounding box from the next feature. By doing this I am trying to build relationships between frames. And so far it is working well. But I need to be faster. If there are more than a handful of bounding boxes it takes too long since I want to have it real time @ 30FPS.

If anyone could help me with these parameter I'd appreciate it.

According to the documentation, the values of parameters number 4 and 8 tell how far from the boundary the keypoints should be. Since you're using small images, 10 pixels may be a good choice but if you want more centered keypoints take a larger value. The second parameter must be greater than 1, I don't know what value you chose but you may try 2. You're not interested in parameter number 7, but you may set it to 1 instead of 0 because 1 corresponds to the FAST_SCORE which is faster to compute than the HARRIS_SCORE. If you add your code someone can help you with the error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM