From 0025a555bab60ba0021cf12cbccaceffad9b04c4 Mon Sep 17 00:00:00 2001 From: TinyOh Date: Wed, 13 Mar 2019 18:18:21 +0800 Subject: [PATCH] fix(api): plugin error --- samples/tutorials/data/get_with_plugin.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/samples/tutorials/data/get_with_plugin.cc b/samples/tutorials/data/get_with_plugin.cc index af943b0..8167cf4 100644 --- a/samples/tutorials/data/get_with_plugin.cc +++ b/samples/tutorials/data/get_with_plugin.cc @@ -41,13 +41,15 @@ int main(int argc, char *argv[]) { auto &&left_data = api->GetStreamData(Stream::LEFT); auto &&right_data = api->GetStreamData(Stream::RIGHT); - cv::Mat img; - cv::hconcat(left_data.frame, right_data.frame, img); - cv::imshow("frame", img); + if (!left_data.frame.empty() && !right_data.frame.empty()) { + cv::Mat img; + cv::hconcat(left_data.frame, right_data.frame, img); + cv::imshow("frame", img); - auto &&disp_data = api->GetStreamData(Stream::DISPARITY_NORMALIZED); - if (!disp_data.frame.empty()) { - cv::imshow("disparity", disp_data.frame); + auto &&disp_data = api->GetStreamData(Stream::DISPARITY_NORMALIZED); + if (!disp_data.frame.empty()) { + cv::imshow("disparity", disp_data.frame); + } } char key = static_cast(cv::waitKey(1));