Skip to content

Commit

Permalink
fixed computeDimension returning wrong dimensions
Browse files Browse the repository at this point in the history
if the result is exactly between two dimensions, the function now returns false
  • Loading branch information
ImperatorZurg authored Apr 12, 2024
1 parent fbe83ff commit 1da38a2
Showing 1 changed file with 5 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,24 +175,13 @@ class function TDetector.computeDimension(topLeft: IResultPoint;
((tltrCentersDimension + tlblCentersDimension), 1) + 7;

case (dimension and 3) of
0:
begin
inc(dimension);
end;
2:
begin
dec(dimension);
end;
3:
begin
begin
Result := true;
exit
end
end;
0: inc(dimension); // below a valid dimension
1: ; // exactly on a valid dimension e.g. 21, 25, 29, ..., 177
2: dec(dimension); // above a valid dimension
3: Exit(False); // exactly between two valid dimensions
end;

Result := true;
Result := True;
end;

class function TDetector.createTransform(const topLeft, topRight, bottomLeft,
Expand Down

0 comments on commit 1da38a2

Please sign in to comment.