If empty frame, not crashes but exists

This commit is contained in:
gineshidalgo99
2017-06-27 19:32:56 -04:00
parent a1e0a5f413
commit fbbf2ab6e6
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -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)
+3 -1
View File
@@ -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