Python OpenCV-在Linux中出错,但在Windows中工作

Python OpenCV-在Linux中出错,但在Windows中工作,python,linux,opencv,Python,Linux,Opencv,在Linux中运行此文件时,出现以下错误。但同样的代码也适用于Windows和OpenCV 2.4.11 OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cvtColor, file /home/travis/miniconda/conda-bld/work/opencv-2.4.11/modules/imgproc/src/color.cpp, line 3739 Traceback (most recent call

在Linux中运行此文件时,出现以下错误。但同样的代码也适用于Windows和OpenCV 2.4.11

 OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cvtColor, file /home/travis/miniconda/conda-bld/work/opencv-2.4.11/modules/imgproc/src/color.cpp, line 3739
    Traceback (most recent call last):
  File "testImplementation.py", line 206, in <module>
    GestureDemo().run()
  File "testImplementation.py", line 200, in run
    super(GestureDemo, self).run()
  File "/home/kathirdrone/Desktop/ARDRONE /GestureDetection/GestureDetection/current_src/eventBasedAnimationClass.py", line 47, in run
    self.onTimerFiredWrapper()
  File "/home/kathirdrone/Desktop/ARDRONE /GestureDetection/GestureDetection/current_src/eventBasedAnimationClass.py", line 30, in onTimerFiredWrapper
    self.onTimerFired()
  File "testImplementation.py", line 125, in onTimerFired
    self.gp.process()
  File "/home/kathirdrone/Desktop/ARDRONE /GestureDetection/GestureDetection/current_src/GesturesApi.py", line 297, in process
    self.threshold()
  File "/home/kathirdrone/Desktop/ARDRONE /GestureDetection/GestureDetection/current_src/GesturesApi.py", line 111, in threshold
    grey = cv2.cvtColor(self.original, cv2.COLOR_BGR2GRAY)
cv2.error: /home/travis/miniconda/conda-bld/work/opencv-2.4.11/modules/imgproc/src/color.cpp:3739: error: (-215) scn == 3 || scn == 4 in function cvtColor
OpenCV错误:在cvtColor文件/home/travis/miniconda/conda bld/work/OpenCV-2.4.11/modules/imgproc/src/color.cpp第3739行中,断言失败(scn==3 | | scn==4)
回溯(最近一次呼叫最后一次):
文件“testImplementation.py”,第206行,在
GestureDemo().run()
文件“testImplementation.py”,第200行,正在运行
超级(手势演示,自我).run()
文件“/home/kathirdrone/Desktop/ARDRONE/GestureDetection/GestureDetection/current_src/eventBasedAnimationClass.py”,第47行,运行中
self.ontimerfiredrapper()
文件“/home/kathirdrone/Desktop/ARDRONE/GestureDetection/GestureDetection/current_src/eventBasedAnimationClass.py”,第30行,在ontimerfiredrapper中
self.onTimerFired()
文件“testImplementation.py”,第125行,在onTimerFired中
self.gp.process()
文件“/home/kathirdrone/Desktop/ARDRONE/GestureDetection/GestureDetection/current_src/GesturesApi.py”,第297行,正在处理中
self.threshold()
文件“/home/kathirdrone/Desktop/ARDRONE/gesturetextection/gesturetextection/current_src/GesturesApi.py”,第111行,在阈值中
灰色=cv2.CVT颜色(自原色,cv2.COLOR\u BGR2GRAY)
cv2.error:/home/travis/miniconda/conda bld/work/opencv-2.4.11/modules/imgproc/src/color.cpp:3739:error:(-215)scn==3 | | scn==4在函数cvtColor中

有什么线索可以解决这个问题吗?

self。原始的
不是3或4频道图像。打印它的
形状
来说服自己你能显示错误产生的那一行吗。。。??