The camera is not working
I'm new and just starting to learn OpenCV. The camera is not initialized during image capture I tried different cameras, but there is no result, even a window with a black screen does not show. Below information about the video:
Video I/O:
DC1394: YES (ver 2.2.5)
FFMPEG: YES
avcodec: YES (ver 57.107.100)
avformat: YES (ver 57.83.100)
avutil: YES (ver 55.78.100)
swscale: YES (ver 4.8.100)
avresample: YES (ver 3.7.0)
GStreamer: NO
gPhoto2: YES
program text:
#include <opencv2/opencv.hpp>
#include <iostream>
int main( int argc, char** argv )
{
cv::namedWindow( "Example10", cv::WINDOW_AUTOSIZE );
cv::VideoCapture cap;
if (argc == 1)
cap.open(0);
else
cap.open( argv[1] );
if (!cap.isOpened())
{
std::cerr << "Error." << std::endl;
return -1;
}
cv::Mat frame;
for (;;)
{
cap >> frame;
if (frame.empty()) break;
cv::imshow( "Example10", frame );
if (cv::waitKey(33) == 27) break;
}
return 0;
}
P.S (OpenCV - 3.4.1, Linux ubuntu 18.04)
weird, no v4l in the videoio section ?
you could try to use ffmpeg explicity, like:
The v4l-utils package of the newest version (1.14.2-1) is already installed. Tried with CAP_FFMPEG, nothing changes.