0% found this document useful (0 votes)
32 views44 pages

Dip Manual

The document is a laboratory manual for the course 'Digital Imaging and Computer Vision' at K.L.N. College of Engineering for the academic year 2024-25. It outlines the department's vision, mission, program educational objectives, and specific outcomes, along with detailed course objectives, unit topics, and MATLAB lab components. The manual aims to provide students with practical experience in digital image processing and computer vision techniques through various MATLAB programming exercises.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views44 pages

Dip Manual

The document is a laboratory manual for the course 'Digital Imaging and Computer Vision' at K.L.N. College of Engineering for the academic year 2024-25. It outlines the department's vision, mission, program educational objectives, and specific outcomes, along with detailed course objectives, unit topics, and MATLAB lab components. The manual aims to provide students with practical experience in digital image processing and computer vision techniques through various MATLAB programming exercises.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 44

K.L.N.

COLLEGE OF ENGINEERING
Pottapalayam-630612
An Autonomous Institution affiliated to Anna University, Chennai

(ISO 9001:2015 Certified Institution)

Department of Electronics and Communication Engineering

Accredited By NBA

20ECV53- DIGITAL IMAGING AND COMPUTER VISION

(Regulation2020)

Academic Year: 2024-25

Laboratory Manual

Compiled by

Dr.P.KARPAGAVALLI, ASP / ECE


Mrs.C.SASIREKHA, AP / ECE
Mrs.A.V. VEERASIVAGAMI PANDI, AP/ECE
K.L.N. COLLEGE OF ENGINEERING
Pottapalayam-630612
An Autonomous Institution affiliated to Anna University, Chennai

(ISO 9001:2015 Certified Institution)

Department of Electronics and Communication Engineering

Accredited By NBA

20ECV53- DIGITAL IMAGING AND COMPUTER VISION

(Regulation2020)

Academic Year: 2024-25

Laboratory Manual

Name of the Student: …………………………………………………..

Roll No: …………….........

Register No: ……………………………….

Year / Sem / Section: ………………………………………..

1
DEPARTMENT VISION , MISSION, POS, PSOS & PEOS

VISION
To promote as a centre of excellence in educational and research activities related to electronics and
communication engineering and its allied areas.
MISSION
 To create educational and research environment to meet ever changing and ever demanding needs of
electronics and communication industry along with IT and other interdisciplinary fields.
 To mould the students to become ethically upright and recognized as responsible engineers.

PROGRAM EDUCATIONAL OBJECTIVES


To prepare graduates with a strong foundation in Engineering science and Technology with more emphasis in
Electronics and Communication Engineering and its allied areas.
To prepare the students to pursue successful career in industry and to motivate them for higher education.
To prepare the graduates to sustain as good professional, researcher and to practice them in emerging
technologies through lifelong learning.
To impart students with ethical standards, professional excellence through effective communication skills,
team work, multi-disciplinary projects and social responsibility.

PROGRAM OUTCOMES

PO1: Engineering Knowledge: Apply knowledge of mathematics, natural science, computing, engineering fundamentals and an
engineering specialization as specified in WK1 to WK4 respectively to develop to the solution of complex engineering problems.

PO2: Problem Analysis: Identify, formulate, review research literature and analyze complex engineering problems reaching
substantiated conclusions with consideration for sustainable development. (WK1 to WK4)

PO3: Design/Development of Solutions: Design creative solutions for complex engineering problems and design/develop
systems/components/processes to meet identified needs with consideration for the public health and safety, whole-life cost, net
zero carbon, culture, society and environment as required. (WK5)

PO4: Conduct Investigations of Complex Problems: Conduct investigations of complex engineering problems using research-
based knowledge including design of experiments, modelling, analysis & interpretation of data to provide valid conclusions.
(WK8).

PO5: Engineering Tool Usage: Create, select and apply appropriate techniques, resources and modern engineering & IT tools,
including prediction and modelling recognizing their limitations to solve complex engineering problems. (WK2 and WK6).

