improve resolution
This commit is contained in:
parent
0f2cfce8f8
commit
b9313d40c0
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue