Last active
March 13, 2016 07:37
-
-
Save beta/556757ec813b36fe34a5 to your computer and use it in GitHub Desktop.
Codes for blog "Using Native OpenCV Code in Android Projects"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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