Why cv::cuda::DescriptorMatcher not a subclass of cv::DescriptorMatcher [closed]
They both provide the same interface. In my opinion cuda::DescriptorMatcher is a specialized implementation of DescriptorMatcher and so should have been a subclass of DescriptorMatcher. It makes sense to provide one base class providing all the matching interface.
Because of this people cannot use the advantage of dynamic polymerphysm (will have to use ifs to distinguish, care and call objects of different types).
A beautiful analogy would be the class cv::cuda::ORB which is a sublcass cv::ORB and hence cv::FeatureDetector which provides the common interface like detect() and compute()