Skip to content

Commit

Permalink
Merge pull request opencv#18685 from APrigarina:fix_curved_qrcodes
Browse files Browse the repository at this point in the history
  • Loading branch information
alalek committed Oct 28, 2020
2 parents 4a07607 + 0f7b2eb commit e3ce0fb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/objdetect/src/qrcode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,7 @@ class QRDecode
bool computeClosestPoints(const vector<Point> &result_integer_hull);
bool computeSidesPoints(const vector<Point> &result_integer_hull);
vector<Point> getPointsNearUnstablePoint(const vector<Point> &side, int start, int end, int step);
bool findAndAddStablePoint(const vector<Point> &result_integer_hull);
bool findAndAddStablePoint();
bool findIndexesCurvedSides();
bool findIncompleteIndexesCurvedSides();
Mat getPatternsMask();
Expand Down Expand Up @@ -1274,7 +1274,7 @@ vector<Point> QRDecode::getPointsNearUnstablePoint(const vector<Point> &side, in
return points;
}

bool QRDecode::findAndAddStablePoint(const vector<Point> &result_integer_hull)
bool QRDecode::findAndAddStablePoint()
{
size_t idx_unstable_point = unstable_pair.first;
Point unstable_point = unstable_pair.second;
Expand Down Expand Up @@ -1385,7 +1385,7 @@ bool QRDecode::findAndAddStablePoint(const vector<Point> &result_integer_hull)

bool add_stable_point = true;

for (size_t i = 0; i < result_integer_hull.size(); i++)
for (size_t i = 0; i < original_points.size(); i++)
{
if(arePointsNearest(stable_point, original_points[i], 3.0))
{
Expand Down Expand Up @@ -2211,7 +2211,7 @@ bool QRDecode::preparingCurvedQRCodes()
return false;
if (!computeSidesPoints(result_integer_hull))
return false;
if (!findAndAddStablePoint(result_integer_hull))
if (!findAndAddStablePoint())
return false;
if (!findIndexesCurvedSides())
return false;
Expand Down

0 comments on commit e3ce0fb

Please sign in to comment.