MATLAB: How to Align two images by using specifc coordinates of an object automatically

image alignmentimage analysisimage processingImage Processing Toolbox

I have a reference image, and a scanned image(for example). The scanned image does not have the same position as the reference image, how can I align them by using the black box on the left side of the reference image? I have the coordinates of the black boxes on the reference image, while the scanned image is unknown. I want it to align automatically after scanning the image. Thank you

Best Answer

You can use imregister().