OpenCV: black image captured from usb camera -
I am trying to capture image frames using OpenCV from a USB camera. Although I am always getting a black frame, I have read many posts with this issue and tried all the suggestions but nothing worked for me.
I started using the code discussed here:
I followed the method 'cvWaitKey' (1000) after several 'important' sentences as you can see that the wait value is too much There is more (1000).
I have also tried to save the image frame and, equally, this is a black image.
I am using the following system:
- OpenCV 2.2.0
- Windows 7, 32 bits
- Visual Studio 2010 (C ++)
- One board USB camera (which I do not know the manufacturer)
The USB camera works well with AMCAP.EXE 1.00 is.
Could this be due to the camera drivers used by Windows? Can I switch to other drivers who work better for OpenCV 2.2.0?
Thanks
OK. As I promised for your request in the comment, and you are sorry to wait, it is really busy. Of course this reply was also time to post but here it is:
This I'm simulating that OpenCV is capturing black image. On the output window, which I told you about the comments told you, indicates that there is an error.
After the investigation, let me Realized that this is due to the camera's available format:
It's a lightweight camera, if you have a better camera like a logochach, you can see that the available format is so high.
There are a lot of ways, you can try some things Like
capture.set (CV_CAP_PROP_FRAME_WIDTH, 640); Capture.set (CV_CAP_PROP_FRAME_HEIGHT, 480); Using diff {cv_cap_PROP_FOURCC, CV_FOURCC ('B', 'G', 'R', '3')), using
as an example. // Differences, webcams able to take pictures This webcam is a little flawy, so the image was not wasted.
Hope this is your problem. But this can not be the case, I like debugging problems, but I can not put all possible causes that do this for you because I am really busy, as you said for an example, it is one of them is. Cheers. If you can tell me where you are the output window error, then maybe I can do more help.
Edit (to give more answers in your comments):
OK, I want you to try a few things: / P>
1) First of all, instead of using the cvQueryFrame
, or similar capturing methods, I want you to try to capture that webcam instead of a video. Perhaps wait 10 seconds to see if it is successful. Due to being hot, it takes a lot of time to heat some cameras (low quality) and they can be one empty one for the first few frames.
2) If the step does not work one, try typing
cout & lt; & Lt; Cv :: getBuildInformation () & lt; & Lt; Endl;
And paste the results for Media I / O and Video I / O? I want to see the results. I will have doubts on your library dependencies, but since you have said that it works with a logistic camera, I suspect that this is the case. Of course, there is always a chance that this camera is not compatible with OpenCV. Is there any brand in the way of the camera? 3) Alternatively, just search online for USB drivers and install it, I was a friend who did this for similar problem but did not ensure that process.
Comments
Post a Comment