From badef606c2ce0f4f7ba6bfa7880b27add8dc9451 Mon Sep 17 00:00:00 2001 From: Yannis Guyon Date: Mon, 8 Aug 2022 21:54:35 +0200 Subject: [PATCH] Remove unused size of get_subbox_chart_physical() The argument size of get_subbox_chart_physical() is unused. get_subbox_chart_physical() is called only in one place. The local variable h could overflow the cast to int and lead to a SIGILL in some environments. --- modules/mcc/src/checker_detector.cpp | 7 ++----- modules/mcc/src/checker_detector.hpp | 3 +-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/modules/mcc/src/checker_detector.cpp b/modules/mcc/src/checker_detector.cpp index f5ce44ed569..b84c885d6e9 100644 --- a/modules/mcc/src/checker_detector.cpp +++ b/modules/mcc/src/checker_detector.cpp @@ -802,8 +802,7 @@ void CCheckerDetectorImpl:: // get physical char box model std::vector chartPhy; - cv::Size size_box_phy; - get_subbox_chart_physical(points, chartPhy, size_box_phy); + get_subbox_chart_physical(points, chartPhy); // Find the perspective transformation that brings current chart to rectangular form Matx33f ccT = cv::getPerspectiveTransform(points, chartPhy); @@ -1101,7 +1100,7 @@ void CCheckerDetectorImpl:: } void CCheckerDetectorImpl:: - get_subbox_chart_physical(const std::vector &points, std::vector &chartPhy, cv::Size &size) + get_subbox_chart_physical(const std::vector &points, std::vector &chartPhy) { float w, h; cv::Point2f v1 = points[1] - points[0]; @@ -1117,8 +1116,6 @@ void CCheckerDetectorImpl:: chartPhy[1] = cv::Point2f(w, 0); chartPhy[2] = cv::Point2f(w, h); chartPhy[3] = cv::Point2f(0, h); - - size = cv::Size((int)w, (int)h); } void CCheckerDetectorImpl:: diff --git a/modules/mcc/src/checker_detector.hpp b/modules/mcc/src/checker_detector.hpp index 83fc55ad767..75b1644a51b 100644 --- a/modules/mcc/src/checker_detector.hpp +++ b/modules/mcc/src/checker_detector.hpp @@ -164,8 +164,7 @@ class CCheckerDetectorImpl : public CCheckerDetector private: // methods aux void get_subbox_chart_physical( const std::vector &points, - std::vector &chartPhy, - cv::Size &size); + std::vector &chartPhy); void reduce_array( const std::vector &x,