1
votes

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.

1
Documentation says, scaleFactor>1. too close to 1 scale factor will mean that to cover certain scale range you will need more pyramid levels and so the speed will suffer. So put it greater than 1 and check it again.Abid Rahman K
Well, values greater than one can sometimes give me the error above. Maybe you know what this error is all about?user2175762
I haven't come across. It says particular image(s) used on the line that causes error should be of type uint8,int32 or float32. May be you can add here a minimal piece of code to reproduce the error.Abid Rahman K

1 Answers

0
votes

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.