diff --git a/test/src/QRcode.cpp b/test/src/QRcode.cpp index 9b8ac13..6b3c017 100644 --- a/test/src/QRcode.cpp +++ b/test/src/QRcode.cpp @@ -64,13 +64,20 @@ void processFrame(const cv::Mat& frame) void frameProcessingThread() { - cv::VideoCapture cap(0); // Open the default camera + cv::VideoCapture cap(0, cv::CAP_V4L2); // Open the default camera with V4L2 backend if (!cap.isOpened()) { ROS_ERROR("Unable to open camera"); return; } + // Set the desired resolution + cap.set(cv::CAP_PROP_FRAME_WIDTH, 1920); // Set width to 1920 pixels + cap.set(cv::CAP_PROP_FRAME_HEIGHT, 1080); // Set height to 1080 pixels + + // Set the desired frame rate + cap.set(cv::CAP_PROP_FPS, 15); // Set frame rate to 15 Hz + while (ros::ok()) { cv::Mat frame;