How to build openCV.jar?

asked 2019-03-27 09:45:14 -0600

Hello!

First: My mission is to use OpenCV to compare photos of faces, correct me if I am wrong when I say that it will be possible with OpenCV?

Second I need to use Linux as OS and Java as environment. If I am not wrong I need to "build" the opencv*.jar my self? It does not seems to be able to download from below link, right? https://opencv.org/releases.html

So I think I need to go through these steps to produce the opencv.jar file: https://docs.opencv.org/4.0.1/d7/d9f/... I do not seem to find any opencv.jar after I had execute:

BUILD_SHARED_LIBS=off

cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..

Do you see what I miss? Best regards Fredrik

edit retag flag offensive close merge delete

Comments

sturkmen gravatar imagesturkmen ( 2019-03-27 12:16:27 -0600 )edit

please edit your question, and add the cmake output as TEXT there.

most likely, you're missing some requirement, like ant was not installed, ,etc.

berak gravatar imageberak ( 2019-03-28 01:09:00 -0600 )edit

Hello guys! I have done some progress but when I followed the instructions at: https://docs.opencv.org/4.0.1/d9/d52/... there seems to be something wrong any way. I got a jar named opencv-2413.jar, (I thought it would be opencv-4.0.1.jar). But when I try to compile the HelloOpenCV, the class org.opencv.imgcodecs.Imgcodecs is missing in the newly build jar-file. Could that be because of the "git checkout 2.4" the is mentioned?

Do you see what I miss? Best regards Fredrik

fredand44 gravatar imagefredand44 ( 2019-03-28 15:34:22 -0600 )edit

Hmm, hello again guys. I tried to checkout 3.4 instead and this time the class that was missing in opencv-2432.jar was available in the opencv-346.jar. But the next problem, in the example code there is a call to Imgproc.rectangle... but that method seems not to be available in the class "org.opencv.imgproc.Imgproc" (the import to this class was also missing in the example). Any clues would be helpful. Best regards Fredrik

fredand44 gravatar imagefredand44 ( 2019-03-28 16:09:57 -0600 )edit
1

Hello guys! I think I finally manage to build and run the example from branch 3.4. I will try to assemble a description of how I did it. Best regards Fredrik ANdersson

fredand44 gravatar imagefredand44 ( 2019-04-02 00:32:33 -0600 )edit

@fredand44 -- please do so !!

berak gravatar imageberak ( 2019-04-02 00:53:44 -0600 )edit

Hello @berak what do you think of this description: http://www.albinoni.se/pdf/How_I_run_... Best regards Fredrik

fredand44 gravatar imagefredand44 ( 2019-04-12 10:20:10 -0600 )edit