Estimate gap between two adjacent images I have two images of a panoramic view but there is a small gap (&lt;24 pixels) in the horizontal dimension between them. I would like to do interpolation/inpainting to fill the gap, but the exact size of the gap is unknown.

Is there a way to estimate the best value for the gap? My first thought is to detect lines/curves in the images (Canny edge detection et al) and somehow try to connect the lines at the adjacent edges, and see which value for the gap gives the smoothest continuation. However I don't known where to begin, or if there is a better/simpler solution.
There are multiple papers dealing with this issue, using similar methods (extrapolation beyond the image edges to create a virtual overlap).

Alignment and Mosaicing of Non-Overlapping Images by Yair Poleg &amp; Shmuel Peleg

Building a Mosaic from Non-Overlapping Images by Benjamin Choi

A Novel Technique for Non-overlapping Image
Mosaicing based on Pyramid Method by Achala Pandey &amp; Umesh C. Pati