emiliofidalgo / ibow-lcd

Appearance-based Loop Closure Detection using Incremental Bags of Binary Words
GNU General Public License v3.0
163 stars 31 forks source link

Very high CPU using? #3

Closed YiChenCityU closed 6 years ago

YiChenCityU commented 6 years ago

Hi, Thanks for your sharing. I have test the ibow-lcd for loop detection. But i found that the process cost too much cpu. Is it normal? The computer is Thinkpad X1 carbon with core i7 . It cost almost 94%CPU. Thanks very much. picture2

emiliofidalgo commented 6 years ago

Hi!

Sorry for my late reply. The performance of the algorithm depends on your needs and the configuration of the corresponding parameters. Certainly, deleting features costs CPU. Several options can be performed to reduce this computational cost:

I hope this helps,

Thank you for trying the code and the corresponding feedback!

YiChenCityU commented 6 years ago

Thanks for your reply. I think maybe my computer has problem. I tried another computer. It didn't cost very high CPU. I also have another question. Does the number of the keypoints in each image has to be same? such as all should be 300, 500. I tried another kind of feature detection method(goodFeatureToTrack in opencv), but I failed to run the main process. This method will return keypoints with different number each time. Am I wrong?

-----index is : 28---size of window_brief_descriptors: 322
----descriptors_mat size: [32 x 322]
cost 0.003972 seconds
Not enough images to found a loop
-----merge cnt: 29
-----size of kps is : 322
-----index is : 29---size of dscs: [0 x 0]
-----index is : 29---size of window_brief_descriptors: 322
----descriptors_mat size: [32 x 322]
cost 0.003246 seconds
Not enough images to found a loop
-----merge cnt: 30
-----size of kps is : 356
-----index is : 30---size of dscs: [0 x 0]
-----index is : 30---size of window_brief_descriptors: 356
----descriptors_mat size: [32 x 356]
terminate called after throwing an instance of 'std::out_of_range'
  what():  vector::_M_range_check
Aborted (core dumped)
emiliofidalgo commented 6 years ago

You can use any number of features, but it makes sense to use more or less the same for each image since this can affect the priority of the loop closure candidates.

Regarding the error, what description method do you use? I mean, goodFeaturesToTrack is used to detect keypoints in the image, but after that, you have to describe each keypoint. OBIndex2 works with binary descriptors (ORB, BRIEF, BRISK, LDB, ...) and you should use one of these to work with iBoW-LCD.

YiChenCityU commented 6 years ago

I found the bug. Maybe the index in the process function should start from 0. I compute the brief descriptor after GFTT. It worked. The accuracy was very good.

emiliofidalgo commented 6 years ago

Nice to hear that!

Thank you again for your feedback!