feat: 增加图像翻转方法

This commit is contained in:
bmy
2024-06-17 22:16:28 +08:00
parent 463c6900df
commit 4b33e55c57
4 changed files with 13 additions and 6 deletions

View File

@@ -9,13 +9,14 @@
#include "logc/log.h"
#include <unistd.h>
capture::capture(int camera_index, int zmq_port, int width_set, int height_set, int fps_set)
capture::capture(int camera_index, int zmq_port, int width_set, int height_set, int fps_set, bool _flip)
{
index = camera_index;
port = zmq_port;
width = width_set;
height = height_set;
fps = fps_set;
flip = _flip;
log_info("trying open camera %d", index);
@@ -78,7 +79,11 @@ void capture::run(void)
{
frame = frame.clone().reshape(1, frame.total());
}
if (flip)
{
cv::flip(frame, frame, -1);
// cv::flip(frame, frame, 1);
}
cv::cvtColor(frame, dst, cv::COLOR_BGR2RGB);
// cv::imshow(zmq_bind_addr, frame);