Opencv 3.0 contrib Java

asked 2015-08-06 23:18:14 -0600

LgArcida gravatar image

I want to use the BackgroundSubtractorMOG from the opencv_contrib but seems like some modules are no ready for Java. Are all extras modules available for Java? am I missing an step? I follow this

http://www.pyimagesearch.com/2015/07/...

All the rest seems to be working good. All help will be appreciated.

edit retag flag offensive close merge delete

Comments

you could try to enable the java wrappers for the bgsegm module:

change this to: ocv_define_module(bgsegm opencv_core opencv_imgproc opencv_video opencv_highgui WRAP python java)

and rerun cmake/make/install

berak gravatar imageberak ( 2015-08-07 00:45:14 -0600 )edit

This seems to be a good idea, but I a not sure where this command should be included Could you point me to the right direction?

LgArcida gravatar imageLgArcida ( 2015-08-07 07:30:11 -0600 )edit

again, try to change the CmakeLists.txt file there, and rerun cmake.

berak gravatar imageberak ( 2015-08-07 07:36:30 -0600 )edit

While make is running there is some javac errors

[javac] /home/du/opencv/build/src/org/opencv/bgsegm/BackgroundSubtractorGMG.java:11: error: cannot find symbol
[javac] public class BackgroundSubtractorGMG extends BackgroundSubtractor {
[javac]                                              ^
[javac]   symbol: class BackgroundSubtractor
[javac] /home/du/opencv/build/src/org/opencv/bgsegm/BackgroundSubtractorMOG.java:11: error: cannot find symbol
[javac] public class BackgroundSubtractorMOG extends BackgroundSubtractor {
[javac]                                              ^
[javac]   symbol: class BackgroundSubtractor[ 73%]

Make fails with error 2 ant 75%

LgArcida gravatar imageLgArcida ( 2015-08-08 01:15:33 -0600 )edit

Is there something missing or a required step?

LgArcida gravatar imageLgArcida ( 2015-08-08 01:17:19 -0600 )edit

oh, sorry, my bad, whole idea does not seem to work.

berak gravatar imageberak ( 2015-08-10 03:39:57 -0600 )edit

No worries, was worth the shot. So, any idea?

LgArcida gravatar imageLgArcida ( 2015-08-10 14:19:50 -0600 )edit

Seems like when making bgsem is trying to import BackgroundSubtractor class. But since BackgroundSubtractor is in a separate package there is an error. Is there a way to update the paths for making the import?

LgArcida gravatar imageLgArcida ( 2015-08-10 14:41:00 -0600 )edit

it should import opencv.video, but it does not. there is a section in the generator script, that handles the imports, but i did not dare to fumble with that.

on win, the opencv_java300.jar / dll still gets built, it just does not contain anything from bgsegm.

sorry again, no clue atm.

berak gravatar imageberak ( 2015-08-11 00:21:40 -0600 )edit