This document discusses various image analysis techniques in MATLAB, including image enhancement methods, median filtering, thresholding, segmentation, feature extraction using gray-level co-occurrence matrix (GLCM), and classification. Median filtering and thresholding are introduced as common image processing steps. Texture analysis using GLCM statistics and supervised classification algorithms like decision trees and neural networks are also summarized. Code examples are provided to demonstrate performing steps like feature extraction, classification training and accuracy calculation on an image dataset.
2. IMAGE ANALYSIS
• Image analysis methods extract information from an image by using automatic ,
such as:
• scene analysis
• image description
• image understanding
• pattern recognition
3. I m a g e a n a l y s i s t e c h n i q u e
Feature description Segmentation Classification
Spatial features
Transform features
Edges and boundaries
Shape features
Moments
Texture
Thresholding
Boundary based segm.
Region based segm.
Template matching
Texture segmentation
Clustering
Statistical classif.
Decision trees
Neural networks
Similarity measures
2 1 3
9
4. ENHANCEMENT METHODS IN IMAGE PROCESSING
• Image enhancement is the process of adjusting digital images so that the results are more suitable for display or further image analysis. For example, can remove noise, sharpen, or
brighten an image, making it easier to identify key features.
• Here are some useful examples and methods of image enhancement:
• Filtering with morphological operators
• Histogram equalization
• Noise removal using a Wiener filter
• Linear contrast adjustment
• Median filtering
• Unsharp mask filtering
• Contrast-limited adaptive histogram equalization (CLAHE)
• Decorrelation stretch
5. MEDIAN FILTER
• The median filter is normally used to reduce noise in an image,
• How It Works Like the mean filter, the median filter considers each pixel in the image
in turn and looks at its nearby neighbors to decide whether or not it is representative
of its surroundings.
• Instead of simply replacing the pixel value with the mean of neighboring pixel values,
it replaces it with the median of those values.
• The median is calculated by first sorting all the pixel values from the surrounding
neighborhood into numerical order and then replacing the pixel being considered
with the middle pixel value.
7. SEGMENTATION
•Image segmentation is a key step in image analysis.
• Segmentation subdivides an image into its components.
• The segmentation operation only subdivides an image;
8. Amplitude thresholding (i.e. in the brightness domain)
is the basis approach to image segmentation.
A threshold T is selected a that would separate the two
modes, i.e. any image point for which f(x,y)>T is
considered as an object; otherwise, the point is called a
background point.
The thresholded image (binary image) is defined by:
0 for f (x, y) T
g(x, y)
1 for f (x, y) T
THRESHOLDING
10. FEATURE EXTRACTION
• Feature plays a very important role in the area of image processing.
• feature extraction techniques are applied to get features that will be useful in
classifying and recognition of images
• A statistical method of examining texture that considers the spatial relationship of
pixels is the gray-level co-occurrence matrix (GLCM),
• The GLCM functions characterize the texture of an image by calculating how
often pairs of pixel with specific values and then extracting statistical measures
from this matrix.
11. TEXTURE ANALYSIS USING THE GRAY-LEVEL CO-OCCURRENCE
MATRIX (GLCM)
Statistic Description
Contrast Measures the local variations in the gray-level co-occurrence matrix.
Correlation Measures the joint probability occurrence of the specified pixel pairs.
Energy Provides the sum of squared elements in the GLCM. Also known as
uniformity or the angular second moment.
Homogeneity Measures the closeness of the distribution of elements in the GLCM to
the GLCM diagonal.
12. CLASSIFICATION
• Supervised and semi-supervised learning algorithms for binary and multiclass problems
• Classification is a type of supervised machine learning in which an algorithm
“learns” to classify new observations from examples of labeled data.
• To explore classification models interactively, use the Classification Learner app.
For greater flexibility
• can pass predictor or feature data with corresponding responses or labels to an
algorithm-fitting function in the command-line interface.
13. • Fitctree Fit binary decision tree for multiclass classification
• fitcknn Fit k-nearest neighbor classifier
• Fitcsvm Train support vector machine (SVM) classifier for one-class and binary
classification
• Fitnet Function fitting neural network
CLASSIFICATION TECHNIQUE IN MATLAB
14. MATALB CODE
• clc;clear all;close all;
• %% step1: read image by image
• imagefiles = dir('normal/*.bmp');
• nfiles = length(imagefiles); % Number of files found
• t=[];
• for ii=1:nfiles
• currentfilename = [imagefiles(ii).folder ''
imagefiles(ii).name];
• currentimage = imread(currentfilename );
• images_Normal_medain = medfilt2(currentimage);%
enhancent
•
images_Normal_SEG=im2bw(images_Normal_medain,0.5);%segmn
etataion
• feature_normal(ii,:) = get_feature(
images_Normal_SEG);% feauter
• t=[t; 1];
• end
• imagefiles = dir('abnormal/*.bmp');
• nfiles = length(imagefiles); % Number of files found