File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -65,18 +65,17 @@ bool CameraCapture::getFrame(cv::Mat& outFrame)
6565 return true ;
6666}
6767
68- bool CameraCapture::getFrames (cv::Mat* frames, int numFrames, double seconds )
68+ bool CameraCapture::getFrames (cv::Mat* frames, int numFrames, int intervals )
6969{
70- if (frames == nullptr || numFrames <= 0 || seconds <= 0 ) return false ;
71- int intervalMs = static_cast <int >((seconds * 1000 ) / numFrames);
70+ if (frames == nullptr || numFrames <= 0 || intervals <= 0 ) return false ;
7271 bool allSuccess = true ;
7372 for (int i = 0 ; i < numFrames; ++i) {
7473 if (!getFrame (frames[i])) {
7574 std::cerr << " フレーム " << i << " の取得に失敗しました。" << std::endl;
7675 allSuccess = false ;
7776 }
7877 if (i < numFrames - 1 ) {
79- std::this_thread::sleep_for (std::chrono::milliseconds (intervalMs ));
78+ std::this_thread::sleep_for (std::chrono::milliseconds (intervals ));
8079 }
8180 }
8281 return allSuccess;
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ class CameraCapture {
2828 bool openCamera ();
2929 void setCapProps (double width, double height);
3030 bool getFrame (cv::Mat& outFrame);
31- bool getFrames (cv::Mat* frames, int numFrames, double seconds );
31+ bool getFrames (cv::Mat* frames, int numFrames, int intervals );
3232 bool saveFrame (const cv::Mat& frame, std::string filepath, std::string filename);
3333};
3434
You can’t perform that action at this time.
0 commit comments