Hello, I have a same problem as in this not answered question. https://stackoverflow.com/questions/51488757/opencv-build-to-java-not-generating-a-java-folder-in-build#
1 | initial version |
Hello, I have a same problem as in this not answered question. https://stackoverflow.com/questions/51488757/opencv-build-to-java-not-generating-a-java-folder-in-build#
Hello,
I have a same problem as in this not answered question.
question on stackoverflow. Difference is library version, and im trying to build with face module.
https://stackoverflow.com/questions/51488757/opencv-build-to-java-not-generating-a-java-folder-in-build#
Hello,
Hello,
I have a same problem as in this not answered question on stackoverflow. Difference is library version, and im am trying to build OpenCV from source to .jar, since I need face module. I followed this tutorial
https://medium.freecodecamp.org/facial-recognition-using-opencv-in-java-92fa40c22f62
Installed ant,Cmake and MinGW, setted Cmake configurations and this is my Cmake log:
Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE) (Required is at least version "3.2") AVX_512F is not supported by C++ compiler AVX512_SKX is not supported by C++ compiler Dispatch optimization AVX512_SKX is not available, skipped libjpeg-turbo: VERSION = 1.5.3, BUILD = opencv-4.0.1-libjpeg-turbo Could not find OpenBLAS include. Turning OpenBLAS_FOUND off Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off Could NOT find BLAS (missing: BLAS_LIBRARIES) LAPACK requires BLAS A library with LAPACK API not found. Please specify library location. Found apache ant: D:/programi/apache-ant-1.10.5/bin/ant.bat (1.10.5) VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file OpenCV Python: during development append to PYTHONPATH: D:/programi/opencv/buildSimple/python_loader Caffe: NO Protobuf: NO Glog: NO freetype2: NO harfbuzz: NO Module opencv_ovis disabled because OGRE3D was not found No preference for use of exported gflags CMake configuration set, and no hints for include/library directories provided. Defaulting to preferring an installed/exported gflags CMake configuration if available. Failed to find installed gflags CMake configuration, searching for gflags build directories exported with CMake. Failed to find gflags - Failed to find an installed/exported CMake configuration for gflags, will perform search for installed gflags components. Failed to find gflags - Could not find gflags include directory, set GFLAGS_INCLUDE_DIR to directory containing gflags/gflags.h Failed to find glog - Could not find glog include directory, set GLOG_INCLUDE_DIR to directory containing glog/logging.h Module opencv_sfm disabled because the following dependencies are not found: Eigen Glog/Gflags Excluding from source files list: <build>/modules/dnn/layers/layers_common.avx512_skx.cpp
General configuration for OpenCV 4.0.1 ===================================== Version control: unknown
Extra modules: Location (extra): D:/programi/opencv/opencv_contrib-4.0.1/modules Version control (extra): unknown
Platform: Timestamp: 2019-03-17T17:41:53Z Host: Windows 10.0.17134 AMD64 CMake: 3.14.0 CMake generator: MinGW Makefiles CMake build tool: D:/programi/minGW/mingw64/bin/mingw32-make.exe Configuration: Release
CPU/HW features: Baseline: SSE SSE2 SSE3 requested: SSE3 Dispatched code generation: SSE4_1 SSE4_2 FP16 AVX AVX2 requested: SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKX SSE4_1 (5 files): + SSSE3 SSE4_1 SSE4_2 (1 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 (0 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX AVX (4 files): + SSSE3 SSE4_1 POPCNT SSE4_2 AVX AVX2 (11 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2
C/C++:
Built as dynamic libs?: NO
C++ Compiler: D:/programi/minGW/mingw64/bin/g++.exe (ver 8.1.0)
C++ flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG
C++ flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG
C Compiler: D:/programi/minGW/mingw64/bin/gcc.exe
C flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-narrowing -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -O3 -DNDEBUG -DNDEBUG
C flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-narrowing -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -g -O0 -DDEBUG -D_DEBUG
Linker flags (Release): -Wl,--gc-sections
Linker flags (Debug): -Wl,--gc-sections
ccache: NO
Precompiled headers: YES
Extra dependencies: ade comctl32 gdi32 ole32 setupapi ws2_32 avifil32 avicap32 winmm msvfw32
3rdparty dependencies: libprotobuf zlib libjpeg-turbo libwebp libpng libtiff libjasper IlmImf quirc
OpenCV modules:
To be built: calib3d core dnn face module.
https://stackoverflow.com/questions/51488757/opencv-build-to-java-not-generating-a-java-folder-in-build#features2d flann gapi highgui imgcodecs imgproc java java_bindings_generator ml objdetect photo stitching ts video videoio
Disabled: aruco bgsegm bioinspired ccalib datasets dnn_objdetect dpm fuzzy hfs img_hash line_descriptor optflow phase_unwrapping plot python_bindings_generator reg rgbd saliency shape stereo structured_light superres surface_matching text tracking videostab world xfeatures2d ximgproc xobjdetect xphoto
Disabled by dependency: -
Unavailable: cnn_3dobj cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev cvv freetype hdf js matlab ovis python2 python3 sfm viz
Applications: apps
Documentation: NO
Non-free algorithms: NO
Windows RT support: NO
GUI: Win32 UI: YES VTK support: NO
Media I/O: ZLib: build (ver 1.2.11) JPEG: build-libjpeg-turbo (ver 1.5.3-62) WEBP: build (ver encoder: 0x020e) PNG: build (ver 1.6.35) TIFF: build (ver 42 - 4.0.9) JPEG 2000: build (ver 1.900.1) OpenEXR: build (ver 1.7.1) HDR: YES SUNRASTER: YES PXM: YES PFM: YES
Video I/O: DC1394: NO FFMPEG: YES (prebuilt binaries) avcodec: YES (ver 58.35.100) avformat: YES (ver 58.20.100) avutil: YES (ver 56.22.100) swscale: YES (ver 5.3.100) avresample: YES (ver 4.0.0) GStreamer: NO DirectShow: YES
Parallel framework: none
Trace: YES (built-in)
Other third-party libraries: Lapack: NO Eigen: NO Custom HAL: NO Protobuf: build (3.5.1)
OpenCL: YES (no extra features) Include path: D:/programi/opencv/opencv-4.0.1/3rdparty/include/opencl/1.2 Link libraries: Dynamic load
Python (for build): C:/Program Files/Python/python.exe
Java:
ant: D:/programi/apache-ant-1.10.5/bin/ant.bat (ver 1.10.5)
JNI: C:/Program Files/Java/jdk1.8.0_171/include C:/Program Files/Java/jdk1.8.0_171/include/win32 C:/Program Files/Java/jdk1.8.0_171/include
Java wrappers: YES
Java tests: NO
Install to: D:/programi/opencv/buildSimple/install
So when i build it, i have opencv.jar and i connected it with java so can import FaceRecognizer. Problem occurs when i start program, i get this exception:
Caused by: java.lang.UnsatisfiedLinkError: no opencv_java401 in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1864)
So when i search for opencv_java401.dll lib, there exist only libopencv_java401.dll.
As i saw in the Windows package from OpenCV, there is a Java folder in the build folder, and that does include the .jar file and an /x64 folder, however, now when i built it does not exists.
Hello, I am trying to build OpenCV from source to .jar, since I need face module. I followed this tutorial https://medium.freecodecamp.org/facial-recognition-using-opencv-in-java-92fa40c22f62
Installed ant,Cmake and MinGW, setted Cmake configurations and this is my Cmake log:
------------------------------------------------------------
Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE) (Required is at least version "3.2")
AVX_512F is not supported by C++ compiler
AVX512_SKX is not supported by C++ compiler
Dispatch optimization AVX512_SKX is not available, skipped
libjpeg-turbo: VERSION = 1.5.3, BUILD = opencv-4.0.1-libjpeg-turbo
Could not find OpenBLAS include. Turning OpenBLAS_FOUND off
Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off
Could NOT find BLAS (missing: BLAS_LIBRARIES)
LAPACK requires BLAS
A library with LAPACK API not found. Please specify library location.
Found apache ant: D:/programi/apache-ant-1.10.5/bin/ant.bat (1.10.5)
VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file
OpenCV Python: during development append to PYTHONPATH: D:/programi/opencv/buildSimple/python_loader
Caffe: NO
Protobuf: NO
Glog: NO
freetype2: NO
harfbuzz: NO
Module opencv_ovis disabled because OGRE3D was not found
No preference for use of exported gflags CMake configuration set, and no hints for include/library directories provided. Defaulting to preferring an installed/exported gflags CMake configuration if available.
Failed to find installed gflags CMake configuration, searching for gflags build directories exported with CMake.
Failed to find gflags - Failed to find an installed/exported CMake configuration for gflags, will perform search for installed gflags components.
Failed to find gflags - Could not find gflags include directory, set GFLAGS_INCLUDE_DIR to directory containing gflags/gflags.h
Failed to find glog - Could not find glog include directory, set GLOG_INCLUDE_DIR to directory containing glog/logging.h
Module opencv_sfm disabled because the following dependencies are not found: Eigen Glog/Gflags
Excluding from source files list: So when i build it, i have opencv.jar and i connected it with java so can import FaceRecognizer. Problem occurs when i start program, i get this exception:
Caused by: java.lang.UnsatisfiedLinkError: no opencv_java401 in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1864)
So when i search for opencv_java401.dll lib, there exist only libopencv_java401.dll.
As i saw in the Windows package from OpenCV, there is a Java folder in the build folder, and that does include the .jar file and an /x64 folder, however, now when i built it does not exists.
Hello, I am trying to build OpenCV from source to .jar, since I need face module. I followed this tutorial https://medium.freecodecamp.org/facial-recognition-using-opencv-in-java-92fa40c22f62
Installed ant,Cmake and MinGW, setted Cmake configurations and this is my Cmake log:
------------------------------------------------------------
Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE) (Required is at least version "3.2")
AVX_512F is not supported by C++ compiler
AVX512_SKX is not supported by C++ compiler
Dispatch optimization AVX512_SKX is not available, skipped
libjpeg-turbo: VERSION = 1.5.3, BUILD = opencv-4.0.1-libjpeg-turbo
Could not find OpenBLAS include. Turning OpenBLAS_FOUND off
Could not find OpenBLAS lib. Turning OpenBLAS_FOUND off
Could NOT find BLAS (missing: BLAS_LIBRARIES)
LAPACK requires BLAS
A library with LAPACK API not found. Please specify library location.
Found apache ant: D:/programi/apache-ant-1.10.5/bin/ant.bat (1.10.5)
VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file
OpenCV Python: during development append to PYTHONPATH: D:/programi/opencv/buildSimple/python_loader
Caffe: NO
Protobuf: NO
Glog: NO
freetype2: NO
harfbuzz: NO
Module opencv_ovis disabled because OGRE3D was not found
No preference for use of exported gflags CMake configuration set, and no hints for include/library directories provided. Defaulting to preferring an installed/exported gflags CMake configuration if available.
Failed to find installed gflags CMake configuration, searching for gflags build directories exported with CMake.
Failed to find gflags - Failed to find an installed/exported CMake configuration for gflags, will perform search for installed gflags components.
Failed to find gflags - Could not find gflags include directory, set GFLAGS_INCLUDE_DIR to directory containing gflags/gflags.h
Failed to find glog - Could not find glog include directory, set GLOG_INCLUDE_DIR to directory containing glog/logging.h
Module opencv_sfm disabled because the following dependencies are not found: Eigen Glog/Gflags
Excluding from source files list: <BUILD>/modules/dnn/layers/layers_common.avx512_skx.cpp
General configuration for OpenCV 4.0.1 =====================================
Version control: unknown
Extra modules:
Location (extra): D:/programi/opencv/opencv_contrib-4.0.1/modules
Version control (extra): unknown
Platform:
Timestamp: 2019-03-17T17:41:53Z
Host: Windows 10.0.17134 AMD64
CMake: 3.14.0
CMake generator: MinGW Makefiles
CMake build tool: D:/programi/minGW/mingw64/bin/mingw32-make.exe
Configuration: Release
CPU/HW features:
Baseline: SSE SSE2 SSE3
requested: SSE3
Dispatched code generation: SSE4_1 SSE4_2 FP16 AVX AVX2
requested: SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKX
SSE4_1 (5 files): + SSSE3 SSE4_1
SSE4_2 (1 files): + SSSE3 SSE4_1 POPCNT SSE4_2
FP16 (0 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX
AVX (4 files): + SSSE3 SSE4_1 POPCNT SSE4_2 AVX
AVX2 (11 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2
C/C++:
Built as dynamic libs?: NO
C++ Compiler: D:/programi/minGW/mingw64/bin/g++.exe (ver 8.1.0)
C++ flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG
C++ flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG
C Compiler: D:/programi/minGW/mingw64/bin/gcc.exe
C flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-narrowing -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -O3 -DNDEBUG -DNDEBUG
C flags (Debug): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Winit-self -Wno-narrowing -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -g -O0 -DDEBUG -D_DEBUG
Linker flags (Release): -Wl,--gc-sections
Linker flags (Debug): -Wl,--gc-sections
ccache: NO
Precompiled headers: YES
Extra dependencies: ade comctl32 gdi32 ole32 setupapi ws2_32 avifil32 avicap32 winmm msvfw32
3rdparty dependencies: libprotobuf zlib libjpeg-turbo libwebp libpng libtiff libjasper IlmImf quirc
OpenCV modules:
To be built: calib3d core dnn face features2d flann gapi highgui imgcodecs imgproc java java_bindings_generator ml objdetect photo stitching ts video videoio
Disabled: aruco bgsegm bioinspired ccalib datasets dnn_objdetect dpm fuzzy hfs img_hash line_descriptor optflow phase_unwrapping plot python_bindings_generator reg rgbd saliency shape stereo structured_light superres surface_matching text tracking videostab world xfeatures2d ximgproc xobjdetect xphoto
Disabled by dependency: -
Unavailable: cnn_3dobj cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev cvv freetype hdf js matlab ovis python2 python3 sfm viz
Applications: apps
Documentation: NO
Non-free algorithms: NO
Windows RT support: NO
GUI:
Win32 UI: YES
VTK support: NO
Media I/O:
ZLib: build (ver 1.2.11)
JPEG: build-libjpeg-turbo (ver 1.5.3-62)
WEBP: build (ver encoder: 0x020e)
PNG: build (ver 1.6.35)
TIFF: build (ver 42 - 4.0.9)
JPEG 2000: build (ver 1.900.1)
OpenEXR: build (ver 1.7.1)
HDR: YES
SUNRASTER: YES
PXM: YES
PFM: YES
Video I/O:
DC1394: NO
FFMPEG: YES (prebuilt binaries)
avcodec: YES (ver 58.35.100)
avformat: YES (ver 58.20.100)
avutil: YES (ver 56.22.100)
swscale: YES (ver 5.3.100)
avresample: YES (ver 4.0.0)
GStreamer: NO
DirectShow: YES
Parallel framework: none
Trace: YES (built-in)
Other third-party libraries:
Lapack: NO
Eigen: NO
Custom HAL: NO
Protobuf: build (3.5.1)
OpenCL: YES (no extra features)
Include path: D:/programi/opencv/opencv-4.0.1/3rdparty/include/opencl/1.2
Link libraries: Dynamic load
Python (for build): C:/Program Files/Python/python.exe
Java:
ant: D:/programi/apache-ant-1.10.5/bin/ant.bat (ver 1.10.5)
JNI: C:/Program Files/Java/jdk1.8.0_171/include C:/Program Files/Java/jdk1.8.0_171/include/win32 C:/Program Files/Java/jdk1.8.0_171/include
Java wrappers: YES
Java tests: NO
Install to: D:/programi/opencv/buildSimple/install
-----------------------------------------------------
So when i build it, i have opencv.jar and i connected it with java so can import FaceRecognizer. Problem occurs when i start program, i get this exception:
Caused by: java.lang.UnsatisfiedLinkError: no opencv_java401 in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1864)
So when i search for opencv_java401.dll lib, there exist only libopencv_java401.dll.
As i saw in the Windows package from OpenCV, there is a Java folder in the build folder, and that does include the .jar file and an /x64 folder, however, now when i built it does not exists.
Ok I tried to rename libopencv_java401.dll to opencv_java401.dll and i am still getting an exception Caused by: java.lang.UnsatisfiedLinkError: D:\programi\opencv\buildSimple\lib\opencv_java401.dll: Can't find dependent libraries. Even though that dll exists in this path.
I don't have opencv/buildSimple/install/ folder at all. Is there some build flag i need to check?