Interactive Image Processing with Lenna
We will use the classic Lenna image to explore MATLAB image processing:
grayImg = rgb2gray(img);
imshow(grayImg)
title('Grayscale Lenna')
bwImg = imbinarize(grayImg);
imshow(bwImg)
title('Binary Lenna')
Sobel Method:
edgesImg = edge(grayImg, 'Sobel'); imshow(edgesImg)
Canny Method (Cleaner edges):
edgesCanny = edge(grayImg, 'Canny'); imshow(edgesCanny)
figure
imhist(grayImg)
title('Histogram of Grayscale Lenna')
Shows distribution of brightness values in the image.
smallImg = imresize(grayImg, 0.5); imshow(smallImg) imwrite(smallImg, 'Lenna_small.png')
imfilterimdilate, imerode)