Added the camera calibration pattern detection.

This commit is contained in:
2014-04-09 14:56:00 -04:30
parent 5c92d603d2
commit 453c3a36e5
5 changed files with 304 additions and 322 deletions

View File

@@ -57,17 +57,18 @@ public class MainActivity extends AndroidApplication implements Toaster, Multica
static{
if(!OpenCVLoader.initDebug()){
Gdx.app.exit();
System.exit(1);
}
try{
System.loadLibrary("cvproc");
ocvOn = true;
}catch(UnsatisfiedLinkError u){
Gdx.app.exit();
System.exit(1);
}
}
public native void getMarkerCodesAndLocations(long inMat, long outMat, int[] codes);
public native void findCalibrationPattern(long inMat, long outMat);
@Override
public void onCreate(Bundle savedInstanceState){
@@ -167,7 +168,8 @@ public class MainActivity extends AndroidApplication implements Toaster, Multica
Mat outImg = new Mat();
Utils.bitmapToMat(tFrame, inImg);
getMarkerCodesAndLocations(inImg.getNativeObjAddr(), outImg.getNativeObjAddr(), codes);
//getMarkerCodesAndLocations(inImg.getNativeObjAddr(), outImg.getNativeObjAddr(), codes);
findCalibrationPattern(inImg.getNativeObjAddr(), outImg.getNativeObjAddr());
Mat temp = new Mat();
Imgproc.cvtColor(outImg, temp, Imgproc.COLOR_BGR2RGB);