rtabmap icon indicating copy to clipboard operation
rtabmap copied to clipboard

RGB for PyDetector

Open mattiasmar opened this issue 2 years ago • 2 comments

Hello, Is there some parameter that controls whether the PyDetector receives gray images or rgb images?

If not, would introducing a parameter that controls all the calls to cv::cvtColor(imageFrom, tmp, cv::COLOR_BGR2GRAY); in corelib/src/RegistrationVis.cpp be a complete (correct and enough) solution?

mattiasmar avatar Aug 14 '23 13:08 mattiasmar

Oh yeah, it is a good point if the external detector needs RGB. Ideally, we could make an abstract function (e.g., isColorSupported()) for Features2D class that would return if the detector supports RGB or not, then in RegistrationVis, if the detector doesn't support RGB, we don't call cvtColor. The PyDetector class could return true for that function, all other detectors would return false by default. A parameter to PyDetector could be added to say if should support RGB or not.

We would need to deal with asserts like here and here depending if the detector supports RGB or not.

matlabbe avatar Aug 14 '23 20:08 matlabbe

I'll keep this open as it could be a nice enhancement.

matlabbe avatar Dec 10 '23 03:12 matlabbe