Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

java opencv Helloworld - how?

I really am missing something.

I can build opencv on my raspberry pi, and end up with opencv-XXX.jar and in /usr/local/share/OpenCV/java/

Great! I believe the so file is statically linked because i set BUILD_SHARED_LIBS=OFF in my cmake command, however, I did note in the cmake output it does say "Link libraries: Dynamic load"

My program looks like this:

  import org.opencv.core.*;

  class HelloWorld {
    static {
     public static void main(String[] args) {

I can compile this when I put the jar file in the classpath using "javac -cp /usr.../" but when I run it after (successfully) putting the .so file in the LD_LIBRARY_PATH, I get:

 Segmentation fault

It does it with 4.1.0, 4.0.0, and 3.4.1 and is obviously something I am not doing right.