Start a new topic

Crash when work with OpenCV

Crash when work with OpenCV


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: 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,


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,



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?


Hi Ian,
Are you using .jpeg images?

Best regards,

Hi Andreas,

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




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,


The crash is happening both with built in camera and input plugin. I've tried to use OpenCV library v3.2.0 - so if I link the SDK sample with the library, it reproduces the crash. What else can I try?


Can you please provide the follwing details:

  • Which version of the SDK are you using?
  • Are you working with the JS API or the Native API?
  • What device does this happen with (model details and OS version)?
  • Please confirm that this is happening with the unchanged sample app - you only change the OpenCV library.
  • Please resend your crashlog.

Thx and greetings


I have a problem like that right now, too

Thank you and everyone for your answers. I'll try to solve the problem.

Swiss NativeCasinos

Login or Signup to post a comment