Debug OpenCV Errors

Tags: think and control
Personhours: 8
Debug OpenCV Errors By Arjun

Task: Use black magic to fix errors in our code

We recently implemented OpenCV support in our code, but we hadn’t tested it until now. Upon testing, we realized that while our code worked in theory, it misbehaved in practice. Thus, we began the time-tested ritual of debugging our code. From past experience we know that debugging is 90% luck and 10% hoping that you have pleased the gods of programming. We crossed our fingers and hoped that we were able to correctly diagnose the problem.

The first problem we found was that Vuforia wasn’t reading in our frames. The queue which holds Vuforia frames was always empty. After making lots of small changes, we realized that this was due to not initializing our Vuforia correctly. After fixing this, we got a new error.

The error message changed! This meant that we fixed one problem, but there was another problem hiding behind it. The new error we found was that our code was unable to access the native OpenCV libraries, namely it could not link to libopencv_java320.so. Unfortunately, we could not debug this any further.

Next Steps

We need to continue debugging this problem and find the root cause of it.

Date | January 3, 2019