Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Of course there is always a simple solution. The parameters, which you can't easily access in Java are bad for my kind of situation. My input image is pretty small (320x240). So if I split into 4x4 tiles, I have a size of 80x60. The default detector has a edgethreshold of 31 which leaves 0 pixels to detect features on. It's pretty dumb. ^^ Here is the fixed code, so guyy having the same problem can adopt it. I reduced the edgeThreshold to 3.

FeatureDetector det = FeatureDetector.create(FeatureDetector.ORB);
String filename = "/mnt/sdcard/orb_params.yml";
writeFile(filename, "%YAML:1.0\nname: \"Feature2D.Grid\"\ndetector: \n   name: \"Feature2D.ORB\"\n   WTA_K: 2\n   edgeThreshold: 3\n   firstLevel: 0\n   nFeatures: 60\n   nLevels: 8\n   patchSize: 31\n   scaleFactor: 1.2000000476837158e+00\n   scoreType: 0\n   gridCols: 4\n   gridRows: 4\n   maxTotalKeypoints: 500\n");
det.read(filename);

You should really look into the spaces and newlines(\n). There need to be three spaces in front of every "key: value" after the detector: \n. This is the indentation of the Submap. Look into YAML specification to learn more about it.

Here the YAML File in better shape:

%YAML:1.0
name: "Feature2D.Grid"
detector:
name: "Feature2D.ORB"
WTA_K: 2
edgeThreshold: 3
firstLevel: 0
nFeatures: 60
nLevels: 8
patchSize: 31
scaleFactor: 1.2000000476837158e+00
scoreType: 0
gridCols: 8
gridRows: 8
maxTotalKeypoints: 500
click to hide/show revision 2
Adjusted gridCols and gridRows in YAML

Of course there is always a simple solution. The parameters, which you can't easily access in Java are bad for my kind of situation. My input image is pretty small (320x240). So if I split into 4x4 tiles, I have a size of 80x60. The default detector has a edgethreshold of 31 which leaves 0 pixels to detect features on. It's pretty dumb. ^^ Here is the fixed code, so guyy having the same problem can adopt it. I reduced the edgeThreshold to 3.

FeatureDetector det = FeatureDetector.create(FeatureDetector.ORB);
String filename = "/mnt/sdcard/orb_params.yml";
writeFile(filename, "%YAML:1.0\nname: \"Feature2D.Grid\"\ndetector: \n   name: \"Feature2D.ORB\"\n   WTA_K: 2\n   edgeThreshold: 3\n   firstLevel: 0\n   nFeatures: 60\n   nLevels: 8\n   patchSize: 31\n   scaleFactor: 1.2000000476837158e+00\n   scoreType: 0\n   gridCols: 4\n   gridRows: 4\n   maxTotalKeypoints: 500\n");
det.read(filename);

You should really look into the spaces and newlines(\n). There need to be three spaces in front of every "key: value" after the detector: \n. This is the indentation of the Submap. Look into YAML specification to learn more about it.

Here the YAML File in better shape:

%YAML:1.0
name: "Feature2D.Grid"
detector:
name: "Feature2D.ORB"
WTA_K: 2
edgeThreshold: 3
firstLevel: 0
nFeatures: 60
nLevels: 8
patchSize: 31
scaleFactor: 1.2000000476837158e+00
scoreType: 0
gridCols: 8
4
gridRows: 8
4
maxTotalKeypoints: 500