暫存
This commit is contained in:
10
capture.cc
10
capture.cc
@@ -70,6 +70,7 @@ void capture::run(void)
|
||||
*cap >> frame;
|
||||
if (frame.empty())
|
||||
{
|
||||
// TODO 尝试返回缓存帧,并重新启动 capture
|
||||
log_error("empty frame");
|
||||
break;
|
||||
}
|
||||
@@ -79,14 +80,15 @@ 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);
|
||||
// 将图像转换为 rgb
|
||||
cv::cvtColor(frame, dst, cv::COLOR_BGR2RGB);
|
||||
|
||||
// 将帧编码后发送
|
||||
std::vector<uchar>
|
||||
@@ -112,6 +114,8 @@ void capture::run(void)
|
||||
cv::waitKey(1);
|
||||
// usleep(20000);
|
||||
}
|
||||
|
||||
log_error("capture exit");
|
||||
}
|
||||
|
||||
bool capture::is_open(void)
|
||||
|
||||
Reference in New Issue
Block a user