Search code examples
opencvsiftsurf

Extract less keypoint with opencv


I need to do an object recognition in real time (with image coming from videocamera usb)

Is there anyway to tell

SurfFeatureDetector.detect(); 

to extract less keypoint ?


Solution

  • Here is the constructor for SurfFeatureDetector. With the constructor, you can decrease the number of keypoints with the 3 basic arguments:

    • hessianThreshold: increase this
    • octaves: decrease this
    • octavelayers: decrease this

    I don't know the details of SURF implementation, but this SO answer points to documentation which explains the whole algorithm so you can choose how to change those.

    As an alternative to studying the implementation directly, I have found Find-Object to be very useful for experimenting with many of the feature detection algorithm settings.