Ask Your Question

chutsu's profile - activity

2016-11-15 11:21:11 -0500 received badge  Famous Question (source)
2016-10-06 22:36:11 -0500 received badge  Popular Question (source)
2016-01-07 11:21:54 -0500 received badge  Notable Question (source)
2015-03-04 06:36:21 -0500 received badge  Popular Question (source)
2014-12-04 21:12:10 -0500 received badge  Nice Question (source)
2014-02-06 20:19:53 -0500 asked a question How to record video using OpenCV and Python?

I have looked at OpenCV's Python example on how to use VideoCapture and VideoWriter to capture and write out a video file. But I keep getting:

OpenCV Error: Assertion failed (dst.data == dst0.data) in cvCvtColor, file 
/tmp/opencv-n8PM/opencv-2.4.7.1/modules/imgproc/src/color.cpp, line 4422
Traceback (most recent call last):
  File "examples/observer/observer.py", line 17, in <module>
    video_writer.write(frame)
cv2.error: /tmp/opencv-n8PM/opencv-2.4.7.1/modules/imgproc/src/color.cpp:4422: error: 
(-215) dst.data == dst0.data in function cvCvtColor

Cleaned up camera.

Here is the code:

#!/usr/bin/env python import cv2


if __name__ == "__main__":
    # find the webcam
    capture = cv2.VideoCapture(0)

    # video recorder
    fourcc = cv2.cv.CV_FOURCC(*'XVID')  # cv2.VideoWriter_fourcc() does not exist
    video_writer = cv2.VideoWriter("output.avi", fourcc, 20, (680, 480))

    # record video
    while (capture.isOpened()):
        ret, frame = capture.read()
        if ret:
            video_writer.write(frame)
            cv2.imshow('Video Stream', frame)

        else:
            break

    capture.release()
    video_writer.release()
    cv2.destroyAllWindows()
2013-07-20 04:32:11 -0500 received badge  Supporter (source)
2013-07-20 04:32:05 -0500 commented answer CUDA vs OpenCL which does OpenCV support better?

Thanks! An unrelated question to OpenCV, but in your experience is getting CUDA to work hard on Linux (Debian)? I'm contemplating getting a PC Laptop with dedicated graphics, but am worried that I may have problems getting CUDA to work, am swayed to get a Macbook Pro just to avoid the headache of installing CUDA & OpenCL. . .

2013-07-19 14:03:46 -0500 received badge  Student (source)
2013-07-19 13:08:29 -0500 asked a question CUDA vs OpenCL which does OpenCV support better?

I'm currently divided between developing an OpenCV application with either CUDA or OpenCL support, was wondering if someone can tell me which one does OpenCV support better?