PO6: The Engineer and The World: Analyse and evaluate societal and environmental aspects while solving complex
engineering problems for its impact on sustainability with reference to economy, health, safety, legal framework, culture and
environment. (WK1, WK5, and WK7).

PO7: Ethics: Apply ethical principles and commit to professional ethics, human values, diversity and inclusion; adhere to
national & international laws. (WK9) .

2
PO8: Individual and Collaborative Team work: Function effectively as an individual, and as a member or leader in
diverse/multi-disciplinary teams.

PO9: Communication: Communicate effectively and inclusively within the engineering community and society at large, such
as being able to comprehend and write effective reports and design documentation, make effective presentations considering
cultural, language, and learning differences.

PO10: Project Management and Finance: Apply knowledge and understanding of engineering management principles and
economic decision-making and apply these to one’s own work, as a member and leader in a team, and to manage projects and in
multidisciplinary environments.

PO11: Life-Long Learning: Recognize the need for, and have the preparation and ability for i) independent and life-long
learning ii) adaptability to new and emerging technologies

PROGRAM SPECIFIC OUTCOMES


Electronics and Communication Engineering program students are:
PSO1. Able to design and analyze the basic Analog and Digital Electronic circuits.

PSO2. Able to design and analyze the spectral components of Communication Signals and systems

PSO3. Able to develop the modules in VLSI and Embedded Systems.

3
20ECV13 DIGITAL IMAGING AND COMPUTER VISION L T P C
2 0 2 3
OBJECTIVES:
 To become familiar with digital image fundamentals.
 To get exposed to simple image enhancement techniques in spatial and frequencydomain.
 To learn concepts of degradation function and Image compression techniques.
 To study the image segmentation and morphological image processing.
 To become familiar with computer vision techniques.
PRE-REQUISITE: NIL
UNIT - I INTRODUCTION 6
Components of Image Processing System - Image Sampling and Quantization - Some basicrelationships -
Neighbors - Connectivity - Distance Measures between pixels.
LAB COMPONENT
1. Write a MATLAB program for sampling and quantization.
2. Write a MATLAB program for relation between neighboring pixels and distance 6
measurement.
UNIT - II IMAGE ENHANCEMENT IN THE SPATIAL AND FREQUENCY DOMAIN 6
Image enhancement by point processing and neighbourhood processing - Basic Gray Level
Transformations - Histogram Processing - Basics of Spatial Filters - Smoothening and Sharpening - Spatial
Filters Enhancement - Frequency Domain Filtering: Smoothing and Sharpening, Homomorphic Filtering.

LAB COMPONENT
3. Write a MATLAB program for basic gray level transformations.
4. Write a MATLAB program for filtering operations 6
UNIT - III IMAGE RESTORATION AND IMAGE COMPRESSION 6
Image Restoration: Model of the Image Degradation - Noise Models - Restoration in the presence of
Noise Only Spatial Filtering - Inverse filtering - Wiener filtering.
Image Compression: Data Redundancies - Image Compression models - Lossless and Lossy compression -
Huffman Coding - Shanon-Fano Coding
LAB COMPONENT
5. Write a MATLAB program for removing various noise in degraded images.
6. Implement MATLAB program for any one of the image compression techniques. 6

UNIT - IV IMAGE SEGMENTATION AND MORPHOLOGICAL IMAGE 6


PROCESSING
Image Segmentation: Discontinuity based segmentation - similarity based segmentation -Edge linking
and boundary detection - Threshold - Region based Segmentation.
Morphological Image Processing: Dilation - Erosion - Some basic Morphological Algorithms.
LAB COMPONENT
7. Write a MATLAB program for region-based image segmentation algorithm.
8. Implement MATLAB program for basic morphological operations. 6
UNIT - V COMPUTER VISION TECHNIQUES 6
Introduction to Computer vision - Image Formation: Geometric image formation – Feature extraction and
detection - Matching - Object detection and tracking - Motion estimation - Object Modeling - video
processing.

4
LAB COMPONENT
9. Write a MATLAB program for object tracking in videos.
10. Implement MATLAB program for feature extraction and detection in images. 6

TOTAL: 60 PERIODS
TEXT BOOKS:
1. Rafael C. Gonzalez and Richard E. Woods, “Digital Image Processing”, Pearson Education, Fourth
Edition, 2018.
2. David A. Forsyth and Jean Ponce, “Computer Vision: A Modern Approach”, Prentice
Hall, 2015.
REFERENCES:
1. Anil K. Jain, “Fundamental of Digital Image Processing”, Prentice-Hall of India Pvt. Ltd., 2015.
2. W.K. Pratt, “Digital Image Processing”, A John Wiley & Sons Inc., 2007.
3. John C. Russ and F. Brent Neal, “The Image processing Handbook”, CRC Press, Seventh
Edition, 2017.
4. Wesley E. Snyder and Hairong Qi, “Fundamentals of Computer Vision”, Cambridge University
Press, First Edition, 2017.
5. Chris Solomon and Toy Breckon, “Fundamentals of Digital Image Processing: A practical
approach with examples in Matlab”, Wiley Publication, First Edition, 2010.
OUTCOMES:
AT THE END OF THE COURSE, LEARNERS WILL BE ABLE TO:

Course Name : Digital Imaging and Computer Vision


CO Course Unit PSOs
Outcomes
C321.1 Discuss how digital images are acquired, stored 2
And relationship between pixels. 1
C321.2 Illustrate image enhancement techniques in spatial 2
And frequency domain. 2
C321.3 Elaborate the mathematical modelling of image restoration 2
and compression. 3
C321.4 Describe the various image segmentation techniques. 4 2
C321.5 Illustrate the morphological image processing and algorithms. 2
4
C321.6 Discuss the fundamental concepts of Computer vision methods. 5 2
Course PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PSO1 PSO2 PSO3
Outcomes
C321.1 2 1 2 2 1
C321.2 3 2 1 2 2 2
C321.3 3 3 2 1 2 2 3
C321.4 2 1 2 2 1
C321.5 3 2 1 3 2 2 2
C321.6 2 1 2 2 2 1

5
K.L.N. COLLEGE OF ENGINEERING
POTTAPALAYAM – 630612
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

INDEX

S.NO. Date of Name of the Experiment Date of Marks Signature


Experiment Submission
1. Write a MATLAB program for sampling and
quantization.
2. Write a MATLAB program for relation between
neighboring pixels and distance measurement.
3. Write a MATLAB program for basic gray level
transformations.
4. Write a MATLAB program for filtering operations
5. Write a MATLAB program for removing various
noises in degraded images.
6. Implement MATLAB program for any one of the
image compression techniques.
7. Write a MATLAB program for region-based image
segmentation algorithm.
8. Implement MATLAB program for basic
morphological operations.
9. Write a MATLAB program for object tracking in
videos.
10. Implement MATLAB program for feature extraction
and detection in images.
INTRODUCTION
MATLAB

It is a SOFTWARE PACKAGE for high performance numerical computation and visualization. The
name MATLAB stands for MATrix LABoratory.

REALISATION

MATLAB is primarily a numerical computation Package, although with the Symbolic Toolbox it can
do symbolic algebra. MATLAB is designed to do calculations often as fast as C or FORTRAN.

ADVANTAGES OVER OTHER PACKAGES

1. Ease of use
2. Availability of built in functions
3. Ease of programming
4. Speed

HARDWARE SUPPORT

MATLAB supports almost every computational platform. In addition to PCs and Macintosh computers,
versions are available for SUN SPARC stations, HP9000 PA-RISC, IBM RS/6000, SG164 workstations, and open
VMS, among many others.

Starting MATLAB

To start MATLAB on a Microsoft Windows platform, double-click the MATLAB shortcut icon on your
Windows desktop.

USE THIS MANUAL

*A command shown as HELP topic implies that we have to type the actual name for topic in place of
topic in the command.

*Examples are carried out for almost all instructions.

MATLAB WINDOWS

1. Command Window: This is the main window. It is characterized by the MATLAB command prompt
“>>”. All commands including those for running user-written programs are typed in this window at the
MATLAB prompt.

