I am using the C++ implementation of OpenCV 2.4.6.1 for Ubuntu 12.10 on a x86_64 architecture. I am working on wrapping this code of the Agast Corner Detector inside a class inheriting from cv::FeatureDetector
.
Inspecting the feature2d module header code and observing other implementations, I found I should mandatory implement the detectImpl
method:
virtual void detectImpl( const Mat& image, std::vector<KeyPoint>& keypoints, const Mat& mask=Mat() ) const = 0;
Usually it is also implementented a method named operator
having the following signature:
CV_WRAP_AS(detect) void operator()(const Mat& image, CV_OUT std::vector<KeyPoint>& keypoints) const;
Looking at other implementations I cannot say exactly what each of this methods should do. The second one operator
I guess is somehow related to the detect method that is called for detecting keypoints:
cv::Ptr<cv::FeatureDetector> detector = cv::FeatureDetector::create("...");
detector->detect(img, keypoints);
According to your experience what's the difference between this two methods and what should each of them implement?
Related to the detector's instantiation using the factory method cv::FeatureDetector::create
I have some clues related to the attribute info
of type AlgorithmInfo*
usually put as a public attribute of the detector class implementation, and using the CV_INIT_ALGORITHM in the features2d_init
source file.
What should I implement in order to be able to instantiate my custom FeatureDetector using the factory method?