Skip to content

Commit

Permalink
Remove unused size of get_subbox_chart_physical()
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
y-guyon committed Aug 8, 2022
1 parent 8eaa8ac commit badef60
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
7 changes: 2 additions & 5 deletions modules/mcc/src/checker_detector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -802,8 +802,7 @@ void CCheckerDetectorImpl::

// get physical char box model
std::vector<cv::Point2f> 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);
Expand Down Expand Up @@ -1101,7 +1100,7 @@ void CCheckerDetectorImpl::
}

void CCheckerDetectorImpl::
get_subbox_chart_physical(const std::vector<cv::Point2f> &points, std::vector<cv::Point2f> &chartPhy, cv::Size &size)
get_subbox_chart_physical(const std::vector<cv::Point2f> &points, std::vector<cv::Point2f> &chartPhy)
{
float w, h;
cv::Point2f v1 = points[1] - points[0];
Expand All @@ -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::
Expand Down
3 changes: 1 addition & 2 deletions modules/mcc/src/checker_detector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,7 @@ class CCheckerDetectorImpl : public CCheckerDetector
private: // methods aux
void get_subbox_chart_physical(
const std::vector<cv::Point2f> &points,
std::vector<cv::Point2f> &chartPhy,
cv::Size &size);
std::vector<cv::Point2f> &chartPhy);

void reduce_array(
const std::vector<float> &x,
Expand Down

0 comments on commit badef60

Please sign in to comment.