The parametric image alignment problem involves finding a transformation that aligns two images. In this recipe, you will learn how to estimate the geometric transform (in terms of a warp matrix) between two images using the ECC criterion with OpenCV-Python library's implementation. Given a pair of image profiles (intensities), Ir(x) (the reference image) and lw(y) (the warped image), and a set of coordinates T={xk, k=1,..,K} (known as the target area), the alignment problem is to find the corresponding coordinate set in the warped image. Assuming φ is the given transformation model, the alignment problem can be extrapolated to the problem of estimating the parameters, p, as shown in the following screenshot:
ρ(p) is maximized with gradient-based approaches. The ECC criterion does not depend on the changes in contrast...