Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Ji__Alex
Beginner
141 Views

opencv 4.0.1 call opencv lib in OpenVINO 2018R5.445 in Raspbery PI3B+

I have a problem when using NCS2 in Raspberry PI3B+

Hardware: Raspberry PI3B+
OS: Raspbian 9.6 stretch
Java: openjdk-8
OpenVINO version: 2018R5.445.

I followed OpenVINO-Install-RaspberryPI and the OpenVINO was installed done.
I followed the test sample describt in the above link:

./armv7l/Release/object_detection_sample_ssd -m face-detection-adas-0001.xml -d MYRIAD -i <path_to_image>

And the test was done so I was sure that my OpenVINO and NCS2 were installed OK.

Because there is no opencv-401.jar nor libopencv_java401.so in OpenVINO package, so I have to build opencv 4.0.1 in order to get the two files.

I built opencv 4.0.1 with the key configuration: --WITH_INF_ENGINE=ON --INF_ENGINE_VERSION=2018R5
After building opencv 4.0.1 done, I installed it to /usr/local/opencv-4.0.1

For not using OpenVINO nor NCS2, I configed LD_LIBRARY_PATH to /usr/local/opencv-4.0.1/lib, and in my code, the key portion is as below:

    net.setPreferableBackend(Dnn.DNN_BACKEND_DEFAULT) 
    net.setPreferableTarget(Dnn.DNN_TARGET_CPU)

My java program execution command:

java -Djava.library.path=/usr/local/opencv-4.0.1/share/java/opencv4 -jar opencv_yolov3_tiny_test.jar

When executing my code, everything is fine but very slow. At lease this can prove that my code is no problem and my own opencv 4.0.1 is no problem.

For using OpenVINO and NCS2, I configed LD_LIBRARY_PATH to:

/opt/inference_engine_vpu_arm/opencv/lib:/opt/intel/opencl:/opt/inference_engine_vpu_arm/deployment_tools/inference_engine/external/hddl/lib:/opt/inference_engine_vpu_arm/deployment_tools/inference_engine/external/gna/lib:/opt/inference_engine_vpu_arm/deployment_tools/inference_engine/external/mkltiny_lnx/lib:/opt/inference_engine_vpu_arm/deployment_tools/inference_engine/external/omp/lib:/opt/inference_engine_vpu_arm/deployment_tools/inference_engine/lib/raspbian_9/armv7l:

In my code, the key portion was changed to:

    net.setPreferableBackend(Dnn.DNN_BACKEND_INFERENCE_ENGINE)
    net.setPreferableTarget(Dnn.DNN_TARGET_MYRIAD)

With the same command as above, my code happened error and dump as below:

mat = [  1,   0,   0;
   0,   1,   0;
   0,   0,   1]
videoFilename=/media/userxxx/DATA/AV/Vehicles/國道1號中山高速公路南向台北-桃園路程景.mp4, existed? true
camera is opened? true
1.1 width:1280, height:720==============================

=-=-=-=-=-=-=-=-=-=-=-=-=-the above is normal output messages-=-=-=-=-=-=-=-=-=-=-==-
=-=-=-=-=-=-=-=-=-=-=-=-=-Below are dumped error messages

libva info: VA-API version 0.39.4
libva info: va_getDriverName() returns -1
libva error: va_getDriverName() failed with unknown libva error,driver_name=(null)
libva info: VA-API version 0.39.4
libva info: va_getDriverName() returns -1
libva error: va_getDriverName() failed with unknown libva error,driver_name=(null)
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x5dde3aa8, pid=11134, tid=0x7515e470
#
# JRE version: OpenJDK Runtime Environment (8.0_181-b13) (build 1.8.0_181-8u181-b13-2~deb9u1-b13)
# Java VM: OpenJDK Client VM (25.181-b13 mixed mode linux-aarch32 )
# Problematic frame:
# C  0x5dde3aa8
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /home/userxxx/ai-projects/opencv_yolov3-tiny_test/trunk/out/artifacts/opencv_yolov3_tiny_test_jar/hs_err_pid11134.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
Aborted

The detail java dump file is here: hs_err_pid11020

I have no idea what's going on?

Could it be the problem that my own opencv-401.jar and  libopencv_java401.so link to the opencv libs provided by OpenVINO?

So, any suggestion how to fix it ?

 

0 Kudos
0 Replies
Reply