Some Notes for Image Processing (1)

Comparing images using subtraction (Matlab)

image = imread('pic.png');

grayImage = rgb2gray(image);

% Set LSB = 0

grayImage2 = grayImage - rem(grayImage, 2);

% Subtract from original

diffImage= double(grayImage) - double(grayImage2);

% Display it.

imshow(diffImage, []);
imageprocess1