Computer Vision Lab Experiment-1: Title: Study of Matlab Image Processing Toolbox
Computer Vision Lab Experiment-1: Title: Study of Matlab Image Processing Toolbox
EXPERIMENT-1
CONCLUSION:
Various image processing commands like imread, imshow, imcrop,
im2bw, imbinarize, rgb2gray, imresize, etc are applied on RGB images
and observed the respective output images using MATLAB.
SOURCE CODE:
clc;
clear all;
close all;
%Reading an image using imread()
A= imread('football.jpg');
figure;
imshow(A); %displays the read image
title('Original Image');
%Cropping the input image using imcrop()
M= imcrop(A);
figure;
imshow(M); %displays the cropped image
title('Cropped Image');
%Converting RGB to Grayscale image
I= rgb2gray(A);
figure;
imshow(I); %displays the Gray image
title('Gray Image');
%Converting Gray image into Binary image using
imbinarize()
B= imbinarize(I);
figure;
imshow(B); %displays the Binary image
title('Binary Image');
%Converting Gray image into Binary by using im2bw()
BI= im2bw(I);
figure;
imshow(BI); %displays the Binary image
title('Binary image using im2bw');
%Resizing the input image with scale between 0-1
C= imresize(A,0.6);
figure;
imshow(C); %displays the image smaller than
input title('Resized Image 1');
%Resizing the input image with scale greater than 1
D= imresize(A,1.6);
figure;
imshow(D); %displays the image larger than input
title('Resized Image 2');