Open CV Camera error - Green color Flickering during initialising

Viewed 427

I am working in an Project where open cv is used to detect the colors. Everything works fine but whenever the camera is initialised, I am getting a green color flickering in camera which lasts for a second and then goes off.

The code i am using for initialising opencv camera is,

 if (!OpenCVLoader.initDebug()) {
OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_9, this,mLoaderCallback);
        } 

I am attaching the images for your reference. First Image - During Green color Flickering.

Second Image - After flickering, camera working normally.

Any heads up would be helpful for my learning.

Green color flickering for an second

Normal camera after the green color flickering

1 Answers

You are probably initializing your OpenCV with initAsync method. As the name implies, it initializes OpenCV in the background while your app(which means your UI thread) is working. You can test it with putting some notifier in mLoaderCallback function. Your camera view probably fixed when that function is called. If that is the case, disable your view until you get to initialization callback. Similar questions:
android opencv green flash
JavaCameraView flashing green screen bug

Related