Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all articles
Browse latest Browse all 19555

Awful artifacts when capturing from web cam

$
0
0
I am running OpenCV 3.1.0 on my Raspberry Pi 3 (with Raspbian Jessie). I'm using the Python 2.7 bindings. As I request frames from a VideoCapture, occasionally (apparently at random) the frame will have an awful blocky artifact as seen below. ![image description](/upfiles/14602345518729746.png) This never occurs when I use the webcam on my PC, nor does it occur when I view the webcam with a program like Cheese on the Raspberry Pi, so I have to conclude that it's either an OpenCV problem, or I'm using openCV incorrectly. Further, the bad frames happen MUCH more often when the Pi is doing other things as well (for example, if I open a web browser while it's capturing). Below is a sample script where I encounter the problem. import cv2 cap = cv2.VideoCapture(0) while(True): res, im = cap.read() cv2.imshow("foo", im) cv2.waitKey(1) My suspicion is that it has something to do with trying to retrieve the image buffer while the buffer is in the process of being updated, or something like that. Am I doing something wrong here? Again, I've *only* seen this issue occur with OpenCV on the Pi. I've also tried it with OpenCV on my laptop and I don't see the artifacts. So, the problem *might* not be OpenCV specifically, but I'm hoping I'm not the only person here that's had this issue. (and again, I haven't seen it with any other image capture programs on the PI either... though they all run at much slower frame rates)

Viewing all articles
Browse latest Browse all 19555

Trending Articles



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