feat: 增加图像翻转方法
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user