forked from scantailor/scantailor
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change post-scale handling in Dewarping image transform
There were 2 problems with the old way post-scale was handled: 1. It was used in transform fingerprint calculation while depending on other distortion model parameters. Because floating point values are rounded when saving to XML, recalculated post-scale factors were a bit off in a way that RoundingHasher (used in transform fingerprint calculation) is not able to compensate. 2. When a strong perspective distortion is present, the old way post-scale was being calculated resulted in huge output images. This commit fixes both problems by: 1. Splitting the post scale factors into two sets. One of them is independent from other parameters and therefore participates in transform fingerprint calculation. The other one can be recalculated from other parameters and therefore doesn't participate in transform fingerprint calculation. 2. When post-scale is calculated, we now try to match the area (in pixels) of a curved quadrilater to the area of the corresponding dewarped rectangle.
- Loading branch information
Showing
2 changed files
with
94 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters