Multimedia
Multimedia
Multimedia
06420902712
MULTIMEDIA
TECHNOLOGY
LAB FILE
ETCS-360
Made By:
Submitted To:
RAVI KUMAR
Ms. Priyanka
09120902712
Multimedia Lab
06420902712
INDEX
S.No.
AIM
PAGE DATE
OF DATE
OF TEACHERS
NO.
PRACTICAL SUBMISSION SIGNATURE
Multimedia Lab
06420902712
Experiment No. 1
Objective: Introduction to MATLAB and basic operations on images
1. What is MATLAB?
MATLAB stands for MATrix LABoratory, is a high-performance language for technical
computing. It integrates computation, visualization, and programming environment.
Furthermore, MATLAB is a modern programming language environment: it has
sophisticated data structures, contains built-in editing and debugging tools, and supports
object-oriented programming. Its ideal for research and data analysis purposes.
MATLAB has many advantages compared to conventional computer languages (e.g., C,
FORTRAN) for solving technical problems.
It has powerful built-in routines that enable a very wide variety of computations. It also has
easy to use graphics commands that make the visualization of results immediately available.
Specific applications are collected in packages referred to as toolbox. There are toolboxes
for signal processing, symbolic computation, control theory, simulation, image procesing,
and several other fields of applied science and engineering.
2. Image Processing Toolbox provides a comprehensive set of reference-standard
algorithms, functions, and apps for image processing, analysis, visualization, and
algorithm development.
This Toolbox provides image manipulation capabilities, handles a wide range of image
formats and allows creation of contours or histograms.
Function Name
Syntax
Description
imread()
A = imread(filename, fmt)
Multimedia Lab
06420902712
fmt refers to the format in which
the file exists at the
corresponding location.
Supported types include:
'gif','bmp' etc.
The return value A is an array
containing the image data. If the
file contains a grayscale
image, A is an M-by-N array.
imshow()
figure
imshow(I,[low high])
clear var;
size()
[m,n] = size(X)
Multimedia Lab
06420902712
Source Code:
%Created By Abhineet Saxena
%Date: 02-Feb-2015
%File_1--Introduction To Image Processing
%-------------------------clc
%Clears all input and output from command window display
I='rice.png';
% A char variable which stores a path to a file.
Img_read=imread(I);
%imread() function belongs to Image Processing Toolkit,used for reading in
%an image.
figure(1),imshow(Img_read)
%Displays the specified image,in a figure window
[r,c]=size(Img_read);
Multimedia Lab
06420902712
Outputs:
Multimedia Lab
06420902712
Experiment No. 2
Objective: To perform bit-plane slicing of an image and create subplots based on the
output produced.
Theory:
Bit Plane Slicing
Instead of highlighting gray level images, highlighting the contribution made to total image
appearance by specific bits might be desired. Suppose that each pixel in an image is represented by
8 bits. Imagine the image is composed of 8, 1-bit planes ranging from bit plane1-0 (LSB)to bit
plane 7 (MSB).
In terms of 8-bits bytes, plane 0 contains all lowest order bits in the bytes comprising the pixels in
the image and plane 7 contains all high order bits.
This technique of image slicing is helpful in image compression,and in differentially analysing the
contribution made by each bit to the overall image.
S.No.
Function/Command Name
Syntax
Description
title()
title(str)
plot()
plot(I),plot(X,Y)
subplot()
subplot(m,n,p)
reshape()
logical()
L = logical(A) converts
numeric input A into an array
Multimedia Lab
06420902712
of logical values. Any nonzero
element of input A is converted
to logical 1 (true) and zeros are
converted to logical 0 (false).
histogram()
bitget()
max(A),min(A)
Source Code:
%Created by Abhineet Saxena
%Date: 9 February 2015
%~~To display bit-slicing capabilities of MATLAB and to plot the values by
%reshaping them.
%% Bit Slicing and display of subplots
figure(1);
%To Read-in the image: %
ipath='rice.png';
I=imread(ipath);
[r, c]= size(I);
%Displaying the maximum and minimum pixel number value in the scanned image%
mymax=max(I);
mymin=min(I);
%Extracting the corresponding bit slices and displaying it in the subplot%
A=bitget(I,1);
subplot(3,3,1),imshow(logical(A));
title('Subplot 1: Bit Slice 1');
A=bitget(I,2);
subplot(3,3,2),imshow(logical(A));
title('Subplot 2: Bit Slice 2');
A=bitget(I,3);
subplot(3,3,3),imshow(logical(A));
title('Subplot 3: Bit Slice 3');
A=bitget(I,4);
subplot(3,3,4),imshow(logical(A));
title('Subplot 4: Bit Slice 4');
Multimedia Lab
06420902712
A=bitget(I,5);
subplot(3,3,5),imshow(logical(A));
title('Subplot 5: Bit Slice 5');
A=bitget(I,6);
subplot(3,3,6),imshow(logical(A));
title('Subplot 6: Bit Slice 6');
A=bitget(I,7);
subplot(3,3,7),imshow(logical(A));
title('Subplot 7: Bit Slice 7');
A=bitget(I,8);
subplot(3,3,8),imshow(logical(A));
title('Subplot 8: Bit Slice 8');
subplot(3,3,9),imshow(I);
title('Subplot 9: Original Image');
%% Reshape the image and plot the histograms
figure(2);
Bimg_r=reshape(I,r*c,1);
Bimg_c=reshape(I,1,r*c);
nbins=255;
subplot(2,2,1), imshow(Bimg_r);
title('Reshaping the image in column major order');
subplot(2,2,2),hist(double(Bimg_r),nbins);
title('Histogram for the column reshaped matrix');
subplot(2,2,3), imshow(Bimg_c);
title('Reshaping the image in row major order');
subplot(2,2,4),hist(double(Bimg_c),nbins);
title('Histogram for the row reshaped matrix');
Outputs:
Multimedia Lab
06420902712
10