Open pro2on opened 3 years ago
For now using workaround with functions I need in android. As there is a problem with Matx class - JNI is not created for it and as a result all functions with input parameter with this type also skipped.
So solution is quite simple - was added a wrapper for a function:
int ICP::registerModelToSceneWithRegularMat(const Mat& srcPC, const Mat& dstPC, CV_OUT double& residual, CV_OUT Mat& pose)
{
Matx44d ppp;
int result = registerModelToScene(srcPC, dstPC, residual, ppp); <-- original function call
pose = Mat(ppp);
return result;
}
System information (version)
OpenCV => git master (commit 1604ea3) OpenCV contrib => git master (commit 9ccd8ee) Operating System / Platform => Mac OS X 10.15.5 Compiler => clang
Detailed description
make doesn't generate java wrapper for matx.hpp and as a result while building module surface_matching the main functions were skipping with the following messages:
SKIP:Mat cv::ppf_match_3d::transformPCPose(Mat pc, Matx44d Pose) due to ARG type Matx44d/I SKIP:void cv::ppf_match_3d::PPF3DDetector::match(Mat scene, vector_Pose3DPtr& results, double relativeSceneSampleStep = 1.0/5.0, double relativeSceneDistance = 0.03) due to ARG type vector_Pose3DPtr/O SKIP:void cv::ppf_match_3d::Pose3D::appendPose(Matx44d IncrementalPose) due to ARG type Matx44d/I SKIP:void cv::ppf_match_3d::Pose3D::updatePose(Matx33d NewR, Vec3d NewT) due to ARG type Matx33d/I SKIP:void cv::ppf_match_3d::Pose3D::updatePose(Matx44d NewPose) due to ARG type Matx44d/I
How to reproduce:
pro2on@mbp surface_matching % cat CMakeLists.txt set(the_description "3D point features") ocv_define_module(surface_matching opencv_core opencv_flann WRAP python java)
cmake .. \ -DBUILD_opencv_ittnotify=OFF -DBUILD_ITT=OFF -DCV_DISABLE_OPTIMIZATION=ON -DWITH_CUDA=OFF -DWITH_OPENCL=OFF -DWITH_OPENCLAMDFFT=OFF -DWITH_OPENCLAMDBLAS=OFF -DWITH_VA_INTEL=OFF -DCPU_BASELINE_DISABLE=ON -DENABLE_SSE=OFF -DENABLE_SSE2=OFF -DBUILD_TESTING=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_EXAMPLES=OFF -DBUILD_DOCS=OFF -DBUILD_opencv_apps=OFF -DOpenCV_STATIC=ON -DWITH_1394=OFF -DWITH_ARITH_DEC=OFF -DWITH_ARITH_ENC=OFF -DWITH_CUBLAS=OFF -DWITH_CUFFT=OFF -DWITH_FFMPEG=OFF -DWITH_GDAL=OFF -DWITH_GSTREAMER=OFF -DWITH_GTK=OFF -DWITH_HALIDE=OFF -DWITH_JASPER=OFF -DWITH_NVCUVID=OFF -DWITH_OPENEXR=OFF -DWITH_PROTOBUF=OFF -DWITH_PTHREADS_PF=OFF -DWITH_QUIRC=OFF -DWITH_V4L=OFF -DWITH_WEBP=OFF \ -DANDROID_NDK=/Users/pro2on/Library/Android/sdk/ndk/21.0.6113669 -DCMAKE_TOOLCHAIN_FILE=/Users/pro2on/Library/Android/sdk/ndk/21.0.6113669/build/cmake/android.toolchain.cmake -DANDROID_NATIVE_API_LEVEL=android-21 -DBUILD_JAVA=ON -DBUILD_ANDROID_EXAMPLES=OFF -DBUILD_ANDROID_PROJECTS=ON -DANDROID_STL=c++_shared -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX:PATH=/Volumes/Transcend/temp/android_build/out -DANDROID_ABI=arm64-v8a \ -DOPENCV_EXTRA_MODULES_PATH=/Volumes/Transcend/temp/open_cv_clean/opencv_contrib-4.4.0/modules -DBUILD_opencv_legacy=OFF
And during it you can see the SKIP:... messages. Final Java classes also contain similar messages, and main functions are not available.
Please point the direction how to fix this issue.