C++ tutorial API only cv::imshow if not empty

This commit is contained in:
Gines Hidalgo
2020-06-19 19:13:05 -04:00
parent 9827ab75d6
commit b365f48e48
15 changed files with 88 additions and 27 deletions
@@ -31,8 +31,13 @@ void display(const std::shared_ptr<std::vector<std::shared_ptr<op::Datum>>>& dat
{
// Display image
const cv::Mat cvMat = OP_OP2CVCONSTMAT(datumsPtr->at(0)->cvOutputData);
cv::imshow(OPEN_POSE_NAME_AND_VERSION + " - Tutorial C++ API", cvMat);
cv::waitKey(0);
if (!cvMat.empty())
{
cv::imshow(OPEN_POSE_NAME_AND_VERSION + " - Tutorial C++ API", cvMat);
cv::waitKey(0);
}
else
op::opLog("Empty cv::Mat as output.", op::Priority::High, __LINE__, __FUNCTION__, __FILE__);
}
else
op::opLog("Nullptr or empty datumsPtr found.", op::Priority::High);