1

I'm currently working on a face recognition web application using JavaCV. I send snapshots of a live webcam stream on a client's browser over websockets and the face recognition system does all the rest on the server side. However, I receive the following error when deploying my application on HCP.

no jniopencv_core in java.library.path

I have added all the jar files related to javacv/javacpp in my project lib folder and this is my pom.xml

<dependency>
  <groupId>org.bytedeco</groupId>
  <artifactId>javacv</artifactId>
  <version>1.1</version>
</dependency>

<dependency>
    <groupId>org.bytedeco.javacpp-presets</groupId>
    <artifactId>opencv</artifactId>
    <version>3.0.0-1.1</version>
</dependency>

<dependency>
    <groupId>org.bytedeco</groupId>
    <artifactId>javacpp</artifactId>
    <version>1.1</version>
</dependency>

Any ideas? Thanks in advance.

1 Answers1

2

For some reason, Maven isn't picking up the platform dependencies properly. Add something like the following to fix that error:

<dependency>
    <groupId>org.bytedeco.javacpp-presets</groupId>
    <artifactId>opencv</artifactId>
    <version>3.0.0-1.1</version>
    <classifier>linux-x86_64</version>
</dependency>
Samuel Audet
  • 4,964
  • 1
  • 26
  • 33
  • Yep. Already tried that. It worked partially because a new error appears: OpenCV Error: Unspecified error (The node does not represent a user object (unknown type?)) in cvRead, file src\persistence.cpp, line 4976 Exception in thread "main" java.lang.RuntimeException: src\persistence.cpp:4976: error: (-2) The node does not represent a user object (unknown type?) in function cvRead at org.bytedeco.javacpp.opencv_core.cvLoad(Native Method) – Victor Oliveira Antonino May 13 '16 at 17:25
  • I've done some research (https://github.com/bytedeco/javacv/issues/246) and it seems like a haarcascade.xml format error. However, it does not matter the javacv/opencv version I'm working on or the haarcascade.xml version. When deployed, the errors alternate between each other. Also, locally everything runs completely fine. – Victor Oliveira Antonino May 13 '16 at 17:31
  • @VictorOliveiraAntonino This is a known bug in OpenCV that dates from ages ago. As mentioned in the README.md file, just call `Loader.load(opencv_objdetect.class)`, or whichever other module you are using, before the call to `cvRead()`. If this matters to you, please report it upstream. They won't care if you do not complain! – Samuel Audet May 14 '16 at 06:46