2

We have hundreds of scanned copies of a form; We need to align each image to a template, correcting for translation and rotation in 2-Dimensions.

After trying some FFT-based methods, we've gotten our best results using OpenCV to do the alignment as described in the article Image Alignment (Feature Based) using OpenCV.

When it works, it works perfectly. But often it produces very strange results.

Sometimes the results are moderately skewed into the 3rd Dimension, but usually the bad alignments are ridiculous to the point of resembling abstract art.

Is there a way to constrain findHomography to only planar results? If not, is there a way to detect non-planar results in findHomography's output?

Screenshots below, the blue regions are my redactions.

CCC
  • 21
  • 2
  • Do you have the `slightly skewed` and the `moderately skewed` images swapped? – Stephen Meschke Aug 27 '19 at 17:22
  • Yes,. Stephen, I did. Thanks! – CCC Aug 27 '19 at 17:30
  • It looks like the least skewed images also have the most blue pixels, and the most skewed images have the fewest blue pixels. Can you determine the amount of skew by simply counting the blue pixels? – Stephen Meschke Aug 27 '19 at 17:41
  • Sadly, the blue pixels are my own after-the-fact redactions of a copyrighted form just before I uploaded it to imgur. We _could_ do an Image Subtraction from the template, I suppose, but that's more ad hoc than I'd like – CCC Aug 27 '19 at 17:52
  • A normal homography will have the xx/yy coefficients close to 1, and the xy/yx close to 0 (exactly 0 if there is no rotation). The coefficients in the denominator should also be small (0 if no perspective). Observe typical values to detect pathological situations. –  Aug 27 '19 at 19:37
  • Any update on this thread? I'm facing the same problem – Paolopast Jun 21 '21 at 15:19
  • @CCC how did you end up solving the issue? – Alexander Langer Oct 25 '21 at 17:25

0 Answers0