Getting Started With Image Processing Using MATLAB
New to Image Processing ? We have the materials for you to get started with Digital Image Processing using MATLAB.
Take your first step into Image processing using MATLAB by reading an Image.
w=imread('pout.tif'); % Reading an Image
Once read, display the image
imshow(w); % Displaying an Image
You can fetch the size of the image as shown
size=size(im); % Size of image
Likewise various operations can be performed on Digital Images.
w=imread('pout.tif'); % Reading an Image (Grayscale)
figure();
Gray=imshow(w); % Displaying GrayScale Image
title('Grayscale Original Image (pout.tif)');
info=imfinfo('pout.tif'); % Fetching image info
intVal=w(200,200); % Intensity Value for a given Pixel
impixelinfo % Fetching pixel Info for any Pixel
a=imread('autumn.tif'); % Reading an Image (RGB)
figure();
RGB=imshow(a); % Displaying RGB Image
title('RGB original image (autumn.tif)');
figure();
RGS2=imagesc(a); % Display using imagesc()
title('RGB scaled image (autumn.tif)');
RGBSize=size(a) % Size of RGB image
GraySize=size(w) % Size of Grayscale image
A RGB image comprises of 3 different components, viz. Red, Green and Blue, which can be separated and processes individually if and when required.
rCom=a(:,:,1); % Fetching red components
gCom=a(:,:,2); % Fetching green components
bCom=a(:,:,3); % Fetching blue components
figure();
subplot(131); imshow(rCom); % Displaying red components of image
title('Red Component');
subplot(132); imshow(gCom); % Displaying green components of image
title('Green Component');
subplot(133); imshow(bCom); % Displaying blue components of image
title('Blue Component');
This bring to an end to the Introduction to Image Processing.
Check out the next article on Spatial Resolution and Quantization of Digital Image.