diff --git a/demo/demo/demo.cpp b/demo/demo/demo.cpp index 72ebcb3..f9772f2 100644 --- a/demo/demo/demo.cpp +++ b/demo/demo/demo.cpp @@ -46,16 +46,16 @@ struct InfoShow{ double adfGeoTransform[6]; cv::Mat H; cv::Mat frame_v; + cv::Mat frame_disp; }; + void sig_handler(int signo) { std::cout << "request gateway stop\n"; gRun = false; } - - void *showImages(void *x_void_ptr) { InfoShow *info_show = (InfoShow *) x_void_ptr; @@ -65,6 +65,8 @@ void *showImages(void *x_void_ptr) cv::Mat original_frame_top; cv::namedWindow("detection", cv::WINDOW_NORMAL); cv::namedWindow("topview", cv::WINDOW_NORMAL); + cv::namedWindow("disparity", cv::WINDOW_NORMAL); + // original_frame_top = cv::imread("../demo/demo/data/map/map_geo.jpg"); original_frame_top = cv::imread("../demo/demo/data/map/MASA_4670.png"); cv::Mat frame_v_loc; @@ -72,6 +74,8 @@ void *showImages(void *x_void_ptr) geodetic_converter::GeodeticConverter gc; double adfGeoTransform[6]; cv::Mat H; + cv::Mat frame_disp_loc; + while (gRun) { TIMER_START @@ -87,6 +91,8 @@ void *showImages(void *x_void_ptr) adfGeoTransform[i] = info_show->adfGeoTransform[i]; // cv::Mat H; H = info_show->H.clone(); + frame_disp_loc = info_show->frame_disp.clone(); + sem.unlock(); frame_top = original_frame_top.clone(); @@ -127,9 +133,13 @@ void *showImages(void *x_void_ptr) //outputVideo<< frame_top; // ------------------------------------------------ - + std::cout<<"size: "<> frame; + orig_frame = frame.clone(); if (frame_nbr == 0) cv::initUndistortRectifyMap(cameraMat, distCoeff, cv::Mat(), cameraMat, frame.size(), CV_16SC2, map1, map2); @@ -299,7 +311,6 @@ int main(int argc, char *argv[]) //undistort(temp, frame, cameraMat, distCoeff); - if (!frame.data) { usleep(1000000); @@ -308,6 +319,7 @@ int main(int argc, char *argv[]) continue; } + // this will be resized to the net format dnn_input = frame.clone(); // TODO: async infer @@ -343,8 +355,15 @@ int main(int argc, char *argv[]) // backtorgb = cv::cvtColor(pre_canny,cv::COLOR_GRAY2RGB) cv::cvtColor(pre_canny, pre_canny_RGB, CV_GRAY2RGB); cv::cvtColor(canny, canny_RGB, CV_GRAY2RGB); - frame_disparity(pre_canny_RGB, canny_RGB, frame_nbr, 999, 0); - + frame_disp = frame_disparity(pre_canny_RGB, canny_RGB, frame_nbr, 999, 0); + std::cout<<"size: "<(end_t_segmentation - step_t_segmentation).count() << " ms"<