2. Graphics or Figure window: The output of all graphics commands typed in the command window is
flushed to the graphics or Figure window. The user can create many figure windows, as the system memory will
allow.

3. Edit window: This is where we write, edit, create and save our own programs in files called “M-files’.
ON-LINE HELP

On-Line Documentation:
MAT lab provides on-line help for all its built-in functions and programming language constructs. The commands
Look For, help, helpwin and helpdisk provide on-line help.

Demo:
MATLAB has a demonstration program that shows many of its features. Type‘demo’ at the MATLAB prompt to
invoke the demonstration program and follow the instructions on the screen.
READ AND WRITE IN MATLAB

*Data Type:
The fundamental data type in MATLAB is the array. It encompasses several distinct data objects –integers,
doubles, matrices, character strings, structures and cells. There is no need to worry about Data Type or data object
declarations as real or complex.

*Dimensions:
It is Automatic in MATLAB. No Dimension statements are required for Vectors or
Arrays. We can find the dimensions of an existing matrix or a vector with the size and length commands.

*Case Sensitivity:
MATLAB is case sensitive. Thus a and A are different variables. Most MATLAB commands and built-in function
calls are typed in lower case letters. We can turn case sensitivity on or off with the ‘Case Sen’ command.

*Output Display:
A semicolon at the end of a command supports the screen output, except for Graphics and on-Line help
commands.

*Command History:
MATLAB saves previously typed commands in a buffer. These commands can be recalled with the up and down
(^) keys.

FILE TYPES

M Files: are standard ASCII text files with a.m (dot m) extension to the file name. There are two types of files:
SCRIPT file and FUNCTION file. Most programs we write in MATLAB are saved as M files. All built in
functions in MATLAB are M files.

Mat-files: are binary data files, with a.mat extension to the file name. Mat files are created by MATLAB when
we save data with the save command.

Mex files: are MATLAB-callable FORTRAN and C programs with a.mex extension to the filename. Use of these
files requires some experience with MATLAB and a lot of Patience.
GENERAL COMMANDS WE SHOULD REMEMBER:
On-Line Help
help lists topics on which help is available
help win opens the interactive help window
help desk opens the web browser based help facility
help topic provides help on topic
Look for string lists help topics containing string
Demo runs the demo program

Work space information

Who lists variables currently in the workspace


Whos lists variables currently in the workspace with their size
What lists m-, mat-, and mex-files on the disk.
Clear clears the workspace, all variables are
removed Clear x y z clears only variables x y and z.
Clear all clears all variables and functions from the
workspace mlock fun locks function fun so that clear can not
remove it munlock fun unlocks function fun so that clear can
remove it
clc clears command window, command history is lost
home same as clc
clf clears figure

window Directory information

pwd shows the current working directory


cd changes current working directory
dir lists contents of the current directory
ls lists contents of the current directory, same as dir
path gets or sets MATLAB search path
editpath modifies MATLAB search path
copyfile copies a file (MATLAB 5.2)
mkdir creates a directory (MATLAB
5.2)

General information

computer tells you the computer type you are using


clock gives you wall clock time and date as a
vector date tells you the date as a string
more controls the paged output according to the screen size
flops shows the number of floating point operations used so far
ver gives the license and the version information about MATLAB installed on your computer

