How to? Aruco java...

asked 2016-12-28 08:45:29 -0500

Hello all. I build OpenCV and Aruco module, from Git... Build script:

mkdir -p build_android_armeabi-v7a
cd build_android_armeabi-v7a

cmake \
-DANDROID_ABI=armeabi-v7a \
-DANDROID_NATIVE_API_LEVEL=android-14 \
-DANDROID_SDK=/Users/admin/Library/Android/sdk \
-DANDROID_NDK=/Users/admin/Library/Android/sdk/ndk-bundle \
-DANT_EXECUTABLE=/Users/admin/Documents/apache-ant/bin/ant \
-DJAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home \
-DJAVA_JVM_LIBRARY=/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/include/jni.h \
-DJAVA_INCLUDE_PATH=/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/include \
-DBUILD_FAT_JAVA_LIB=ON \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_TOOLCHAIN_FILE=../android/android.toolchain.cmake $@ ../..

everything went well. i include libraries and generated java classes in Android Studio. OpenCV is working, I tried several functions and it works. But with Aruco something is wrong, it always crash on Aruco.detectMarkers

Mat inputImage = inputFrame.gray();
List<Mat> corners = new ArrayList<>();
Mat ids = new Mat();
Dictionary dictionary = Aruco.getPredefinedDictionary(Aruco.DICT_6X6_250);
Aruco.detectMarkers(inputImage, dictionary, corners, ids);

if i will use this:

List<Mat> rejectedImgPoints = new ArrayList<>();
DetectorParameters detectorParameters = DetectorParameters.create();
Aruco.detectMarkers(inputImage, dictionary, corners, ids, detectorParameters, rejectedImgPoints);

i always get assert in this line:

CV_Assert(params->adaptiveThreshWinSizeMin >= 3 && params->adaptiveThreshWinSizeMax >= 3);

Please help! I would not want to use C ++ code. I want to write a program in Java only.

edit retag flag offensive close merge delete

Comments

Hey westman2000, have you solved this problem yet? I have managed to get stuck in exactly the same situation. When I print the threshold values to logcat they are 3 and 23 (min-max resp.), but all the same the assertion fails. I have no idea what could cause this (I am a novice at C++)

MisterPro gravatar imageMisterPro ( 2017-03-27 15:08:18 -0500 )edit