Start a new topic

Crash when work with OpenCV

Crash when work with OpenCV


Hello,

I have a problem when working with Wikitude and another framework which uses OpenCV.

When I run my app using the other framework my app crashes immediatly with following error:

OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cvtColor, file /Volumes/Linux/builds/precommit_ios/opencv/modules/imgproc/src/color.cpp, line 7564

libc++abi.dylib: terminating with uncaught exception of type cv::Exception: /Volumes/Linux/builds/precommit_ios/opencv/modules/imgproc/src/color.cpp:7564: error: (-215) scn == 3 || scn == 4 in function cvtColor

 

I have no influence on the bug since it is deep in the openALPR Framework - so why do I post this here? I searched a long time for the reason for the bug and figured out, that the framework (openALPR iOS: https://github.com/twelve17/openalpr-ios) works in a sample app til I add the Wikitude SDK. After adding it, the app crashes immediately. I think it is a linker problem with double namespaces including openCV. One libary overrides the other and different versions causes the crash.

Has everyone experience with this strange error or can give a hint for a possible solution?

Thank you in advance,

Andreas

Hi Andreas,
The Wikitude SDK does not include any references to OpenCV directly. However, both SDKs (Wikitude and OpenCV) use libraries like zlib or libjpeg which is causing the problem in your case.

If such a problem arises we can try to build the conflicting library with dependent libraries that we also use internally. But this is almost everytime a case by case evaluation/solution.


The ideal solution would be that we compile all our external libraries with a Wikitude specific namespace so that such conflicts can't occur anymore. We strongly investigate in that direction and might include it in the next major update of our SDK.

Best regards,

Andreas

Andreas,

I am facing this exact same issue as well. I am not actually referencing another library that uses OpenCV, but I am trying to use OpenCV myself, similar to how you are using it in the Native iOS FaceDetectionPlugin sample. However as soon as I try to do a convertColor it crashes in the same way as the original poster was reporting. Is there any way around this in my case, where I can change the way I am referencing opencv?

Ian

Hi Ian,
Are you using .jpeg images?

Best regards,

Andreas
Hi Andreas,

We are facing the same problem. (Linking with OpenCV 3.2.0)
Is there any updates about this problem ?

Thanks,

Laurent

 

Hi Laurent,

Unfortunately we don't have any updates right now. 

I guess I answered another question of yours in a different thread that is related to this. Let's continue talking in the other thread. Maybe we can figure out a solution.


Best regards,

Andreas

Login or Signup to post a comment