Termination
^c(Control-c) local abort, kills the current command execution
quit quits MATLAB
exit same as quit
MATLAB Commands Used:
imread Read image from graphics file
imwrite Write image to graphics file
imfinfo Information about graphics file
imshow Display image
implay Play movies, videos, or image sequences
gray2ind Convert grayscale or binary image to indexed image
ind2gray Convert indexed image to grayscale image
mat2gray Convert matrix to grayscale image
rgb2gray Convert RGB image or colormap to grayscale
imbinarize Binarize image by thresholding
adapthresh Adaptive image threshold using local first-order statistics
otsuthresh Global histogram threshold using Otsu's method
im2uint16 Convert image to 16-bit unsigned integers
im2uint8 Convert image to 8-bit unsigned integers
imcrop Crop image
imresize Resize image
imrotate Rotate image
imadjust Adjust image intensity values or colormap
imcontrast Adjust Contrast tool
imsharpen Sharpen image using unsharp masking
histeq Enhance contrast using histogram equalization
adapthisteq Contrast-limited adaptive histogram equalization (CLAHE)
imhistmatch Adjust histogram of image to match N-bin histogram of reference image
imnoise Add noise to image
imfilter N-D filtering of multidimensional images
fspecial Create predefined 2-D filter
weiner2 2-D adaptive noise-removal filtering
medfilt2 2-D median filtering
ordfilt2 2-D order-statistic filtering
imfill Fill image regions and holes
imclose Morphologically close image
imdilate Dilate image
imerode Erode image
imopen Morphologically open image
imreconstruct Morphological reconstruction
watershed Watershed transform
dct2 2-D discrete cosine transform
hough Hough transform
graydist Gray-weighted distance transform of grayscale image
fft2 2-D fast Fourier transform
ifftshift Inverse FFT shift
imcomplement Complement image
immultiply Multiply two images or multiply image by constant
imsubtract Subtract one image from another or subtract constant from image
imdivide Divide one image into another or divide image by constant
imadd Add two images or add constant to image
Ex.No.: 1 Write a MATLAB program for sampling and quantization

AIM:
To perform the image sampling and quantization by using Matlab.

SOFTWARE USED:
MATLAB

THEORY:
In order to become suitable for digital processing, an image function f(x,y) must be digitized both
spatially and in amplitude. Typically, a frame grabber or digitizer is used to sample and quantize the analogue
video signal. Hence in order to create an image which is digital, we need to covert continuous data into
digital form. There are two steps in which it is done:
 Sampling
 Quantization
The sampling rate determines the spatial resolution of the digitized image, while the quantization level
determines the number of grey levels in the digitized image. A magnitude of the sampled image is expressed
as a digital value in image processing. The transition between continuous values of the image function and its
digital equivalent is called quantization.
The number of quantization levels should be high enough for human perception of fine shading details
in the image. The occurrence of false contours is the main problem in image which has been quantized with
insufficient brightness levels.

ALGORITHM:
PROGRAM:
OUTPUT:

RESULT:
Thus, sampling and quantization is performed on image using MATLAB.
Ex.No.: 2 Write a MATLAB program for relation between neighboring pixels and distance measurement.

AIM:
To find the relation between neighboring pixels and measure distance between pixels using Matlab.

SOFTWARE USED:
MATLAB

THEORY:

An image is denoted by f(x,y) and p,q are used to represent individual pixels of the image. A pixel p at
(x,y) has 4-horizontal/vertical neighbours at (x+1,y), (x-1,y), (x,y+1) and (x,y-1). These are called the 4-
neighbours of p
: N4(p). A pixel p at (x,y) has 4 diagonal neighbours at (x+1,y+1), (x+1,y-1), (x-1,y+1) and (x-1,y-1). These are
called the diagonal-neighbours of p : ND(p). The 4-neighbours and the diagonal neighbours of p are called 8-
neighbours of p : N8(p).
Euclidean Distance: De(p, q) = [(x-s)2 + (y-t)2]1/2
ALGORITHM:
PROGRAM:
OUTPUT:

RESULT:
Thus, the relation between neighboring pixels is found using MATLAB.
Ex.No.: 3 Write a MATLAB program for basic gray level transformations.

AIM:
To transform color images to gray scale image.

SOFTWARE USED:
MATLAB

THEORY:

All Image Processing Techniques focused on gray level transformation as it operates directly on pixels.
The gray level image involves 256 levels of gray and in a histogram, horizontal axis spans from 0 to 255, and the
vertical axis depends on the number of pixels in the image. There are three types of transformations namely
Linear, Logarithmic and Power – law.
Linear Transformation:
The linear transformation includes identity transformation and negative transformation. In identity
transformation, each value of the image is directly mapped to each other values of the output image. Negative
transformation is the opposite of identity transformation. Here, each value of the input image is subtracted from
L-1 and then it is mapped onto the output image
Logarithmic transformations:
Logarithmic transformation is divided into two types namely Log transformation and Inverse log
transformation
Power - Law transformations:
Power Law Transformation is of two types of transformation nth power transformation and nth root
transformation.
These transformations are used for enhancing images.

