Page 1 of 1

Need Help for OpenCV using Camera

Posted: Tue Jan 15, 2019 7:24 am
by ISTANBUL
I installed Qt desktop version to my NanoPc T4

I cann not connect cam(0) from OpenCv c++ neither python.

Is there any tutorial ? how we can use camera from OpenCV ?

Best

Re: Need Help for OpenCV using Camera

Posted: Tue Jan 15, 2019 8:25 am
by ayaromenok
exactly the same way, as an any other platform:

Code: Select all

cv::VideoCapture capture(0); // open the first camera


you may need to make some tuning, like select Video 4 Linux or any other API

Code: Select all

cv::VideoCapture capture("/dev/video0", cv::CAP_V4L); // open the first camera
capture.set(cv::CAP_PROP_FRAME_WIDTH, 640);
capture.set(cv::CAP_PROP_FRAME_HEIGHT, 480);


for USB cameras it can be issue with second camera - it's not a /dev/video1, but /dev/video2

In case if you need to use qt way to get to camera, you may look in QtWidgetStub and QtQuickStub as examples.