Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 41027

Error while running video

$
0
0
When I try to run a video I get the following error. The video runs then the error occurs. I am unable to find any information about this error. \modules\imgproc\src\color.cpp:3961: error: (-215) (scn == 3 || scn == 4) && (depth == CV_8U || depth == CV_32F) in function cv::cvtColor The code I am running is greenLower = np.array([26, 86, 6],dtype=np.uint8) greenUpper = np.array([90, 255, 255],dtype=np.uint8) cap = cv2.VideoCapture('E:/PYTHON SCRIPTS/Learning python/metronome1.mp4') print cap.grab() while(cap.isOpened()): ret, frame = cap.read() gray = cv2.cvtColor(frame, cv2.COLOR_RGB2HSV) mask = cv2.inRange(gray, greenLower, greenUpper) mask = cv2.erode(mask, None, iterations=2) mask = cv2.dilate(mask, None, iterations=2) cv2.imshow('duck',mask) if cv2.waitKey(1) & 0xFF == ord('q'): break Thanks

Viewing all articles
Browse latest Browse all 41027

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>