提交 fbbf2ab6 编写于 作者: G gineshidalgo99

If empty frame, not crashes but exists

上级 a1e0a5f4
......@@ -98,7 +98,7 @@ namespace op
checkIfTooManyConsecutiveEmptyFrames(mNumberConsecutiveEmptyFrames, datum.cvInputData.empty());
}
// Check producer is running
if (!datumProducerRunning)
if (!datumProducerRunning || datum.cvInputData.empty())
datums = nullptr;
// Increase counter if successful image
if (datums != nullptr)
......
......@@ -144,7 +144,9 @@ namespace op
// Process wrong frames
if (frame.empty())
{
log("Empty frame detected.", Priority::Max, __LINE__, __FUNCTION__, __FILE__);
log("Empty frame detected, frame number " + std::to_string((int)get(CV_CAP_PROP_POS_FRAMES))
+ " of " + std::to_string((int)get(CV_CAP_PROP_FRAME_COUNT)) + ".",
Priority::Max, __LINE__, __FUNCTION__, __FILE__);
mNumberEmptyFrames++;
}
else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册