小编007*_*007的帖子

OpenCV错误:在connectedComponents_sub1中断言失败(L.channels()== 1 && I.channels()== 1)

我在OpenCV(python)中遇到以下错误并且已经google了很多但是无法解决.

如果有人能给我提供一些线索,我将不胜感激.

OpenCV错误:断言失败(L.channels()== 1 && I.channels()== 1)在connectedComponents_sub1,file/home/snoopy/opencv- 3.1.0/modules/imgproc/src/connectedcomponents.cpp,line 341 Traceback(最近一次调用最后一次):文件"test.py",第30行,在plant = analyzeplant.analyzeSideView(plant)文件"/ home/snoopy/Desktop/Leaf-201612/my-work- editing/ripps/src /analyzePlant.py",第229行,在analyzeSideView中.plant_img = self .__ extractPlantArea(plant_img)文件"/ home/snoopy/Desktop/Leaf-201612/my-work- editing/ripps/src/analyzePlant.py",第16行, in __extractPlantArea output = cv2.connectedComponentsWithStats(plant,4,cv2.CV_32S)cv2.error:/ home/snoopy/opencv- 3.1.0/modules/imgproc/src/connectedcomponents.cpp:341:error:(215)>函数connectedComponents_sub1中的L.channels()== 1 && I.channels()== 1

python opencv python-2.7 connected-components opencv3.1

-1
推荐指数
1
解决办法
3851
查看次数