Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Android - Opencv - error: (-215) u != 0 in function void cv::Mat::create

My app keeps crashing with this error

FATAL EXCEPTION: Thread-22883
                                                             Process: com.aar.Cline, PID: 7270
                                                             CvException [org.opencv.core.CvException: cv::Exception: /Volumes/Linux/builds/master_pack-android/opencv/modules/core/src/matrix.cpp:424: error: (-215) u != 0 in function void cv::Mat::create(int, const int*, int)
                                                             ]
                                                                 at org.opencv.imgproc.Imgproc.cvtColor_1(Native Method)
                                                                 at org.opencv.imgproc.Imgproc.cvtColor(Imgproc.java:1724)
                                                                 at com.aar.Cline.TrackBallActivity.detectBall(TrackBallActivity.java:592)
                                                                 at com.aar.Cline.TrackBallActivity.onCameraFrame(TrackBallActivity.java:190)
                                                                 at org.opencv.android.CameraBridgeViewBase.deliverAndDrawFrame(CameraBridgeViewBase.java:391)
                                                                 at org.opencv.android.JavaCameraView$CameraWorker.run(JavaCameraView.java:350)
                                                                 at java.lang.Thread.run(Thread.java:818)

The app is running fine for about 3 min when suddenly in the middle this error shows up here is the line on which it keeps crashing

Mat grayImage1 = new Mat();
Imgproc.cvtColor(frame1, grayImage1, Imgproc.COLOR_BGR2GRAY);

Any suggestions?