MATLAB: Comparing 2 images by subtracting pixels and what happen if rgb values goes negative

imageimage acquisitionimage analysisimage processingimage reconstructionimage segmentationimages

Hi,
I am wondering how do you go about comparing the pixels of each images with subtraction and return the image with higher pixel difference. If subtraction works but rgb values goes negative, will it just display a black screen?

Best Answer

dhrye:
OK, look at your code very carefully:
image2 = 'image2.jpg';
% Display it.
imread(image2);
Now, does that look like how I told you to fix it? (Which is below)
image2 = imread('image2.jpg');
imshow(image2);
No, it does not. You're not displaying it because imread reads it in from a disk file, it does not display it in an axes like imshow does. And you're still having image2 be a character string despite me telling you to set it equal to the output of imread. Correct it and try again.