Using bagOfFeatures with RosBag data (storage efficiency)?
1 次查看(过去 30 天)
显示 更早的评论
We're working on an application to do feature recognition and SLAM using the bagOfFeatures objects. I was wondering whether there are any ways to do this efficiently as the process seems to be quite inefficient in terms of memory and storage.
- Data are acquired in a ROS2-RosBag, including the logged imagery.
- Building the bagOfFeatures requires converting the RosBag into an imageDatastore
- Building the bagOfFeatues makes another copy of the images, adding them to the BOF structure.
So that's at least three copies of the same data, which for even modest travel distances can get very large. Even if we assume a fairly infrequent keyframe selection, we would still need to convert the RosBag into an imageDatastore before use. Am I missing something obvious?
0 个评论
回答(1 个)
Ninad
2024-1-23
Hi John,
I understand that you are using bagOfFeatures objects for feature recognition, and at least three copies of the same images are created.
You can use a custom feature extractor function to extract features from the images in Datastore. This would reduce memory and storage usage, and you can avoid creating a separate copy of the images in the BOF structure.
There is a "CustomExtractor" option in the "bagOfFeatures" object constructor. Upon using the constructor, it will return a bag of features that uses a custom feature extractor function to extract features from images in "imds.extractorFcn" (It is a function handle to a custom feature extraction function).
Please refer the following MATLAB Documentation to understand how to Create a Custom Feature Extractor:
You can also downsample the images before creating the bagOfFeatures object using the "imresize" function in MATLAB.
For more details about the "bagOfFeatures" object, please go through the following MATLAB Documentation:
Hope this helps.
Regards
Ninad
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!