Ask Your Question
0

How do you change the settings of the FeatureDetector in Java?

asked 2017-06-13 20:41:24 -0600

Using the code below:

Mat img = Imgcodecs.imread(imageFilepath, Imgcodecs.CV_LOAD_IMAGE_GRAYSCALE);

MatOfKeyPoint points = new MatOfKeyPoint();

FeatureDetector featureDetector = FeatureDetector.create(FeatureDetector.FAST);
featureDetector.read("param.yaml");
featureDetector.write("test.yaml");
featureDetector.detect(img, points);

System.out.println("Detected " + points.size() + " points in the image");

Contents of param.yaml:

%YAML:1.0
thresholdStep: 10000.
minThreshold: 50.
maxThreshold: 220.
minRepeatability: 2
minDistBetweenBlobs: 10.
filterByColor: 1
blobColor: 0
filterByArea: 1
minArea: 25.
maxArea: 5000.
filterByCircularity: 0
minCircularity: 8.0000001192092896e-001
maxCircularity: 3.4028234663852886e+038
filterByInertia: 1
minInertiaRatio: 1.0000000149011612e-001
maxInertiaRatio: 3.4028234663852886e+038
filterByConvexity: 1
minConvexity: 9.4999998807907104e-001
maxConvexity: 3.4028234663852886e+038

Contents of test.yaml seems to be blank even after the read.

%YAML:1.0
---
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-06-13 23:11:10 -0600

berak gravatar image

you're out of luck here. the FAST detector does not read/write any values , also your params.yaml seems to be from the SimpleBlobDetector, a different, unrelated class.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-06-13 20:41:24 -0600

Seen: 106 times

Last updated: Jun 13 '17