From f6c7e018547c5bf90f2b4b71ecda2fed36f52e8e Mon Sep 17 00:00:00 2001 From: 13038267101 Date: Wed, 1 Mar 2023 11:04:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=95=B8=E5=8F=98=E7=AE=97?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hgdriver/ImageProcess/CISTestImageProcess.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/hgdriver/ImageProcess/CISTestImageProcess.cpp b/hgdriver/ImageProcess/CISTestImageProcess.cpp index 6eeccea..761ed53 100644 --- a/hgdriver/ImageProcess/CISTestImageProcess.cpp +++ b/hgdriver/ImageProcess/CISTestImageProcess.cpp @@ -89,6 +89,23 @@ int CISTestImageProcess::test(const cv::Mat& image, CISTestResult& result) box.size.width = box.size.height; box.size.height = temp; } + + if (box.angle < -45) + { + box.angle += 90; + float temp = box.size.width; + box.size.width = box.size.height; + box.size.height = temp; + } + + if (box.angle > 45) + { + box.angle -= 90; + float temp = box.size.width; + box.size.width = box.size.height; + box.size.height = temp; + } + if (box.angle > 45) { box.angle -= 90;