V
V
Victorius2015-08-11 13:39:50
Eclipse
Victorius, 2015-08-11 13:39:50

How to set up JavaCV and OpenCV?

Good afternoon Comrades!
It was necessary to solve the problem of object recognition, I decided to work with OpenCV, I learned about the existence of JavaCV. Decided to work with her.
Found instructions for installing opencvlover.blogspot.in/2012/04/javacv-setup-with-...
I downloaded JavaCV from here and compiled it. Set up. But I can't download the image.

import static org.bytedeco.javacpp.opencv_core.*;
import static org.bytedeco.javacpp.opencv_imgproc.*;
import static org.bytedeco.javacpp.opencv_imgcodecs.*;
import static org.bytedeco.javacpp.opencv_highgui.*;

public class launch {
  public static void main(String[] args) {
                String filename ="C:\\cap\\cap1.png";
                IplImage image =cvLoadImage(filename);
          if (image != null) {
              cvShowImage(filename, image);
              cvWaitKey();
          }
        }
}

Java build path looks like this:
04fb72458b574b06a208fe4bdeec4aa3.JPG
Environment variables are set to downloaded openCV version 3.0:
C:\OpenCV\opencv\build\java\x86;C:\OpenCV\opencv\build\x86\vc11\bin Changed
to x64, nothing changed .
I am getting an error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no jniopencv_core in java.library.path
  at java.lang.ClassLoader.loadLibrary(Unknown Source)
  at java.lang.Runtime.loadLibrary0(Unknown Source)
  at java.lang.System.loadLibrary(Unknown Source)
  at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:550)
  at org.bytedeco.javacpp.Loader.load(Loader.java:415)
  at org.bytedeco.javacpp.Loader.load(Loader.java:358)
  at org.bytedeco.javacpp.opencv_core.<clinit>(opencv_core.java:10)
  at java.lang.Class.forName0(Native Method)
  at java.lang.Class.forName(Unknown Source)
  at org.bytedeco.javacpp.Loader.load(Loader.java:390)
  at org.bytedeco.javacpp.Loader.load(Loader.java:358)
  at org.bytedeco.javacpp.opencv_imgcodecs.<clinit>(opencv_imgcodecs.java:13)
  at com.mftech.eye.launch.main(launch.java:78)
Caused by: java.lang.UnsatisfiedLinkError: no opencv_imgproc300 in java.library.path
  at java.lang.ClassLoader.loadLibrary(Unknown Source)
  at java.lang.Runtime.loadLibrary0(Unknown Source)
  at java.lang.System.loadLibrary(Unknown Source)
  at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:550)
  at org.bytedeco.javacpp.Loader.load(Loader.java:406)
  ... 8 more

Tell me what's the problem? And how to fix it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Victorius, 2015-08-17
@Victorius

The problem lay in the following - platform incompatibility. An x64 JVM was needed, but it seemed to me that I had exactly this one running, but it turned out differently.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question