Create OpenCV with Contrib Modules and Java Shell

I am trying to create OpenCV on my Windows 7 machine. To enable Contrib modules, I add OPENCV_EXTRA_MODULES_PATH to CMake-gui. Opencv-300.jar and opencv-300.dll are created, but I can not find Java classes to use additional modules. Are there enough options in the make configuration? Is it even possible to use additional modules from Java?

+6
java build opencv
source share
1 answer

I have the same problem and solved it this way. I assume that you downloaded a specific version from contrib repo according to the opencv version if you want to create it. So, go to the directory and enter, for example, the directory of the front module; in this directory there is a file called CMakeLists.txt that you must edit. This file should look like this:

set(the_description "Face recognition etc") ocv_define_module(face opencv_core opencv_imgproc opencv_objdetect WRAP python) # NOTE: objdetect module is needed for one of the samples 

If you want to have the org.opencv.face package in your opencv-3xx.jar library, you need to change the second line of the file as follows:

 ocv_define_module(face opencv_core opencv_imgproc opencv_objdetect WRAP python java) 

Then you need to compile opencv as shown in Readme.md from the repo file https://github.com/itseez/opencv_contrib

Obviously, the same is true for all Contrib modules if you want to add opencv-3xx.jar to your library.

I hope this solution works for you, bye!

+5
source share

All Articles