2

I'm using Dense algorithm implementation in OpenCV. Version 2.4.x

I would like to know if there is an option to modify the feature detection so that not each pixel is looked on but maybe each 5th. Doing that i can reduce the data and speed up the process. Even better would be to put a grid on the picture where only the middle pixel is relevant. But i couldn't find a way.

This is my code so far:

    System.loadLibrary(Core.NATIVE_LIBRARY_NAME);

    String sourcePath = path;
    Features2d features2d = new Features2d();
    Mat srcImgMat = Highgui.imread(sourcePath);

    MatOfKeyPoint matOfKeyPoints = new MatOfKeyPoint(); 

    FeatureDetector blobDetector = FeatureDetector
            .create(FeatureDetector.DENSE);
    blobDetector.detect(srcImgMat, matOfKeyPoints);

Documentation

Any ideas?Thanks

Jürgen K.
  • 3,427
  • 9
  • 30
  • 66

1 Answers1

0

Dense feature detector defined as

class DenseFeatureDetector : public FeatureDetector
    {
    public:
            DenseFeatureDetector( float initFeatureScale=1.f, int featureScaleLevels=1,
                          float featureScaleMul=0.1f,
                          int initXyStep=6, int initImgBound=0,
                          bool varyXyStepWithScale=true,
                          bool varyImgBoundWithScale=false );
    protected:
    ...
};

I think initXyStep is the parameter you need to play with.

Andrey Smorodov
  • 10,649
  • 2
  • 35
  • 42