1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

Merge pull request #25333 from asmorkalov:as/dump_v4l2_test_frame

Added option to dump v4l2 test frame from virtual camera
This commit is contained in:
Alexander Smorkalov
2024-04-05 13:19:28 +03:00
committed by GitHub
+9
View File
@@ -17,6 +17,8 @@
#ifdef HAVE_CAMV4L2
// #define DUMP_CAMERA_FRAME
#include "test_precomp.hpp"
#include <opencv2/core/utils/configuration.private.hpp>
#include <linux/videodev2.h>
@@ -113,6 +115,13 @@ TEST_P(videoio_v4l2, formats)
EXPECT_EQ(sz, img.size());
EXPECT_EQ(3, img.channels());
EXPECT_EQ(CV_8U, img.depth());
#ifdef DUMP_CAMERA_FRAME
std::string img_name = "frame_" + fourccToString(params.pixel_format);
// V4L2 flag for big-endian formats
if(params.pixel_format & (1 << 31))
img_name += "-BE";
cv::imwrite(img_name + ".png", img);
#endif
}
}
}