MATLAB: How to highlight the difference of two images using correlation

correlationimage processingImage Processing Toolbox

i want code to compare two images using correlation and to highlight the difference region

Best Answer

I don't know how to do that, or if it's even possible. Why not just subtract the images to see which pixels are different? Do you know what correlation is? Do you know what the correlation image looks like and how to interpret the values of it? That is why I ask. Now if you have one small image and you want to consider it a template and scan a larger image to find where is exists in the larger image, then that's something different than what you asked. You can use normalized cross correlation for that, and I've attached a demo for others who are interested.
Related Question