Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Why cv::cuda::DescriptorMatcher not a subclass of cv::DescriptorMatcher

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).

Any comment?

Why cv::cuda::DescriptorMatcher not a subclass of cv::DescriptorMatcher

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).

Any comment?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()