Skip to content
This repository has been archived by the owner on Feb 21, 2021. It is now read-only.

InvocationTargetException thrown in defining the VideoCapture Object #13

Open
amarlearning opened this issue Mar 11, 2018 · 4 comments
Open
Assignees

Comments

@amarlearning
Copy link

amarlearning commented Mar 11, 2018

InvocationTargetException is thrown in creating an instance of VideoCapture class.

Operating System: Ubuntu 16.04
JDK Version : JDK 1.8.152

screenshot from 2018-03-11 13-26-30

screenshot from 2018-03-11 13-27-00

@luigidr luigidr self-assigned this Mar 11, 2018
@luigidr
Copy link
Member

luigidr commented Mar 11, 2018

It seems that the problem is in the linking between the Java method and the underlying C++ function.

Which IDE are you using? Do you properly set up the location of the native library for the OpenCV jar?
e.g., http://opencv-java-tutorials.readthedocs.io/en/latest/01-installing-opencv-for-java.html#set-up-opencv-for-java-in-eclipse?

@amarlearning
Copy link
Author

amarlearning commented Mar 11, 2018

Did you used the pre-compiled version of OpenCV in Ubuntu?

@luigidr I downloaded the 3.4.1 source folder of OpenCV from here and then installed it using CMake and Apache Ant.

Which IDE are you using?

I am using Eclipse Oxygen.2 Release (4.7.2).

Do you properly set up the location of the native library for the OpenCV jar?

Native library for the OpenCV jar path : /opencv-3.4.1/builds/lib. I think its correct because this (http://opencv-java-tutorials.readthedocs.io/en/latest/02-first-java-application-with-opencv.html#create-a-simple-application) is running fine. I think the native library path for OpenCV jar is correct.

@luigidr
Copy link
Member

luigidr commented Mar 11, 2018

Thanks, @amarlearning. I just tried the program with the same OpenCV version and IDE on macOS and Windows and it works without any problem.

Are you using the OpenJDK? Does this program work: https://github.com/opencv-java/fourier-transform?
It doesn't use VideoCapture but it's made with JavaFX: I would like to exclude any problem with your environment (JDK, JavaFX, ...) before trying this program in Ubuntu.

@amarlearning
Copy link
Author

Are you using the OpenJDK?

I am using the Oracle version.

Does this program work: https://github.com/opencv-java/fourier-transform?

I will try to run this program and will respond back to you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants