MATLAB: Creating a full image from two partial images

Image Processing Toolboximages

I would like to combine both attached images into one image that consists only of the entire circle. is there a code i can use to find identical parts in both images and then have it superimpose both images? I would like to use matlab since I have many images to process. Thanks!

Best Answer

You can try
samePixels = image1 == image2;
imshow(samePixels);
But if you want the same withing some tolerance, like 5 gray levels, then do
tolerance = 5;
diffImage = abs(double(image1) - double(image2)) > tolerance;
imshow(diffImage, []);
If you want a higher level comparison than this pixel by pixel comparison then you'll have to measure things like mean intensity, ssim, psnr, area fraction, or whatever constitutes your definition of being the same.