Skip to content

Instantly share code, notes, and snippets.

@beta
Last active March 13, 2016 07:37
Show Gist options
  • Save beta/556757ec813b36fe34a5 to your computer and use it in GitHub Desktop.
Save beta/556757ec813b36fe34a5 to your computer and use it in GitHub Desktop.
Codes for blog "Using Native OpenCV Code in Android Projects"
package com.example.yourapp;
import android.util.Log;
import org.opencv.android.OpenCVLoader;
import org.opencv.core.Mat;
import java.util.ArrayList;
public class CvUtil {
static {
if (!OpenCVLoader.initDebug()) {
Log.d("Error", "Unable to load OpenCV");
} else {
System.loadLibrary("CvExample");
}
}
public static ArrayList<float[]> processMat(Mat mat, float threshold) {
return processMat(mat.getNativeObjAddr(), threshold);
}
public static native ArrayList<float[]> processMat(long matAddr, float threshold);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment