From 525da9ef019d53a496854681b821885f02e1b3de Mon Sep 17 00:00:00 2001 From: Ethan Rublee Date: Tue, 12 Oct 2010 02:23:08 +0000 Subject: [PATCH] working on cleaning up the android port - trying to fix the distortion coefficients bug --- android/android-jni/Makefile | 7 +++---- android/android-jni/jni/Calibration.cpp | 2 +- android/android-jni/project_create.sh | 4 ++++ 3 files changed, 8 insertions(+), 5 deletions(-) create mode 100755 android/android-jni/project_create.sh diff --git a/android/android-jni/Makefile b/android/android-jni/Makefile index 8cccd68e2a..db1c2a2eb6 100644 --- a/android/android-jni/Makefile +++ b/android/android-jni/Makefile @@ -1,7 +1,7 @@ # The path to the NDK, requires crystax version r-4 for now, due to support -#for the standard library +# for the standard library -#load environment from local make file +# load environment from local make file LOCAL_ENV_MK=local.env.mk ifneq "$(wildcard $(LOCAL_ENV_MK))" "" include $(LOCAL_ENV_MK) @@ -9,8 +9,7 @@ else $(shell cp sample.$(LOCAL_ENV_MK) $(LOCAL_ENV_MK)) $(info ERROR local environement not setup! try:) $(info gedit $(LOCAL_ENV_MK)) -$(info Please setup the $(LOCAL_ENV_MK) - the default was just created') -include $(LOCAL_ENV_MK) +$(error Please setup the $(LOCAL_ENV_MK) - the default was just created') endif ANDROID_NDK_BASE = $(ANDROID_NDK_ROOT) diff --git a/android/android-jni/jni/Calibration.cpp b/android/android-jni/jni/Calibration.cpp index c9df5ee2ed..c3e95fecc1 100644 --- a/android/android-jni/jni/Calibration.cpp +++ b/android/android-jni/jni/Calibration.cpp @@ -69,7 +69,7 @@ bool runCalibration(vector > imagePoints, if (flags & CV_CALIB_FIX_ASPECT_RATIO) cameraMatrix.at (0, 0) = aspectRatio; - distCoeffs = Mat::zeros(5, 1, CV_64F); + distCoeffs = Mat::zeros(4, 1, CV_64F); vector > objectPoints(1); calcChessboardCorners(boardSize, squareSize, objectPoints[0]); diff --git a/android/android-jni/project_create.sh b/android/android-jni/project_create.sh new file mode 100755 index 0000000000..0a1b6bd308 --- /dev/null +++ b/android/android-jni/project_create.sh @@ -0,0 +1,4 @@ +#!/bin/sh +#this generates an ant based cli build of the android-jni project +android update project --name android-opencv \ +--path .