Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Using findHomography to align scanned documents; How do I avoid obviously-bad (non-planar/3D) transforms?

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.