Skip to content

Commit 17bbc3c

Browse files
committed
fix(deskew): only require s1 confidence in ObliqueFinder per review
Relax the auto-oblique confidence check to require good confidence only on the main skew (s1). The rotated sausage mask (s2) may have noisier confidence; we still use s2.angle() for the oblique difference.
1 parent ea26dcc commit 17bbc3c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/core/filters/deskew/ObliqueFinder.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ std::optional<double> findObliqueDegrees(const BinaryImage& mask,
5858
const Skew s1 = skewFinder.findSkew(mask);
5959
const Skew s2 = skewFinder.findSkew(rotated);
6060

61-
if (s1.confidence() < Skew::GOOD_CONFIDENCE || s2.confidence() < Skew::GOOD_CONFIDENCE) {
61+
// Only require confidence on the main skew (s1); s2 on the rotated sausage mask may be noisier (review #110).
62+
if (s1.confidence() < Skew::GOOD_CONFIDENCE) {
6263
return std::nullopt;
6364
}
6465

0 commit comments

Comments
 (0)