- 攝像頭打開失敗
- 攝像頭中途拔插,掉電
cv::VideoCapture capture(camera_id_);
cv::Mat frame;
while (!capture.isOpened())
{
ROS_INFO("%s open fail!", camera_id_.c_str());
sleep(3);
capture.open(camera_id_);
}
while (ros::ok())
{
capture >> frame;
if (frame.empty())
{
capture.release();
capture.open(camera_id_);
while (!capture.isOpened())
{
ROS_INFO("%s open fail!", camera_id_.c_str());
sleep(3);
capture.open(camera_id_);
}
continue;
}
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/290978.html
標籤:其他
上一篇:機器視覺 邊緣檢測算子
