Image Moments in Android Studio Force Close
<p>Hello i have a problem with an app that I created using android studio, I make image processing applications using the method of moments. When in the build and make the project become apk no errors, but when I run my project on smartphone, my project experience force close and can not access the programs that I have created. After that I tried to build the program but only convert a regular color and the results can be run on a smartphone. I want to ask if anyone here know or have already done or create a similar project with me? if anything I really hope someone can help me. I will attach the following code and error I found. I use OpenCV studio android 3.1 and 2.1.2. Thank you very much.</p>

<pre><code>package boeedapplication.wisudanovember2016;

    import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.SurfaceView;

import org.opencv.android.BaseLoaderCallback;
import org.opencv.android.CameraBridgeViewBase;
import org.opencv.android.CameraBridgeViewBase.CvCameraViewListener2;
import org.opencv.android.JavaCameraView;
import org.opencv.android.LoaderCallbackInterface;
import org.opencv.android.OpenCVLoader;
import org.opencv.core.Core;
import org.opencv.core.CvType;
import org.opencv.core.Mat;
import org.opencv.core.Point;
import org.opencv.core.Scalar;

public class Main2Activity extends Activity implements CvCameraViewListener2 {
    private static final String TAG = Main2Activity.class.getCanonicalName();
    private BaseLoaderCallback mLoaderCallback = new BaseLoaderCallback(this) {
        @Override
        public void onManagerConnected(int status) {
            switch (status) {
                case LoaderCallbackInterface.SUCCESS: {
                    Log.i(TAG, "OpenCV loaded successfuly");
                    mOpenCVCameraView.enableView();
                    break;

                }
                default: {
                    super.onManagerConnected(status);
                }
            }

        }
    };
    private JavaCameraView mOpenCVCameraView;

    private Mat mRgba;
    private Mat mGray;

    private Scalar minThresh;
    private Scalar maxThresh;

    private Point center;
    private Scalar centerColor;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main2);

        mOpenCVCameraView = (JavaCameraView) findViewById(R.id.MainActivityCameraView);
        mOpenCVCameraView.setVisibility(SurfaceView.VISIBLE);
        mOpenCVCameraView.setCvCameraViewListener(this);
        mOpenCVCameraView.setMaxFrameSize(320, 240);


    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        //getMenuInflater().inflate(R.menu.main, menu);
        //return true;
        return super.onCreateOptionsMenu(menu);

    }

public void onResume() {
    super.onResume();
    OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_3_0_0, this, mLoaderCallback);
}

public void onDestroy() {
    super.onDestroy();
    if (mOpenCVCameraView != null) {
        mOpenCVCameraView.disableView();
    }
}

@Override
public void onCameraViewStarted(int width, int height) {
    mRgba = new Mat(height, width, CvType.CV_8UC4);
    mGray = new Mat(height, width, CvType.CV_8UC1);

    minThresh = new Scalar(100);
    maxThresh = new Scalar(255);
    centerColor = new Scalar(255, 255, 255, 200); // R, G, B, Alpha(Trasnparancy)
}

@Override
public void onCameraViewStopped() {
    mRgba.release();
    mGray.release();
}

@Override
  public Mat onCameraFrame(CameraBridgeViewBase.CvCameraViewFrame inputFrame) {
    mRgba = inputFrame.rgba();
    mGray = inputFrame.gray();

   Core.inRange(mGray, minThresh, maxThresh, mGray);
   Moments moments = Imgproc.moments(mGray);
    double x = moments.m10/moments.m00;
    double y = moments.m01/moments.m00;
    center = new Point(x,y);
    Imgproc.circle(mRgba, center, 2, centerColor);

    return mGray;
}
</code></pre>

<p>}</p>

<p><a href="http://i.stack.imgur.com/VdRO0.jpg" rel="nofollow">and the following is also a problem that I encountered on a smartphone when I run the program and the results will force close</a></p>

<blockquote>
  <p>java.lang.UnsatisfiedLinkError: No implementation found for double[]
  org.opencv.imgproc.Imgproc.moments_1(long) (tried
  Java_org_opencv_imgproc_Imgproc_moments_11 and
  Java_org_opencv_imgproc_Imgproc_moments_11__J)    at
  org.opencv.imgproc.Imgproc.moments_1(Native Method)   at
  org.opencv.imgproc.Imgproc.moments(Imgproc.java:584)  at
  boeedapplication.wisudanovember2016.Main2Activity.onCameraFrame(Main2Activity.java:109)
    at
  org.opencv.android.CameraBridgeViewBase.deliverAndDrawFrame(CameraBridgeViewBase.java:391)
    at
  org.opencv.android.JavaCameraView$CameraWorker.run(JavaCameraView.java:350)
    at java.lang.Thread.run(Thread.java:818)</p>
</blockquote>