Skip to content

Commit

Permalink
description added
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksandrPanov committed Jun 15, 2023
1 parent 4542cc9 commit c65e517
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions modules/objdetect/src/qrcode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1983,6 +1983,9 @@ static inline bool setHorizontalOrder(vector<int>& x_arr, vector<int>& y_arr) {
if (y_arr[i] == y_arr[i-1])
countY++;
}
// Only the points of the function can be interpolated using splines.
// Contour points may not be a function, there may be several points with the same x coordinate and different y.
// We are adding a small offset in x coord to fix this problem. This should not significantly affect the final answer.
if (countX != 0 || countY != 0) {
vector<int>& newX = countX < countY ? x_arr : y_arr;
const int delta = newX.back() > newX.front() ? 1 : -1;
Expand Down

0 comments on commit c65e517

Please sign in to comment.