Exp 1
Exp 1
Submitted by:
Name: Ruhina Tabasshum Prome
Roll: 1810005
Department: Electrical and Computer Engineering
Submitted to:
Oishi Jyoti
Lecturer
Department of ECE
RUET
Theory: Digital image processing is the use of a digital computer to process digital images
through an algorithm. As a subcategory or field of digital signal processing, digital image
processing has many advantages over analog image processing. It allows a much wider range of
algorithms to be applied to the input data and can avoid problems such as the build-up of noise
and distortion during processing. Since images are defined over two dimensions (perhaps more)
digital image processing may be modeled in the form of multidimensional systems.
Code:
clc;
clear all;
close all;
%read any image
a=imread('lena.png');
subplot(3,4,1);
imshow(a)
%gray
b=rgb2gray(a);
subplot(3,4,2);
imshow(b);
%bw
c=im2bw(a);
subplot(3,4,3);
imshow(c);
%image size
size(a);
%concatenate
e=imread('fg.jpg');
subplot(3,4,5);
imshow(e);
f=imresize(e,[50,50]);
subplot(3,4,6);
imshow(f);
n=vertcat(d,f);
subplot(3,4,7);
imshow(n);
s=horzcat(d,f);
subplot(3,4,8);
imshow(s);
[i j k] = size(a);
m =1;
for j=1:2:512
b1(:,m,:) = a(:,j,:);
m=m+1;
end
size(b1)
subplot(3,4,9);
imshow(b1);
a = imread('lena.png');
%red channel
a(:,:,2)=0;
a(:,:,3)=0;
subplot(3,4,10)
imshow(a)
a = imread('lena.png');
%green channel
a(:,:,1)=0;
a(:,:,3)=0;
subplot(3,4,11)
imshow(a)
a = imread('lena.png');
%blue channel
a(:,:,1)=0;
a(:,:,2)=0;
subplot(3,4,12)
imshow(a)
Output:
Conclusion: Basic digital image processing operations like reading an image, converting it into
gray, black and white from RGB, showing size, resizing an image, viewing information,
concatenating two images vertically & horizontally, showing odd pixels only, showing green ,red
& blue channel etc. has been studied and simulated.