Ask Your Question

gi's profile - activity

2017-07-27 03:05:30 -0600 asked a question Publish SIFT or SURF at playstore?

Hi, I've search everywhere about this. Can I publish my application that's using SURF or SIFT detector at Google playstore? If I should pay for the license, do you know who to contact or the official website and payment?

2016-11-04 09:35:53 -0600 commented question Android: How to change GRID_ORB parameters?

I'm recognizing money. This is the money link. ORB tends to clump around the number on the top left, and the word on the bottom left, which look similar in every other money, so it usually gives wrong result. It's a little bit better with GRID_ORB. But for my project, I need to analize the best parameter, which I can't change in GRID_ORB.

2016-11-04 08:08:42 -0600 commented question Android: How to change GRID_ORB parameters?

@berak is there any way to do GRID manually with ORB? Because in my case, ORB tends to clumping around certain area.

2016-11-03 11:25:57 -0600 asked a question Android: How to change GRID_ORB parameters?

Hi, I can change ORB parameters but I can't change GRID_ORB parameters. I'm using GRID_ORB for feature detector in Android Studio. I'm trying to change the parameters based on this. When I change nFeatures to 60 and maxTotalKeypoints to 60 too, it still give me 500 keypoints (default). This is my code that isn't working:

File outputDir = getCacheDir();
File outputFile = null;
try {
    outputFile = File.createTempFile("orbDetectorParams", ".YAML", outputDir);
    writeToFile(outputFile, "%YAML:1.0\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: 60\n");
} catch (IOException e) {
    e.printStackTrace();
}
detector.read(outputFile.getPath());

This is how I change ORB parameters:

writeToFile(outputFile, "%YAML:1.0\nscaleFactor: 1.2\nnLevels: 8\nfirstLevel: 0 \nedgeThreshold: 31\npatchSize: 31\nWTA_K: 2\nscoreType: 1\nnFeatures: 60\n");

I've tried almost everything but it's still not working. Can you help me?

2016-08-18 08:52:57 -0600 commented answer Best way to store a Mat object in Android

it's late, but maybe changing byte[] data into float[] data for CV_32f matrices can do it. And other type for other matrices. Based from here

2016-08-03 12:18:41 -0600 commented answer ORB keypoints distribution over an image

Sorry, I tried to change this code to Java, but I can't understand the sort function? and swap function? numeric_limits? and keypoints[i].pt - keypoints[j].pt in Java can't substract points. Can you help me?

2016-07-29 03:59:30 -0600 asked a question Adaptive non maximal suppression for keypoints distribution Java?

Hi, I'm sorry to ask but I'm new to OpenCV for Android, and I've tried to change this code on the last answer to Java. The questions are:

  1. I don't understand sort function. Is that from library? If it's not how should I make it?
  2. Is the numeric_limits I set myself? If yes, what number should I set it to?
  3. Core.norm( keypoints.get(i).pt - keypoints.get(j).pt ) Java can't substract Point with Point. I've tried Point temp = new Point(keypoints.get(i).pt.x - keypoints.get(j).pt.x, keypoints.get(i).pt.y - keypoints.get(j).pt.y) but the Core.norm need Mat parameter.
  4. swap function on the bottom?

The code that I change

public void adaptiveNonMaximalSuppresion( List<KeyPoint> keypoints,
                                   const int numToKeep )
{
    if( keypoints.size() < numToKeep ) { return; }

    //
    // Sort by response
    //

    //sort( keypoints.begin(), keypoints.end(), 
    //[&]( const cv::KeyPoint& lhs, const cv::KeyPoint& rhs )
    //{
    //    return lhs.response > rhs.response;
    //} );

    List<KeyPoint> anmsPts = new ArrayList<KeyPoint>();

    List<Double> radii = new ArrayList<Double>();
    //radii.resize( keypoints.size() );
    List<Double> radiiSorted = new ArrayList<Double>();
    //radiiSorted.resize( keypoints.size() );

    Float robustCoeff = 1.11f; // see paper

    for( int i = 0; i < keypoints.size(); ++i )
    {
        Float response = keypoints.get(i).response * robustCoeff;
        Double radius = numeric_limits<Double>::max();
        for( int j = 0; j < i && keypoints[j].response > response; ++j )
        {
            radius = Math.min( radius, Core.norm( keypoints.get(i).pt - keypoints.get(j).pt ) );
        }
        radii.set(i,radius);
        radiiSorted.set(i,radius);
    }

    //std::sort( radiiSorted.begin(), radiiSorted.end(),
    //[&]( const double& lhs, const double& rhs )
    //{
    //    return lhs > rhs;
    //} );

    Double decisionRadius = radiiSorted.get(numToKeep);
    for( int i = 0; i < radii.size(); ++i )
    {
        if( radii.get(i) >= decisionRadius )
        {
            anmsPts.add( keypoints.get(i) );
        }
    }

    anmsPts.swap( keypoints );
}
2016-07-29 03:16:17 -0600 received badge  Supporter (source)
2016-07-29 03:04:45 -0600 received badge  Scholar (source)
2016-07-29 02:20:30 -0600 received badge  Enthusiast
2016-07-27 05:16:26 -0600 answered a question Build opencv 3.1.0 extra module for android on Mac?

I've finally found tutorial that works for me. I've decided to downgrade my OpenCV to version 2.4.11, and it works like a charm.

Youtube tutorial

2016-07-22 15:28:17 -0600 answered a question Unable to convert color image to grayscale in android opencv

If gray mat is still coloured image, then maybe the problem is on Imgproc.cvtColor. Have you tried using new Mat without parameter?

Mat gray = new Mat();

or, maybe turn it to grayscale and put it back to imgSource should work fine too

Imgproc.cvtColor(imgSource, imgSource, Imgproc.COLOR_BGR2GRAY);

2016-07-22 12:56:52 -0600 received badge  Editor (source)
2016-07-22 10:09:17 -0600 asked a question Build opencv 3.1.0 extra module for android on Mac?

Hi, I'm new to OpenCV and want to use SIFT and SURF features detector on Android Studio that is available on opencv_contrib. I'm using these tutorial (with modification) to build opencv 3.1.0 extra module https://github.com/tzutalin/build-ope... and this tutorial https://github.com/alexkarargyris/Caf... but it shows the same error like this, eventhough I already declared it -DANDROID_NDK=/Documents/android-ndk-r8e

-- Caffe: NO -- Protobuf: NO -- Glog: NO

CMake Error at /Users/giovinnakhoharja/build-opencv-for-android/android-ndk-downloader/opencv/platforms/android/android.toolchain.cmake:447 (message): Could not find neither Android NDK nor Android standalone toolchain.

I can show you the ErrorLog if you want. And then I try to use CMake GUI with some modification of this tutorial https://zami0xzami.wordpress.com/2016... but even when I already make new entry of ANDROID_NDK, after I press configure (using Unix Makefiles because Mac don't have MinGW) the variable ANDROID_NDK is missing.

I have El Captian 10.11.1, CMake.app 3.6.0, Android NDK r8e Darwin x86_64 (because CMakeList.txt says that it supports only r5-r10). I already install CMake on command line. Can someone tell me what is wrong?