# Revision history [back]

You have to do a work-around like it was answered [here](https://groups.google.com/forum/?fromgroups=#!searchin/android-opencv/orb$20parameters/android-opencv/-1mXlMNOudI/s7bK0a5xRr8J) in the past.  Check this test to see how it is done: http://code.opencv.org/projects/opencv/repository/revisions/master/entry/modules/java/android_test/src/org/opencv/test/features2d/ORBDescriptorExtractorTest.java String filename = OpenCVTestRunner.getTempFileName("yml"); writeFile(filename, "%YAML:1.0\nscaleFactor: 1.1\nnLevels: 3\nfirstLevel: 0\nedgeThreshold: 31\npatchSize: 31\n"); extractor.read(filename); //note: this will fail if the above parameters are not the ones expected by method (...)  You have to do a work-around like it was answered [here](https://groups.google.com/forum/?fromgroups=#!searchin/android-opencv/orb$20parameters/android-opencv/-1mXlMNOudI/s7bK0a5xRr8J) here in the past.

past.

Check this test to see how it is done: http://code.opencv.org/projects/opencv/repository/revisions/master/entry/modules/java/android_test/src/org/opencv/test/features2d/ORBDescriptorExtractorTest.java

String filename = OpenCVTestRunner.getTempFileName("yml");
writeFile(filename, "%YAML:1.0\nscaleFactor: 1.1\nnLevels: 3\nfirstLevel: 0\nedgeThreshold: 31\npatchSize: 31\n");

extractor.read(filename); //note: this will fail if the above parameters are not the ones expected by method

(...)


You have to do a work-around like it was answered here in the past.

Check this test to see how it is done: http://code.opencv.org/projects/opencv/repository/revisions/master/entry/modules/java/android_test/src/org/opencv/test/features2d/ORBDescriptorExtractorTest.java

These comments have ORB default parameters values that I saw within the source code, but these might be outdated and might have errors. Chech the source yourself to make sure.

    // ORB Default values:
// float scaleFactor = 1.2f // Coefficient by which we divide the dimensions from one scale pyramid level to the next
// uint nLevels      = 8   // The number of levels in the scale pyramid
// uint firstLevel   = 0   // The level at which the image is given
// int edgeThreshold = 31  // How far from the boundary the points should be.
// int patchSize     = 31  // You can not change this, it is allways 31

// int WTA_K = 2           // How many random points are used to produce each cell of the descriptor (2, 3, 4 ...)
// scoreType = 0           // 0 for HARRIS_SCORE / 1 for FAST_SCORE
// nFeatures = 500        // not sure if 500 is default

String filename = OpenCVTestRunner.getTempFileName("yml");
writeFile(filename, "/mnt/sdcard/orb_params.yml";
writeFile(paramFile, "%YAML:1.0\nscaleFactor: 1.1\nnLevels: 3\nfirstLevel: 0\nedgeThreshold: 1.2\nnLevels: 8\nfirstLevel: 0 \nedgeThreshold: 31\npatchSize: 31\n");
31\nWTA_K: 2\nscoreType: 0\nnFeatures: 500\n");

extractor.read(filename); //note: this will fail if the above parameters are not the ones expected by method

detector.detect(img, keypoints);
(...)


You have to do a work-around like it was answered here in the past.

Check this test to see how it is done: http://code.opencv.org/projects/opencv/repository/revisions/master/entry/modules/java/android_test/src/org/opencv/test/features2d/ORBDescriptorExtractorTest.java

These comments have ORB default parameters values that I saw within the source code, but these might be outdated and might have errors. Chech the source yourself to make sure.

    // ORB Default values:
// float scaleFactor = 1.2f // Coefficient by which we divide the dimensions from one scale pyramid level to the next
// uint nLevels      = 8   // The number of levels in the scale pyramid
// uint firstLevel   = 0   // The level at which the image is given
// int edgeThreshold = 31  // How far from the boundary the points should be.
// int patchSize     = 31  // You can not change this, it is allways 31

// int WTA_K = 2           // How many random points are used to produce each cell of the descriptor (2, 3, 4 ...)
// scoreType = 0           // 0 for HARRIS_SCORE / 1 for FAST_SCORE
// nFeatures = 500        // not sure if 500 is default

String filename = "/mnt/sdcard/orb_params.yml";
"/path/to/file/orb_params.yml";
writeFile(paramFile, "%YAML:1.0\nscaleFactor: 1.2\nnLevels: 8\nfirstLevel: 0 \nedgeThreshold: 31\npatchSize: 31\nWTA_K: 2\nscoreType: 0\nnFeatures: 500\n");

extractor.read(filename); //note: this will fail if the above parameters are not the ones expected by method

detector.detect(img, keypoints);
(...)