Feature: RTAB-Map SuperPoint feature extraction with OpenVINO (CPU/NPU) - #3
Feature: RTAB-Map SuperPoint feature extraction with OpenVINO (CPU/NPU)#3naidjeldias wants to merge 2 commits into
Conversation
Implemented Superpoint feature extraction module from RTAB-Map to run on Intel NPU hardware.
naidjeldias
left a comment
There was a problem hiding this comment.
Summary
The actual OpenVINO work is a focused, well-structured addition (commit 98cd9a89, 8 files / ~473 lines): a SuperPointOpenVINO backend that mirrors the existing Torch integration, caches descriptor tensors between generateKeypointsImpl / generateDescriptorsImpl, and adds Noble Docker + CMake wiring for Intel GPU/NPU.
However, the PR as opened is not merge-ready in its current form.
Blocking issues
1. PR scope (217 commits / 358 files)
The branch contains a large upstream sync plus the OpenVINO feature. GitHub reports mergeable_state: dirty. For review and maintenance, please split into:
- PR A: rebase/sync
noetic-devel(or merge upstream separately) - PR B: OpenVINO SuperPoint only (~8 files)
2. Build breakage risk
WITH_OPENVINO=ON by default + FIND_PACKAGE(OpenVINO REQUIRED) will fail cmake on systems without OpenVINO. Recommend opt-in default (OFF).
3. Enum value kFeatureSuperPointOpenVINO=99
Looks temporary. Should be the next sequential enum value (17) to stay consistent and avoid config collisions.
4. Missing GUI integration
No entry in preferencesDialog.ui / PreferencesDialog.cpp for model path, device, or detector selection. Torch and Rpautrat are fully wired — OpenVINO is CLI/params-only today.
5. Error visibility
Model load / inference failures are silent (catch(...) {}, no UERROR). Users will see empty keypoints with no explanation.
6. ROI handling
roi parameter is ignored; Torch explicitly errors on non-zero ROI. Please align behavior.
Non-blocking but recommended
| Area | Note |
|---|---|
| Naming | Typo "OpenVINNO" in PR title + commit message |
| Comments | Portuguese comments in .cpp — use English for upstream consistency |
| Formatting | Leading spaces on every line in new .h/.cpp files |
| Constructor | Initialize members from Parameters::default* like SuperPointTorch |
| NMS | CPU greedy NMS differs from Torch max-pool NMS — may change keypoint sets |
| Default device | Parameter default is CPU; PR goal is NPU — consider NPU or AUTO default + docs |
| Docs | No README on exporting/converting SuperPoint to OpenVINO IR (.xml/.bin) |
| Tests | No unit/smoke test for model load + keypoint/descriptor output |
| Thread safety | mutable descriptor cache + const descriptor method — verify against RTAB-Map threading model |
| Performance | image.clone() + memcmp on every descriptor call — consider pointer/size check only |
What looks good
- Clean adapter split (
SPDetectorOpenVINO+SuperPointOpenVINO) - Reuses existing SuperPoint params (threshold, NMS, radius)
- Handles both flat heatmap and 65-channel softmax output layouts
- Descriptor bilinear sampling + L2 norm matches Torch path
#ifdef RTABMAP_OPENVINOguards inFeatures2d.cpp- Noble Dockerfile documents Intel OpenVINO 2025 + NPU driver stack
Suggested test plan
- Build with
-DWITH_OPENVINO=ONon Noble Docker image - Run with
Kp/DetectorStrategyset to the OpenVINO enum + valid IR model path - Compare keypoint count / descriptor norms vs Torch backend on a fixed frame
- Verify
SuperPoint/OpenVINODevice=NPUon Intel NPU hardware - Confirm graceful fallback + log message when model path is invalid
- Confirm Preferences UI can select and persist OpenVINO settings (once added)
Verdict: Promising feature implementation, but needs work before merge — split scope, resolve conflicts, and address enum/GUI/error-handling issues; make OpenVINO opt-in by default.
| option(WITH_ORB_OCTREE "Include ORB Octree feature support" ON) | ||
| option(WITH_TORCH "Include Torch support (SuperPoint)" OFF) | ||
| option(WITH_TORCH "Include Torch support (SuperPoint)" ON) | ||
| option(WITH_OPENVINO "Include OpenVINO support (SuperPoint)" ON) |
There was a problem hiding this comment.
WITH_OPENVINO defaults to ON and FIND_PACKAGE(OpenVINO REQUIRED ...) will fail configuration on machines without OpenVINO installed. Consider defaulting to OFF (like WITH_TORCH historically) so the feature is opt-in and does not break existing build pipelines.
| try { | ||
| compiledModel_ = core_.compile_model(path, device_); | ||
| inferRequest_ = compiledModel_.create_infer_request(); | ||
| } catch(...) {} |
There was a problem hiding this comment.
Model load failures are swallowed silently (catch(...) {} and early return without logging). The Torch backend logs UERROR when the path is empty/missing — please mirror that so users know why SuperPoint returns zero keypoints.
| } catch(...) {} | ||
| } | ||
|
|
||
| SuperPointOpenVINO::SuperPointOpenVINO(const ParametersMap & parameters) |
There was a problem hiding this comment.
Unlike SuperPointTorch, this constructor does not initialize path_, threshold_, nms_, minDistance_, or device_ before parseParameters(). If parsing misses a key, members may be uninitialized. Please follow the SuperPointTorch initializer-list pattern.
| } | ||
| } | ||
|
|
||
| std::vector<cv::KeyPoint> SuperPointOpenVINO::generateKeypointsImpl(const cv::Mat & image, const cv::Rect & roi, const cv::Mat & mask) |
There was a problem hiding this comment.
roi is ignored. SuperPointTorch::generateKeypointsImpl explicitly rejects non-zero ROI with UERROR. Either add the same guard or document that ROI-based keypoint extraction is unsupported for this backend.
| #endif | ||
| #ifdef RTABMAP_OPENVINO | ||
| case Feature2D::kFeatureSuperPointOpenVINO: | ||
| feature2D = new SuperPointOpenVINO(parameters); |
There was a problem hiding this comment.
No Preferences UI wiring for OpenVINO model path / device (Torch and Rpautrat both have combo entries and parameter fields in preferencesDialog.ui + PreferencesDialog.cpp). Without this, users cannot select SUPERPOINT_OPENVINO from the GUI.
…ion to the repository
Summary
Adds SuperPoint feature extraction via Intel OpenVINO, enabling SuperPoint inference on Intel CPU and Meteor Lake NPU as an alternative to the existing Torch backend.
This is a focused Synkar fork change (~8 files):
SuperPointOpenVINObackend, CMake/Docker wiring, and model conversion script.What changed
SuperPointOpenVINO/SPDetectorOpenVINObackend (mirrors Torch integration pattern)WITH_OPENVINOandRTABMAP_OPENVINOguards inFeatures2d.cppSuperPoint/OpenVINOModelPath,SuperPoint/OpenVINODevice(CPU,NPU,GPU,AUTO)convert_superpoint.py: TorchScript → OpenVINO IR export (fixed 848×480 input for NPU)Design notes
Feature type ID
99(intentional)kFeatureSuperPointOpenVINO=99is deliberate on this fork to avoid enum collisions with future upstream extractors (17,18, …). Synkar DBs and configs use:Kp/DetectorStrategy=99Vis/FeatureType=99Required runtime parameter:
Kp/BadSignRatio=0Validation on dabi_floor0 (reprocessed from Torch reference DB) showed that the default
Kp/BadSignRatio=0.5interacts badly with OpenVINO SuperPoint:0.5 × Kp/MaxFeatures→ 250 keypoints with default max featuresThis is not an OpenVINO inference failure. With
Kp/BadSignRatio=0, descriptor completeness is restored and loop counts match Torch.Recommended Synkar production config:
Validation results (Intel Meteor Lake, dabi_floor0)
Reprocessed from Torch reference DB (
dabi_floor0-5.5.0-2026-04-29.db) withKp/BadSignRatio=0:OpenVINODevice=NPU)OpenVINODevice=CPU)Conclusions:
BadSignRatiois disabledBuild
docker build -f docker/noble/Dockerfile -t rtabmap:openvino .Model conversion
Input images must match the exported shape (848×480 grayscale) or the IR model must be re-exported for your camera resolution.
Test plan
-DWITH_OPENVINO=ON(Noble Docker image)Kp/DetectorStrategy=99+ valid IR modelSuperPoint/OpenVINODevice=NPUon Intel Meteor Lake NPUKp/BadSignRatio=0UERRORlogging on model load / inference failureKnown limitations
BadSignRatio=0)