For further refinement of the color channel alignment, I applied a Sobel filter, which is
commonly used for edge detection in images. This technique helps to align the sharp transitions
in brightness between different parts of the image, making the alignment process more robust,
especially in cases where strong edges are present. By first applying the Sobel filter to each
color channel (Blue, Green, and Red), I focused on aligning the edges between the channels, ensuring
that key image details like borders and contours were matched up more precisely.
After filtering, I used the Pyramid search algorithm to align the Sobel-processed channels, which improved
the accuracy of the offsets compared to the non-filtered version. Once I had the Sobel-based alignment, I used
those calculated offsets to align the original, unfiltered channels. This approach proved particularly effective
for certain images, where subtle improvements in alignment were critical for visual quality.
A significant improvement can be seen in the alignment of "emir.tif." Without Sobel filtering, the offsets for the
Green and Red channels were (43, 78) and (-334, 126), respectively. However, after applying the Sobel filter, these
offsets were refined to (16, 78) for the Green channel and (33, 142) for the Red channel, leading to a much cleaner final image.
This is because the images being matched do not have identical brightness values. This disparity between the channels can
complicate the alignment process, since each channel may capture different details and brightness contrasts. The Sobel filter
mitigates this issue by focusing on edge information rather than raw pixel intensity, allowing the algorithm to align the
images more effectively.