How it works...
Weighted Sobel horizontal and vertical gradients were used in the get_gradient() function to compute the gradient of a color channel. The findTransformECC() function from OpenCV-Python was used for the ECC algorithm. The first two parameters accepted by this function were the (single-channel) template image and the input image.
The red color channel was used as a template (reference) and the green/blue color channels were used as inputs. The third parameter passed to the function was warp_matrix, which was initialized to the 3x3 identity matrix.
The fourth parameter is the motion model; here, MOTION_HOMOGRAPHY was used as the motion model (8 parameters are estimated in the 3x3 warp matrix). The following table lists all possible ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access