Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

unfortunately, there's no straightforward way to do so, we need the backdoor:

FeatureDetector blobby = FeatureDetector.create(FeatureDetector.SIMPLEBLOB);

blobby.write("/mnt/sdcard/blob.xml");

<opencv_storage> <thresholdstep>10.</thresholdstep> <minthreshold>50.</minthreshold> <maxthreshold>220.</maxthreshold> <minrepeatability>2</minrepeatability> <mindistbetweenblobs>10.</mindistbetweenblobs> <filterbycolor>1</filterbycolor> <blobcolor>0</blobcolor> <filterbyarea>1</filterbyarea> <minarea>25.</minarea> <maxarea>5000.</maxarea> <filterbycircularity>0</filterbycircularity> <mincircularity>8.0000001192092896e-01</mincircularity> <maxcircularity>3.4028234663852886e+38</maxcircularity> <filterbyinertia>1</filterbyinertia> <mininertiaratio>1.0000000149011612e-01</mininertiaratio> <maxinertiaratio>3.4028234663852886e+38</maxinertiaratio> <filterbyconvexity>1</filterbyconvexity> <minconvexity>9.4999998807907104e-01</minconvexity> <maxconvexity>3.4028234663852886e+38</maxconvexity> </opencv_storage>

unfortunately, there's no straightforward way to do so, we need the backdoor:backdoor (save/read xml):

// make a simpleblob detector:
FeatureDetector blobby = FeatureDetector.create(FeatureDetector.SIMPLEBLOB);FeatureDetector.create(FeatureDetector.SIMPLEBLOB);
// save the original config:
// (or use the one below)    
blobby.write("/mnt/sdcard/blob.xml");


<?xml version="1.0"?>
<opencv_storage>
<thresholdStep>10.</thresholdStep>
<minThreshold>50.</minThreshold>
<maxThreshold>220.</maxThreshold>
<minRepeatability>2</minRepeatability>
<minDistBetweenBlobs>10.</minDistBetweenBlobs>
<filterByColor>1</filterByColor>
<blobColor>0</blobColor>
<filterByArea>1</filterByArea>
<minArea>25.</minArea>
<maxArea>5000.</maxArea>
<filterByCircularity>0</filterByCircularity>
<minCircularity>8.0000001192092896e-01</minCircularity>
<maxCircularity>3.4028234663852886e+38</maxCircularity>
<filterByInertia>1</filterByInertia>
<minInertiaRatio>1.0000000149011612e-01</minInertiaRatio>
<maxInertiaRatio>3.4028234663852886e+38</maxInertiaRatio>
<filterByConvexity>1</filterByConvexity>
<minConvexity>9.4999998807907104e-01</minConvexity>
<maxConvexity>3.4028234663852886e+38</maxConvexity>
</opencv_storage>

blobby.write("/mnt/sdcard/blob.xml");

// now edit params as you like, and read it back in:
blobby.read("/mnt/sdcard/blob.xml"); // wherever you put it.
<opencv_storage> <thresholdstep>10.</thresholdstep> <minthreshold>50.</minthreshold> <maxthreshold>220.</maxthreshold> <minrepeatability>2</minrepeatability> <mindistbetweenblobs>10.</mindistbetweenblobs> <filterbycolor>1</filterbycolor> <blobcolor>0</blobcolor> <filterbyarea>1</filterbyarea> <minarea>25.</minarea> <maxarea>5000.</maxarea> <filterbycircularity>0</filterbycircularity> <mincircularity>8.0000001192092896e-01</mincircularity> <maxcircularity>3.4028234663852886e+38</maxcircularity> <filterbyinertia>1</filterbyinertia> <mininertiaratio>1.0000000149011612e-01</mininertiaratio> <maxinertiaratio>3.4028234663852886e+38</maxinertiaratio> <filterbyconvexity>1</filterbyconvexity> <minconvexity>9.4999998807907104e-01</minconvexity> <maxconvexity>3.4028234663852886e+38</maxconvexity> </opencv_storage>