ALGORITHM:
PROGRAM:
OUTPUT:

RESULT:
Thus, the color images are transformed to gray scale image using MATLAB.
Ex.No.: 4 Write a MATLAB program for filtering operations

AIM:
To implement smoothing or averaging filter in spatial domain.

SOFTWARE USED:
MATLAB

THEORY:

Filtering is a technique for modifying or enhancing an image. Mask or filters will be defined. The general
process of convolution and correlation will be introduced via an example. Also smoothing linear filters such as
box and weighted average filters will be introduced. In statistic and image processing, to smooth a data set is to
create an approximating function that attempts to capture important patterns in the data, while leaving out noise
or other fine-scale structures/rapid phenomena. In smoothing, the data points of a signal are modified so
individual points (presumably because of noise) are reduced, and points that are lower than the adjacent points
are increased leading to a smoother signal. Smoothing may be used in two important ways that can aid in data
analysis by being able to extract more information from the data as long as the assumption of smoothing is
reasonable by being able to provide analyses that are both flexible and robust. different algorithms are used in
smoothing.

ALGORITHM:
PROGRAM:
OUTPUT:

RESULT:
Thus, the filtering operations are done in an image using MATLAB.
Ex.No.: 5 Write a MATLAB program for removing various noise in degraded images.

AIM:
To remove the noise from the given image.

SOFTWARE USED:
MATLAB

THEORY:

The method of choice for reducing noise is the spatial filtering. Different spatial filters like the arithmetic
mean filter, geometric mean filter, harmonic mean filter, contraharmonic mean filter, median filter, max filter,
min filter, midpoint filter and alpha trimmed mean filter. The different types of noises that can occur are random
noise, salt and pepper noise, salt noise, pepper noise, Gaussian noise etc. The type of filter used to remove or
reduce noise in a given noisy image depends on the noise present in the image and the image characteristic itself.
In this program we are considering an input image corrupted by 4 different noises namely salt and pepper noise,
salt noise, pepper noise and Gaussian noise. For each noise we are considering two filters and verify the
performance by calculating the rmse values. The program can be extended by including all filters for all the types
of noises.

ALGORITHM:
PROGRAM:
OUTPUT:

RESULT:
Thus, the performances of different filters have been studied for removing noises of different types using
MATLAB.
Ex.No.: 6 Implement MATLAB program for any one of the image compression techniques.

AIM:
To achieve lossless compression of the given image using MATLAB program.

SOFTWARE USED:
MATLAB

THEORY:

Image compression addresses the problem of reducing the amount of data required to represent a digital
image. Compression is achieved by removing one or three data redundancies namely coding redundancy,
spatial/temporal redundancy and irrelevant information. When coding the gray levels of an image, Huffman
codes contain the smallest possible number of code symbols (bits) per source symbol subject to the constraint
that the source symbols are coded one at a time. Huffman code generation is not in itself compression. To realize
the compression that is built into a Huffman code, the symbols for which the code was created must be mapped
in accordance with the code generated. The Huffman compression is achieved by using the function mat2huff.
Huffman encoded images are of little use unless they can be decoded to recreate the original images from which
they were derived. The decoder must compute the Huffman code used to encode and then inverse map the
encoded data to rebuild the input image. The function huff2mat is used for the purpose. The lossless predictive
coding eliminates the interpixel redundancies of closely spaced pixels by extracting and coding only the new
information in each pixel. The new information of a pixel is defined as the difference between the actual and the
predicted value of that pixel. The functions mat2lpc and lpc2mat are used to implement the lossless predictive
coding and decoding processes.

ALGORITHM:
PROGRAM:
OUTPUT:

