Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Custom SIFT detector in OpenCV

Is there a way to specify custom SIFT detector parameters in OpenCV?

It seems that the FeatureDetector constructor does not take any parameter, whereas it seems possible to specify those parameters in the SIFT constructor.

I am working on logo detection. Some of the logos have very low texture information, so I would like to detect more keypoints when there are too few (I could increase the edgeThreshold of SIFT?).

Custom SIFT detector in OpenCV

Is there a way to specify custom SIFT detector parameters in OpenCV?

It seems that the FeatureDetector constructor does not take any parameter, whereas it seems possible to specify those parameters in the SIFT constructor.

I am working on logo detection. Some of the logos have very low texture information, so I would like to detect more keypoints when there are too few (I could increase the edgeThreshold of SIFT?).

Answer:

It is possible to create a custom SIFT descriptor extractor:

SIFT siftDetectorExtractor = SIFT(200, 3, 0.04, 15, 1.6);

Mat logo = imread("logoName.jpg");

vector<KeyPoint> keyPoints;
Mat sifts;
siftDetectorExtractor(logo, Mat(), keyPoints, sifts);