diff --git a/samples/test/camera_fps_test.cpp b/samples/test/camera_fps_test.cpp index 83c7878..d1b8622 100644 --- a/samples/test/camera_fps_test.cpp +++ b/samples/test/camera_fps_test.cpp @@ -8,9 +8,9 @@ int main(int argc, char *argv[]) { sv::Camera cap; cap.setIp(argv[1]); - cap.open(sv::CameraType::G1); cap.setWH(1280, 720); - cap.setFps(30); + cap.setFps(120); + cap.open(sv::CameraType::G1); cv::Mat img; diff --git a/video_io/sv_video_base.cpp b/video_io/sv_video_base.cpp index ac727d5..aaf716a 100644 --- a/video_io/sv_video_base.cpp +++ b/video_io/sv_video_base.cpp @@ -1134,26 +1134,26 @@ bool CameraBase::read(cv::Mat& image) } return ret; - if (this->_type == CameraType::WEBCAM || this->_type == CameraType::G1 || this->_type == CameraType::MIPI) - { - int n_try = 0; - while (n_try < 5000) - { - if (this->_is_updated) - { - this->_is_updated = false; - this->_frame.copyTo(image); - break; - } - std::this_thread::sleep_for(std::chrono::milliseconds(20)); - n_try ++; - } - } - if (image.cols == 0 || image.rows == 0) - { - throw std::runtime_error("SpireCV (101) Camera cannot OPEN, check CAMERA_ID!"); - } - return image.cols > 0 && image.rows > 0; + // if (this->_type == CameraType::WEBCAM || this->_type == CameraType::G1 || this->_type == CameraType::MIPI) + // { + // int n_try = 0; + // while (n_try < 5000) + // { + // if (this->_is_updated) + // { + // this->_is_updated = false; + // this->_frame.copyTo(image); + // break; + // } + // std::this_thread::sleep_for(std::chrono::milliseconds(20)); + // n_try ++; + // } + // } + // if (image.cols == 0 || image.rows == 0) + // { + // throw std::runtime_error("SpireCV (101) Camera cannot OPEN, check CAMERA_ID!"); + // } + // return image.cols > 0 && image.rows > 0; } void CameraBase::release() {