CvException

asked 2019-08-16 15:26:53 -0600

Sempai gravatar image

updated 2019-08-17 00:27:41 -0600

berak gravatar image

Caused by: CvException [org.opencv.core.CvException: cv::Exception: OpenCV(3.4.6) C:\build\3_4_winpack-bindings-win64-vc14-static\opencv\modules\imgproc\src\color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor']

at org.opencv.imgproc.Imgproc.cvtColor_1(Native Method)
at org.opencv.imgproc.Imgproc.cvtColor(Imgproc.java:2347)
edit retag flag offensive close merge delete

Comments

your input image is invalid

berak gravatar imageberak ( 2019-08-17 00:28:14 -0600 )edit
Sempai gravatar imageSempai ( 2019-08-17 06:06:36 -0600 )edit

Exception when I use the method

Sempai gravatar imageSempai ( 2019-08-17 06:09:45 -0600 )edit

@Sempai, that simply cannot be. the code in your link does never call cvtColor().

please always check img.empty() after imread()

berak gravatar imageberak ( 2019-08-17 06:11:57 -0600 )edit

@berak such an error with any method

Sempai gravatar imageSempai ( 2019-08-17 07:00:44 -0600 )edit

@berak thank you!

Sempai gravatar imageSempai ( 2019-08-17 07:22:21 -0600 )edit

please tell us, if the problem was the empty input image.

berak gravatar imageberak ( 2019-08-17 07:26:31 -0600 )edit