mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-06-21 05:52:06 +08:00
fix webcam crash when failed to read video frame (#21272)
This commit is contained in:
@@ -79,6 +79,8 @@ void run_camera(CameraState *s, cv::VideoCapture &video_cap, float *ts) {
|
||||
while (!do_exit) {
|
||||
cv::Mat frame_mat, transformed_mat;
|
||||
video_cap >> frame_mat;
|
||||
if (frame_mat.empty()) continue;
|
||||
|
||||
cv::warpPerspective(frame_mat, transformed_mat, transform, size, cv::INTER_LINEAR, cv::BORDER_CONSTANT, 0);
|
||||
|
||||
s->buf.camera_bufs_metadata[buf_idx] = {.frame_id = frame_id};
|
||||
|
||||
Reference in New Issue
Block a user