OpenCV报错:color.hpp:253: error: (-215:Assertion failed)

Posted 秦晓宇

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了OpenCV报错:color.hpp:253: error: (-215:Assertion failed)相关的知识,希望对你有一定的参考价值。

1、问题

CvException [org.opencv.core.CvException: cv::Exception: OpenCV(3.4.2) c:\\build\\3_4_winpack-bindings-win64-vc14-static\\opencv\\modules\\imgproc\\src\\color.hpp:253: error: (-215:Assertion failed) VScn::contains(scn) && VDcn::contains(dcn) && VDepth::contains(depth) in function 'cv::CvtHelper<struct cv::Set<3,4,-1>,struct cv::Set<1,-1,-1>,struct cv::Set<0,2,5>,2>::CvtHelper'
]
	at org.opencv.imgproc.Imgproc.cvtColor_1(Native Method)
	at org.opencv.imgproc.Imgproc.cvtColor(Imgproc.java:1899)
	at exhibitTerminal.changgang.验证码工具.验证(验证码工具.java:103)
	at exhibitTerminal.changgang.验证码工具.下单滑块校验(验证码工具.java:61)
	at exhibitTerminal.changgang.主要产品.getWuLiao(主要产品.java:273)
	at exhibitTerminal.changgang.主要产品.zhuYaoChanPing(主要产品.java:77)
	at exhibitTerminal.changgang.主要产品.<init>(主要产品.java:34)
	at exhibitTerminal.changgang.CgSpider$1.run(CgSpider.java:59)

2、原因

openCV不支持中文路径

3、解决

换成中文路径就行不报错了

//	static String path = System.getProperty("user.dir");
	static String path = "C:\\\\Users\\\\qin\\\\Desktop\\\\pc";

以上是关于OpenCV报错:color.hpp:253: error: (-215:Assertion failed)的主要内容,如果未能解决你的问题,请参考以下文章

OpenCV报错:color.hpp:253: error: (-215:Assertion failed)

VS cmake 远程开发 opencv报错:CMake was unable to find a build program corresponding to “Ninja“.(换个构建方式)

windows下编译caffe报错:error MSB4062: 未能从程序集 E:NugetPackagesOpenCV.2.4.10......的解决办法

Python 3.6 + opencv 3.4 中imshow 函数报错

OpenCV报错:功能未实现

Python 中配置opencv 读取视频报错 ,