【OpenCV学习笔记】【异常处理】一(The Matrix is not continuous, thus its number of rows can not be changed)

在调试《Mastering OpenCV with  Practical Computer Vision Projects》书中的代码,trainSVM.cpp文件,对数码管的正负样本进行训练时,出现以下错误:

OpenCV Error: Image step is wrong (The matrix is not continuous, thus its number
 of rows can not be changed) in unknown function, file src\matrix.cpp, line 801

【OpenCV学习笔记】【异常处理】一(The Matrix is not continuous, thus its number of rows can not be changed)_第1张图片

最后检查出的错误有两点,这两点性质是一样的,都是找不到训练的图片:

(1)训练图片的命名不是随便命名的,而是从0开始,不是从1开始。

(2)训练路径没写对,(注意cpp文件中,路径用双斜杠)



你可能感兴趣的:(图像处理-OpenCV,事件驱动-数码管字符识别)