rst-tu-dortmund / costmap_converter

A ros package that includes plugins and nodes to convert occupied costmap2d cells to primitive types
138 stars 106 forks source link

Make `BlobDetector` inherit from `cv::Feature2D` #41

Open lopsided98 opened 1 year ago

lopsided98 commented 1 year ago

BlobDetector currently inherits from cv::SimpleBlobDetector, which is an interface class that doesn't provide any functionality itself. On the other hand, every time OpenCV adds a new pure virtual method to this interface, it breaks BlobDetector.

This patch makes BlobDetector inherit from cv::Feature2D instead, which should hopefully have fewer breaking changes. This requires adding a typedef for Params, which was originally provided by cv::SimpleBlobDetector. I also took the opportunity to make all the parameters reference this typedef rather than directly use cv::SimpleBlobDetector::Params.

It is likely possible to remove inheritance from BlobDetector altogether, since it doesn't appear to use any functionality from cv::Feature2D either, but I decided not to do this because BlobDetector is technically part of the public interface, and this could increase the likelihood of breaking downstream packages that use this class (if any do).

I have not done any runtime testing of this, since I don't actually use this package and was just nerdsniped into fixing this by @muellerbernd and @twdragon.

Fixes #38.