Ask Your Question

Revision history [back]

opencv error color.cpp

Hello community,

I'm using opencv library to get a flow of movement that triggers a camera.capture() function. I need a filmename.jpg, at the instant of movement.

The test code, i'm using /opencv/samples/lk_track.py. But i got this error.

Lucas-Kanade tracker
====================

Lucas-Kanade sparse optical flow demo. Uses goodFeaturesToTrack
for track initialization and back-tracking for match verification
between frames.

Usage
-----
lk_track.py [<video_source>]


Keys
----
ESC - exit

Xlib:  extension "RANDR" missing on display ":0.0".

(lk_track:3540): GLib-GObject-WARNING **: Attempt to add property GtkSettings::gtk-label-select-on-focus after class was initialised
OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cvtColor, file /home/pi/poli/code/opencv-master/modules/imgproc/src/color.cpp, line 7564
Traceback (most recent call last):
  File "lk_track.py", line 101, in <module>
    main()
  File "lk_track.py", line 97, in main
    App(video_src).run()
  File "lk_track.py", line 47, in run
    frame_gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
cv2.error: /home/pi/poli/code/opencv-master/modules/imgproc/src/color.cpp:7564: error: (-215) scn == 3 || scn == 4 in function cvtColor
click to hide/show revision 2
retagged

updated 2015-05-11 11:10:49 -0600

berak gravatar image

opencv error color.cpp

Hello community,

I'm using opencv library to get a flow of movement that triggers a camera.capture() function. I need a filmename.jpg, at the instant of movement.

The test code, i'm using /opencv/samples/lk_track.py. But i got this error.

Lucas-Kanade tracker
====================

Lucas-Kanade sparse optical flow demo. Uses goodFeaturesToTrack
for track initialization and back-tracking for match verification
between frames.

Usage
-----
lk_track.py [<video_source>]


Keys
----
ESC - exit

Xlib:  extension "RANDR" missing on display ":0.0".

(lk_track:3540): GLib-GObject-WARNING **: Attempt to add property GtkSettings::gtk-label-select-on-focus after class was initialised
OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cvtColor, file /home/pi/poli/code/opencv-master/modules/imgproc/src/color.cpp, line 7564
Traceback (most recent call last):
  File "lk_track.py", line 101, in <module>
    main()
  File "lk_track.py", line 97, in main
    App(video_src).run()
  File "lk_track.py", line 47, in run
    frame_gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
cv2.error: /home/pi/poli/code/opencv-master/modules/imgproc/src/color.cpp:7564: error: (-215) scn == 3 || scn == 4 in function cvtColor