The image that I captured was fully black. Using raspberrypi camera. (not a USB camera)
我捕捉到的图像是全黑的。使用raspberinki相机。(不是USB摄像头)
#include <opencv2/opencv.hpp>
int main()
{
cv::VideoCapture cam(0);
cv::Mat frame;
cam.grab();
cam.retrieve(frame);
cv::imwrite("test.jpg",frame);
}
Tried creating a loop of cam.grab()
thinking that the error might have been too minimal exposure.
Still got a fully black image of 640x480.
我尝试创建一个cam.Grab()循环,认为错误可能暴露得太少。仍然得到了640x480的全黑图像。
I don't think this warning applies to what I am trying to do, but here it is
我不认为这个警告适用于我正在尝试做的事情,但它是这样的
[ WARN:0] global ../modules/videoio/src/cap_gstreamer.cpp (501) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
I have tested my camera using libcamera-jpeg
and it works perfectly.
我已经用libCamera-jpeg测试了我的相机,它工作得很好。
更多回答
优秀答案推荐
我是一名优秀的程序员,十分优秀!