RESULT:
Thus, the Lossless compression has been done using Huffman and Lossless Predictive coding using
MATLAB.
Ex.No.: 7 Write a MATLAB program for region-based image segmentation algorithm.

AIM:
To perform region based segmentation of image using Matlab.

SOFTWARE USED:
MATLAB

THEORY:
Thresholding is the simplest method of image segmentation. From a grayscale image, thresholding can
be used to create binary images. Thresholding is used to extract an object from its background by assigning
an intensity value T (threshold) for each pixel such that each pixel is either classified as an object point or a
background point.
In general T = T[x, y, p(x, y), f (x, y)]
If T is a function of f(x, y) only – Global thresholding
If T is a function of both f(x, y) and local properties p(x, y) – Local thresholdingIf T depends
on the coordinates (x, y) – Dynamic/adaptive thresholding
Image thresholding classifies pixels into two categories. Those to which some property measured from the
image falls below a threshold and those at which the property equals or exceeds a threshold.
In fixed (or global) thresholding, the threshold value is held constant throughout the image.
Determine a single threshold value by treating each pixel independently of its neighborhood.
Global Thresholding is done when the modes of histogram can be clearly distinguished.
Each mode represents either the background or an object
ALGORITHM:
PROGRAM:
OUTPUT:
RESULT:
Thus, region based segmentation algorithm is performed using MATLAB.
Ex.No.: 8 Implement MATLAB program for basic morphological operations.

AIM:
To perform morphological operations such as erosion and dilation in an image.

SOFTWARE USED:
MATLAB

THEORY:

Erosion (usually represented by ⊖) is one of two fundamental operations (the other being dilation) in
morphological image processing from which all other morphological operations are based. It was originally
defined for binary images, later being extended to grayscale images, and subsequently to complete lattices. With
A and B as two sets in Z2 (2D integer space), the dilation of A and B is defined as A(+)B={Z|(B )Z∩A ≠ ф} ˆ
In the above example, A is the image while B is called a structuring element. In the equation,(B )Z simply means
ta ˆ king the reflections of B about its origin and shifting it by Z. Hence dilation of A with B is a set of all
displacements, Z, such that (B ˆ)Z and A overlap by at least one element. Flipping of B about the origin and then
moving it past image A is analogous to the convolution process. In practice flipping of B is not done always.
Dilation adds pixels to the boundaries of object in an image. The number of pixels added depends on the size and
shape of the structuring element. Based on this definition, dilation can be defined as A(+)B={{Z|(B )Z∩A} ε A}
ˆ

ALGORITHM:
PROGRAM:
OUTPUT:

RESULT:
Thus, the basic morphological operations are implemented using MATLAB.
SOFTWARE USED:
MATLAB

THEORY:

Object tracking is a computer vision application where a program detects the objects and then tracks
their movements in space or across different camera angles. Object tracking can identify and follow multiple
objects in an image. For example, a football recording studio could follow where a ball is in a photo. Object
tracking is a significant computer vision technology popular in augmented reality for estimating or predicting the
positions and other applicable information of moving objects in real time.

ALGORITHM:
Ex.No.: 9 Write a MATLAB program for object tracking in videos.

AIM:
To track an object in a video.
PROGRAM:
OUTPUT:
RESULT:
Thus, an object is tracked in a video using MATLAB.
Ex.No.: 10 Implement MATLAB program for feature extraction and detection in images.

AIM:
To implement a MATLAB program for feature extraction and detection in images.

SOFTWARE USED:
MATLAB

THEORY:
Feature extraction is a part of the dimensionality reduction process, in which, an initial set of the raw data
is divided and reduced to more manageable groups. So when you want to process it will be easier. The most
important characteristic of these large data sets is that they have a large number of variables. These variables
require a lot of computing resources to process. So Feature extraction helps to get the best feature from those big
data sets by selecting and combining variables into features, thus, effectively reducing the amount of data. These
features are easy to process, but still able to describe the actual data set with accuracy and originality.

ALGORITHM
::
PROGRAM:
OUTPUT:

RESULT:
Thus, feature extraction and detection in images is implemented using MATLAB.

You might also like