From 3fdd065fc2e2da9a4b6a393f9c705d73eb7e97f5 Mon Sep 17 00:00:00 2001 From: Grant Terris Date: Tue, 17 Sep 2019 19:02:05 -0700 Subject: [PATCH] Improve I/O Efficiency --- ImageAnalyzer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ImageAnalyzer.cpp b/ImageAnalyzer.cpp index edbec61..7ee723b 100644 --- a/ImageAnalyzer.cpp +++ b/ImageAnalyzer.cpp @@ -13,6 +13,8 @@ using namespace cv; +Mat testFrame = imread("/home/midstate/Documents/flirTest.tif", CV_16UC1); + bool ImageAnalyzer::ProcessImage(uint32_t width, uint32_t height, uint8_t *imgPointer, FaultManager fault_mgr, bool test = false) { Mat frame, mask, viewfinder; @@ -27,7 +29,7 @@ bool ImageAnalyzer::ProcessImage(uint32_t width, uint32_t height, uint8_t *imgPo if (!test) frame = Mat(height, width, CV_16UC1, imgPointer, Mat::AUTO_STEP); else - frame = imread("/home/midstate/Documents/image.png", CV_16UC1); + frame = testFrame; // Create mask and then flatten GaussianBlur(frame, mask, cv::Size(0, 0), 1); @@ -52,7 +54,7 @@ bool ImageAnalyzer::ProcessImage(uint32_t width, uint32_t height, uint8_t *imgPo if (area > fault_area) { drawContours(viewfinder, contours, i, Scalar(ZERO, BITS8, ZERO), 2); - fault_mgr.SaveImage(frame); + fault_mgr.SaveImage(viewfinder); } }