mirror of
https://gitcode.com/gh_mirrors/ope/OpenFace.git
synced 2026-05-14 19:27:56 +00:00
Some work on demo scripts and according bug fixes
This commit is contained in:
@@ -403,7 +403,6 @@ void SequenceCapture::SetCameraIntrinsics(float fx, float fy, float cx, float cy
|
||||
|
||||
cv::Mat SequenceCapture::GetNextFrame()
|
||||
{
|
||||
frame_num++;
|
||||
|
||||
if (is_webcam || !is_image_seq)
|
||||
{
|
||||
@@ -429,19 +428,23 @@ cv::Mat SequenceCapture::GetNextFrame()
|
||||
}
|
||||
else if (is_image_seq)
|
||||
{
|
||||
if (image_files.empty() || frame_num - 1 > image_files.size())
|
||||
if (image_files.empty() || frame_num >= image_files.size())
|
||||
{
|
||||
// Indicate lack of success by returning an empty image
|
||||
latest_frame = cv::Mat();
|
||||
}
|
||||
|
||||
latest_frame = cv::imread(image_files[frame_num-1], -1);
|
||||
else
|
||||
{
|
||||
latest_frame = cv::imread(image_files[frame_num], -1);
|
||||
}
|
||||
time_stamp = 0;
|
||||
}
|
||||
|
||||
// Set the grayscale frame
|
||||
convertToGrayscale(latest_frame, latest_gray_frame);
|
||||
|
||||
frame_num++;
|
||||
|
||||
return latest_frame;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user