SlideShare a Scribd company logo
1 of 34
Dr.S.SHAJUN NISHA, MCA.,M.Phil.,M.Tech.,MBA.,Ph.D
Assistant Professor & Head
PG & Research Dept. of Computer Science
Sadakathullah Appa College
shajunnisha_s@yahoo.com
+91 99420 96220
INTENSITY TRANSFORMATION
& SPATIAL FILTERING
Introduction
 Spatial domain
Refers to the image plane itself
Image processing methods are based and directly
applied to image pixels
 Two principle categories of spatial processing:
Intensity transformation
Spatial filtering
=Input image
= Output image
= Operator defined
over a neighbourhood
Spatial domain processes are denoted by
• Process of small window operation are called spatial filtering
Intensity Transformation Functions
 The simplest form of the transformation T is applied on 1x1 (a
single pixel)
 The value of g at (x,y) depends only on the intensity of f at that
point, and T becomes an intensity or gray-level transformation
function.
 Simplified form as
s = T(r)
 where r denotes the intensity of f and s the intensity of g, both
at any corresponding point (x,y) in the images.
Function imadjust
 Function imadjust is the basic IPT tool for intensity
transformations of grayscale images.
Syntax
 g = imadjust(f, [low_in high_in], [low_out high_out],
gamma)
Functions imadjust and stretchlim
Command
 g1 = imadjust(f, [0 1], [1 0]);
Input Output
 g = imcomplement(f) can also be used to obtain the above
output
g2 = imadjust(f, [0.5 0.75], [0 1]);
Result of expanding the intensity range [0.5, 0.75].
g3 = imadjust(f, [ ], [ ], 2);
f=imread('cameraman.tif');
figure,imshow(f);
g1 = imadjust(f, [0 1], [1 0]);
figure,imshow(g1);
g2 = imadjust(f, [0 1], [1 0], 0.5);
figure,imshow(g2);
g3 = imadjust(f, [0 1], [1 0], 1);
figure,imshow(g3);
g4 = imadjust(f, [0 1], [1 0], 2);
figure,imshow(g4);
g5 = imadjust(f, [0.5 0.75], [0 1]);
figure,imshow(g5);
g6 = imadjust(f, [0.5 0.75], [0 1], 0.5);
figure,imshow(g6);
imhist(f);
Logarithmic and Contrast-Stretching Transformations
 Logarithmic and contrast-stretching transformations are basic tools for
dynamic range manipulation.
 Logarithm transformations are implemented using the expression
g = c*log(1 + double(f))
 where c is a constant.
 The shape of this transformation is similar to the gamma curve with the
low values set at 0 and the high values set to 1 on both scales. Note,
however, that the shape of the gamma curve is variable,
 whereas the shape of the log function is fixed.
 Contrast-Stretching has the form
 where r represents the intensities of the input image, s the
corresponding intensity values in the output image, and E
controls the slope of the function.
 This equation is implemented in MATLAB for an entire image
as
g = 1./(1 + (m./f).^E)
Example using Log transformation to reduce dynamic range
g = im2uint8(mat2gray(log(1 + double(f))));
imshow(g)
HISTOGRAM PROCESSING & FUNCTION PLOTTING
Intensity transformation functions based on
information extracted from image intensity histograms
play a basic role in image processing, in areas such as
enhancement, compression, segmentation, and
description.
It includes histogram, histogram equalization,
histogram matching, contrast limited adaptive
histogram equalization,
 The focus of this section is on obtaining, plotting, and
using histograms for image enhancement.
Generating and Plotting Image Histograms
 The histogram of a digital image with L total possible intensity
levels in the range [0,G] is defined as the discrete function
 where is the k th intensity level in the interval [0, G] and
is the number of pixels in the image whose intensity level is
 it is useful to work with normalized histograms, obtained
simply by dividing all elements of by the total number of
pixels in the image, which we denote by n:
 The core function in the toolbox for dealing with image histograms
is imhist, which has the following basic syntax:
h = imhist(f, b)
 the normalized histogram simply by using the expression
p = imhist(f, b)/numel(f)
 numel(f) gives the number of elements in array f (i.e., the number
of pixels in the image), b is the number of bins used in forming the
histogram (if b is not included in the argument, b = 256 is used by
default). A bin is simply a subdivision of the intensity scale.
 Histograms often are plotted using bar graphs. For this purpose we
can use the function
 bar(horz, v, width)
 imhist(f)
• A stem graph is similar to a bar graph.
•The syntax is
stem(horz, v, 'color_linestyle_marker', 'fill')
where v is row vector containing the points to be plotted, and
horz is as described for bar.
>> f=imread('cameraman.tif');
>>h = imhist(f);
>> h1 = h(1:10:256);
>> horz = 1:10:256;
>> stem(horz, h1, 'fill')
>> axis([0 255 0 15000])
>> set(gca, 'xtick', [0:50:255])
>> set(gca, 'ytick', [0:2000:15000])
Histogram Equalization
• Intensity levels are continuous quantities normalized to the range
[0, 1],
•let denote the probability density function (PDF) of the
intensity levels in a given image,
• Suppose that we perform the following transformation on the
input levels to obtain output (processed) intensity levels, s,
where is a dummy variable of integration ,then PDF of intensity levels in
an output image will be
• When dealing with discrete quantities we work with histograms
and call the preceding technique histogram equalization
• Let denote the histogram associated with
the intensity levels of a given image, and recall that the values in
a normalized histogram are approximations to the probability of
occurrence of each intensity level in the image. For discrete
quantities we work with summations, and the equalization
transformation becomes
For k=1,2,…..L where is the intensity value in the output
(processed) image corresponding to value in the input image.
Histogram Equalization
 Histogram equalization is implemented in the toolbox by
function histeq,which has the syntax
 g = histeq(f, nlev)
 where f is the input image and nlev is the number of intensity
levels specified for the output image.
>> imshow(f)
>> figure, imhist(f)
>> g = histeq(f, 256);
>> figure, imshow(g)
>> figure, imhist(g)
Histogram Matching (Specification)
The toolbox implements histogram matching using the following
syntax in
histeq:
g = histeq(f, hspec)
>> f1 = histeq(f, 256);
Spatial Filtering
Neighborhood processing consists of
(1) defining a center point,
(2) performing an operation that involves only the pixels in a
predefined neighborhood about that center point;
(3) letting the result of that operation be the “response” of the
process at that point; and
(4) repeating the process for every point in the image.
The process of moving the center point creates new
neighborhoods, one for each pixel in the input image
• The two principal terms used to identify this operation are
neighborhood processing and spatial filtering, with the second
term being more prevalent.
• If the computations performed on the pixels of the
neighborhoods are linear, the operation is called linear spatial
filtering (the term spatial convolution also used); otherwise it
is called nonlinear spatial filtering.
Linear Spatial Filtering
The toolbox implements linear spatial filtering using function
imfilter,
which has the following syntax:
g = imfilter(f, w, filtering_mode, boundary_options,
size_options)
The most common syntax for imfilter is
g = imfilter(f, w, 'replicate')
f = imread('peppers.png');
figure,imshow(f)
w=[256 256];
g = imfilter(f, w, 'symmetric')
figure, imshow(g)
Standard Linear Spatial Filters:
Syntax:
W=fspecial(‘type’, parameters)
Eg:
originalRGB = imread('peppers.png’);
imshow(originalRGB)
h = fspecial('motion', 50, 45);
filteredRGB = imfilter(originalRGB, h);
figure, imshow(filteredRGB)
Non liner spatial Filtering
Syntax
fp = padarray(f, [r c], method, direction)
Eg 1:
f=imread('peppers.png');
fp=padarray(f, [312 312], 'replicate', 'post')
figure,imshow(f);
figure,imshow(fp);
Eg 2:
>> fp = padarray(f, [3 2], 'replicate', 'post')
Standard Non Linear Spatial Filters:
The syntax of function ordfilt2 is
g = ordfilt2(f, order, domain)
to implement a min filter (order 1) of size mxn we use the syntax
g = ordfilt2(f, 1, ones(m, n))
Eg:
>> fn = imnoise(f, 'salt & pepper', 0.2);
>> gm = medfilt2(fn);
>> gms = medfilt2(fn, 'symmetric');

More Related Content

What's hot

Region based segmentation
Region based segmentationRegion based segmentation
Region based segmentationramya marichamy
 
Image Filtering in the Frequency Domain
Image Filtering in the Frequency DomainImage Filtering in the Frequency Domain
Image Filtering in the Frequency DomainAmnaakhaan
 
Introduction to Image Compression
Introduction to Image CompressionIntroduction to Image Compression
Introduction to Image CompressionKalyan Acharjya
 
Digital Image Processing: Image Segmentation
Digital Image Processing: Image SegmentationDigital Image Processing: Image Segmentation
Digital Image Processing: Image SegmentationMostafa G. M. Mostafa
 
Interpixel redundancy
Interpixel redundancyInterpixel redundancy
Interpixel redundancyNaveen Kumar
 
Image compression in digital image processing
Image compression in digital image processingImage compression in digital image processing
Image compression in digital image processingDHIVYADEVAKI
 
Color Image Processing
Color Image ProcessingColor Image Processing
Color Image Processingkiruthiammu
 
Chapter 9 morphological image processing
Chapter 9 morphological image processingChapter 9 morphological image processing
Chapter 9 morphological image processingasodariyabhavesh
 
digital image processing
digital image processingdigital image processing
digital image processingAbinaya B
 
Digital Image Processing: Digital Image Fundamentals
Digital Image Processing: Digital Image FundamentalsDigital Image Processing: Digital Image Fundamentals
Digital Image Processing: Digital Image FundamentalsMostafa G. M. Mostafa
 
SPATIAL FILTERING IN IMAGE PROCESSING
SPATIAL FILTERING IN IMAGE PROCESSINGSPATIAL FILTERING IN IMAGE PROCESSING
SPATIAL FILTERING IN IMAGE PROCESSINGmuthu181188
 
Image processing second unit Notes
Image processing second unit NotesImage processing second unit Notes
Image processing second unit NotesAAKANKSHA JAIN
 
Noise filtering
Noise filteringNoise filtering
Noise filteringAlaa Ahmed
 
Image restoration and degradation model
Image restoration and degradation modelImage restoration and degradation model
Image restoration and degradation modelAnupriyaDurai
 
ImageProcessing10-Segmentation(Thresholding) (1).ppt
ImageProcessing10-Segmentation(Thresholding) (1).pptImageProcessing10-Segmentation(Thresholding) (1).ppt
ImageProcessing10-Segmentation(Thresholding) (1).pptVikramBarapatre2
 

What's hot (20)

Region based segmentation
Region based segmentationRegion based segmentation
Region based segmentation
 
Image Filtering in the Frequency Domain
Image Filtering in the Frequency DomainImage Filtering in the Frequency Domain
Image Filtering in the Frequency Domain
 
Introduction to Image Compression
Introduction to Image CompressionIntroduction to Image Compression
Introduction to Image Compression
 
Digital Image Processing: Image Segmentation
Digital Image Processing: Image SegmentationDigital Image Processing: Image Segmentation
Digital Image Processing: Image Segmentation
 
Psuedo color
Psuedo colorPsuedo color
Psuedo color
 
Image compression .
Image compression .Image compression .
Image compression .
 
Data Redundacy
Data RedundacyData Redundacy
Data Redundacy
 
Interpixel redundancy
Interpixel redundancyInterpixel redundancy
Interpixel redundancy
 
Color image processing
Color image processingColor image processing
Color image processing
 
Image compression in digital image processing
Image compression in digital image processingImage compression in digital image processing
Image compression in digital image processing
 
Color Image Processing
Color Image ProcessingColor Image Processing
Color Image Processing
 
Chapter 9 morphological image processing
Chapter 9 morphological image processingChapter 9 morphological image processing
Chapter 9 morphological image processing
 
digital image processing
digital image processingdigital image processing
digital image processing
 
Digital Image Processing: Digital Image Fundamentals
Digital Image Processing: Digital Image FundamentalsDigital Image Processing: Digital Image Fundamentals
Digital Image Processing: Digital Image Fundamentals
 
SPATIAL FILTERING IN IMAGE PROCESSING
SPATIAL FILTERING IN IMAGE PROCESSINGSPATIAL FILTERING IN IMAGE PROCESSING
SPATIAL FILTERING IN IMAGE PROCESSING
 
Image processing second unit Notes
Image processing second unit NotesImage processing second unit Notes
Image processing second unit Notes
 
Noise filtering
Noise filteringNoise filtering
Noise filtering
 
Image restoration and degradation model
Image restoration and degradation modelImage restoration and degradation model
Image restoration and degradation model
 
Digital Image Processing
Digital Image ProcessingDigital Image Processing
Digital Image Processing
 
ImageProcessing10-Segmentation(Thresholding) (1).ppt
ImageProcessing10-Segmentation(Thresholding) (1).pptImageProcessing10-Segmentation(Thresholding) (1).ppt
ImageProcessing10-Segmentation(Thresholding) (1).ppt
 

Similar to Intensity Transformation and Spatial filtering

3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slides3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slidesBHAGYAPRASADBUGGE
 
Image processing
Image processingImage processing
Image processingmaheshpene
 
Image Enhancement in Spatial Domain
Image Enhancement in Spatial DomainImage Enhancement in Spatial Domain
Image Enhancement in Spatial DomainDEEPASHRI HK
 
Digital Image Processing_ ch2 enhancement spatial-domain
Digital Image Processing_ ch2 enhancement spatial-domainDigital Image Processing_ ch2 enhancement spatial-domain
Digital Image Processing_ ch2 enhancement spatial-domainMalik obeisat
 
Image Enhancement - Point Processing
Image Enhancement - Point ProcessingImage Enhancement - Point Processing
Image Enhancement - Point ProcessingGayathri31093
 
image processing intensity transformation
image processing intensity transformationimage processing intensity transformation
image processing intensity transformationalobaidimki
 
Study on Contrast Enhancement with the help of Associate Regions Histogram Eq...
Study on Contrast Enhancement with the help of Associate Regions Histogram Eq...Study on Contrast Enhancement with the help of Associate Regions Histogram Eq...
Study on Contrast Enhancement with the help of Associate Regions Histogram Eq...IJSRD
 
Lec_3_Image Enhancement_spatial Domain.pdf
Lec_3_Image Enhancement_spatial Domain.pdfLec_3_Image Enhancement_spatial Domain.pdf
Lec_3_Image Enhancement_spatial Domain.pdfnagwaAboElenein
 
Digital image processing - Image Enhancement (MATERIAL)
Digital image processing  - Image Enhancement (MATERIAL)Digital image processing  - Image Enhancement (MATERIAL)
Digital image processing - Image Enhancement (MATERIAL)Mathankumar S
 
Digital Image Processing - Image Enhancement
Digital Image Processing  - Image EnhancementDigital Image Processing  - Image Enhancement
Digital Image Processing - Image EnhancementMathankumar S
 
Image enhancement
Image enhancementImage enhancement
Image enhancementKuppusamy P
 
image_enhancement_spatial
 image_enhancement_spatial image_enhancement_spatial
image_enhancement_spatialhoneyjecrc
 
Image enhancement ppt nal2
Image enhancement ppt nal2Image enhancement ppt nal2
Image enhancement ppt nal2Surabhi Ks
 
Image-Processing-ch3-part-3.pdf
Image-Processing-ch3-part-3.pdfImage-Processing-ch3-part-3.pdf
Image-Processing-ch3-part-3.pdfASMZahidKausar
 

Similar to Intensity Transformation and Spatial filtering (20)

Gonzalez, rafael,c.digitalimageprocessingusing matlab
Gonzalez, rafael,c.digitalimageprocessingusing matlabGonzalez, rafael,c.digitalimageprocessingusing matlab
Gonzalez, rafael,c.digitalimageprocessingusing matlab
 
3rd unit.pptx
3rd unit.pptx3rd unit.pptx
3rd unit.pptx
 
3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slides3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slides
 
Image processing
Image processingImage processing
Image processing
 
Image Enhancement in Spatial Domain
Image Enhancement in Spatial DomainImage Enhancement in Spatial Domain
Image Enhancement in Spatial Domain
 
Digital Image Processing_ ch2 enhancement spatial-domain
Digital Image Processing_ ch2 enhancement spatial-domainDigital Image Processing_ ch2 enhancement spatial-domain
Digital Image Processing_ ch2 enhancement spatial-domain
 
Image Enhancement - Point Processing
Image Enhancement - Point ProcessingImage Enhancement - Point Processing
Image Enhancement - Point Processing
 
image processing intensity transformation
image processing intensity transformationimage processing intensity transformation
image processing intensity transformation
 
Study on Contrast Enhancement with the help of Associate Regions Histogram Eq...
Study on Contrast Enhancement with the help of Associate Regions Histogram Eq...Study on Contrast Enhancement with the help of Associate Regions Histogram Eq...
Study on Contrast Enhancement with the help of Associate Regions Histogram Eq...
 
Lec_3_Image Enhancement_spatial Domain.pdf
Lec_3_Image Enhancement_spatial Domain.pdfLec_3_Image Enhancement_spatial Domain.pdf
Lec_3_Image Enhancement_spatial Domain.pdf
 
Digital image processing - Image Enhancement (MATERIAL)
Digital image processing  - Image Enhancement (MATERIAL)Digital image processing  - Image Enhancement (MATERIAL)
Digital image processing - Image Enhancement (MATERIAL)
 
Digital Image Processing - Image Enhancement
Digital Image Processing  - Image EnhancementDigital Image Processing  - Image Enhancement
Digital Image Processing - Image Enhancement
 
4 image enhancement in spatial domain
4 image enhancement in spatial domain4 image enhancement in spatial domain
4 image enhancement in spatial domain
 
Image enhancement
Image enhancementImage enhancement
Image enhancement
 
image enhancement
 image enhancement image enhancement
image enhancement
 
DIP Lecture 7-9.pdf
DIP Lecture 7-9.pdfDIP Lecture 7-9.pdf
DIP Lecture 7-9.pdf
 
image_enhancement_spatial
 image_enhancement_spatial image_enhancement_spatial
image_enhancement_spatial
 
Image enhancement ppt nal2
Image enhancement ppt nal2Image enhancement ppt nal2
Image enhancement ppt nal2
 
Point Processing
Point ProcessingPoint Processing
Point Processing
 
Image-Processing-ch3-part-3.pdf
Image-Processing-ch3-part-3.pdfImage-Processing-ch3-part-3.pdf
Image-Processing-ch3-part-3.pdf
 

More from Shajun Nisha

Google meet and its extensions sac
Google meet and its extensions sacGoogle meet and its extensions sac
Google meet and its extensions sacShajun Nisha
 
Dip fundamentals 2
Dip fundamentals 2Dip fundamentals 2
Dip fundamentals 2Shajun Nisha
 
Dip digital image 3
Dip digital image 3Dip digital image 3
Dip digital image 3Shajun Nisha
 
25 environmental ethics intellectual property rights
25 environmental ethics intellectual property rights25 environmental ethics intellectual property rights
25 environmental ethics intellectual property rightsShajun Nisha
 
Linear regression in machine learning
Linear regression in machine learningLinear regression in machine learning
Linear regression in machine learningShajun Nisha
 
Basics of research in research methodology
Basics of research in research methodologyBasics of research in research methodology
Basics of research in research methodologyShajun Nisha
 
Auto encoders in Deep Learning
Auto encoders in Deep LearningAuto encoders in Deep Learning
Auto encoders in Deep LearningShajun Nisha
 
Teaching Aptitude in Research Methodology
Teaching Aptitude in Research MethodologyTeaching Aptitude in Research Methodology
Teaching Aptitude in Research MethodologyShajun Nisha
 
Perceptron and Sigmoid Neurons
Perceptron and Sigmoid NeuronsPerceptron and Sigmoid Neurons
Perceptron and Sigmoid NeuronsShajun Nisha
 
Mc Culloch Pitts Neuron
Mc Culloch Pitts NeuronMc Culloch Pitts Neuron
Mc Culloch Pitts NeuronShajun Nisha
 
Image Restoration (Digital Image Processing)
Image Restoration (Digital Image Processing)Image Restoration (Digital Image Processing)
Image Restoration (Digital Image Processing)Shajun Nisha
 
ESTIMATING NOISE PARAMETER & FILTERING (Digital Image Processing)
ESTIMATING NOISE PARAMETER & FILTERING (Digital Image Processing)ESTIMATING NOISE PARAMETER & FILTERING (Digital Image Processing)
ESTIMATING NOISE PARAMETER & FILTERING (Digital Image Processing)Shajun Nisha
 
Image processing lab work
Image processing lab workImage processing lab work
Image processing lab workShajun Nisha
 
introduction to cloud computing
 introduction to cloud computing introduction to cloud computing
introduction to cloud computingShajun Nisha
 
online learning NPTEL
online learning NPTELonline learning NPTEL
online learning NPTELShajun Nisha
 

More from Shajun Nisha (18)

Google meet and its extensions sac
Google meet and its extensions sacGoogle meet and its extensions sac
Google meet and its extensions sac
 
Dip syntax 4
Dip syntax 4Dip syntax 4
Dip syntax 4
 
Dip fundamentals 2
Dip fundamentals 2Dip fundamentals 2
Dip fundamentals 2
 
Dip application 1
Dip application 1Dip application 1
Dip application 1
 
Dip digital image 3
Dip digital image 3Dip digital image 3
Dip digital image 3
 
ICT tools
ICT  toolsICT  tools
ICT tools
 
25 environmental ethics intellectual property rights
25 environmental ethics intellectual property rights25 environmental ethics intellectual property rights
25 environmental ethics intellectual property rights
 
Linear regression in machine learning
Linear regression in machine learningLinear regression in machine learning
Linear regression in machine learning
 
Basics of research in research methodology
Basics of research in research methodologyBasics of research in research methodology
Basics of research in research methodology
 
Auto encoders in Deep Learning
Auto encoders in Deep LearningAuto encoders in Deep Learning
Auto encoders in Deep Learning
 
Teaching Aptitude in Research Methodology
Teaching Aptitude in Research MethodologyTeaching Aptitude in Research Methodology
Teaching Aptitude in Research Methodology
 
Perceptron and Sigmoid Neurons
Perceptron and Sigmoid NeuronsPerceptron and Sigmoid Neurons
Perceptron and Sigmoid Neurons
 
Mc Culloch Pitts Neuron
Mc Culloch Pitts NeuronMc Culloch Pitts Neuron
Mc Culloch Pitts Neuron
 
Image Restoration (Digital Image Processing)
Image Restoration (Digital Image Processing)Image Restoration (Digital Image Processing)
Image Restoration (Digital Image Processing)
 
ESTIMATING NOISE PARAMETER & FILTERING (Digital Image Processing)
ESTIMATING NOISE PARAMETER & FILTERING (Digital Image Processing)ESTIMATING NOISE PARAMETER & FILTERING (Digital Image Processing)
ESTIMATING NOISE PARAMETER & FILTERING (Digital Image Processing)
 
Image processing lab work
Image processing lab workImage processing lab work
Image processing lab work
 
introduction to cloud computing
 introduction to cloud computing introduction to cloud computing
introduction to cloud computing
 
online learning NPTEL
online learning NPTELonline learning NPTEL
online learning NPTEL
 

Recently uploaded

Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........LeaCamillePacle
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationAadityaSharma884161
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
Planning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxPlanning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxLigayaBacuel1
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 

Recently uploaded (20)

Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint Presentation
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
Planning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxPlanning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptx
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 

Intensity Transformation and Spatial filtering

  • 1. Dr.S.SHAJUN NISHA, MCA.,M.Phil.,M.Tech.,MBA.,Ph.D Assistant Professor & Head PG & Research Dept. of Computer Science Sadakathullah Appa College shajunnisha_s@yahoo.com +91 99420 96220 INTENSITY TRANSFORMATION & SPATIAL FILTERING
  • 2. Introduction  Spatial domain Refers to the image plane itself Image processing methods are based and directly applied to image pixels  Two principle categories of spatial processing: Intensity transformation Spatial filtering
  • 3. =Input image = Output image = Operator defined over a neighbourhood Spatial domain processes are denoted by • Process of small window operation are called spatial filtering
  • 4. Intensity Transformation Functions  The simplest form of the transformation T is applied on 1x1 (a single pixel)  The value of g at (x,y) depends only on the intensity of f at that point, and T becomes an intensity or gray-level transformation function.  Simplified form as s = T(r)  where r denotes the intensity of f and s the intensity of g, both at any corresponding point (x,y) in the images.
  • 5. Function imadjust  Function imadjust is the basic IPT tool for intensity transformations of grayscale images. Syntax  g = imadjust(f, [low_in high_in], [low_out high_out], gamma)
  • 6. Functions imadjust and stretchlim Command  g1 = imadjust(f, [0 1], [1 0]); Input Output  g = imcomplement(f) can also be used to obtain the above output
  • 7. g2 = imadjust(f, [0.5 0.75], [0 1]); Result of expanding the intensity range [0.5, 0.75]. g3 = imadjust(f, [ ], [ ], 2);
  • 8. f=imread('cameraman.tif'); figure,imshow(f); g1 = imadjust(f, [0 1], [1 0]); figure,imshow(g1); g2 = imadjust(f, [0 1], [1 0], 0.5); figure,imshow(g2); g3 = imadjust(f, [0 1], [1 0], 1); figure,imshow(g3); g4 = imadjust(f, [0 1], [1 0], 2); figure,imshow(g4); g5 = imadjust(f, [0.5 0.75], [0 1]); figure,imshow(g5); g6 = imadjust(f, [0.5 0.75], [0 1], 0.5); figure,imshow(g6); imhist(f);
  • 9. Logarithmic and Contrast-Stretching Transformations  Logarithmic and contrast-stretching transformations are basic tools for dynamic range manipulation.  Logarithm transformations are implemented using the expression g = c*log(1 + double(f))  where c is a constant.  The shape of this transformation is similar to the gamma curve with the low values set at 0 and the high values set to 1 on both scales. Note, however, that the shape of the gamma curve is variable,  whereas the shape of the log function is fixed.
  • 10.
  • 11.  Contrast-Stretching has the form  where r represents the intensities of the input image, s the corresponding intensity values in the output image, and E controls the slope of the function.  This equation is implemented in MATLAB for an entire image as g = 1./(1 + (m./f).^E)
  • 12. Example using Log transformation to reduce dynamic range g = im2uint8(mat2gray(log(1 + double(f)))); imshow(g)
  • 13. HISTOGRAM PROCESSING & FUNCTION PLOTTING Intensity transformation functions based on information extracted from image intensity histograms play a basic role in image processing, in areas such as enhancement, compression, segmentation, and description. It includes histogram, histogram equalization, histogram matching, contrast limited adaptive histogram equalization,  The focus of this section is on obtaining, plotting, and using histograms for image enhancement.
  • 14. Generating and Plotting Image Histograms  The histogram of a digital image with L total possible intensity levels in the range [0,G] is defined as the discrete function  where is the k th intensity level in the interval [0, G] and is the number of pixels in the image whose intensity level is  it is useful to work with normalized histograms, obtained simply by dividing all elements of by the total number of pixels in the image, which we denote by n:
  • 15.  The core function in the toolbox for dealing with image histograms is imhist, which has the following basic syntax: h = imhist(f, b)  the normalized histogram simply by using the expression p = imhist(f, b)/numel(f)  numel(f) gives the number of elements in array f (i.e., the number of pixels in the image), b is the number of bins used in forming the histogram (if b is not included in the argument, b = 256 is used by default). A bin is simply a subdivision of the intensity scale.  Histograms often are plotted using bar graphs. For this purpose we can use the function  bar(horz, v, width)  imhist(f)
  • 16. • A stem graph is similar to a bar graph. •The syntax is stem(horz, v, 'color_linestyle_marker', 'fill') where v is row vector containing the points to be plotted, and horz is as described for bar.
  • 17. >> f=imread('cameraman.tif'); >>h = imhist(f); >> h1 = h(1:10:256); >> horz = 1:10:256; >> stem(horz, h1, 'fill') >> axis([0 255 0 15000]) >> set(gca, 'xtick', [0:50:255]) >> set(gca, 'ytick', [0:2000:15000])
  • 18. Histogram Equalization • Intensity levels are continuous quantities normalized to the range [0, 1], •let denote the probability density function (PDF) of the intensity levels in a given image, • Suppose that we perform the following transformation on the input levels to obtain output (processed) intensity levels, s, where is a dummy variable of integration ,then PDF of intensity levels in an output image will be
  • 19. • When dealing with discrete quantities we work with histograms and call the preceding technique histogram equalization • Let denote the histogram associated with the intensity levels of a given image, and recall that the values in a normalized histogram are approximations to the probability of occurrence of each intensity level in the image. For discrete quantities we work with summations, and the equalization transformation becomes For k=1,2,…..L where is the intensity value in the output (processed) image corresponding to value in the input image.
  • 20. Histogram Equalization  Histogram equalization is implemented in the toolbox by function histeq,which has the syntax  g = histeq(f, nlev)  where f is the input image and nlev is the number of intensity levels specified for the output image. >> imshow(f) >> figure, imhist(f) >> g = histeq(f, 256); >> figure, imshow(g) >> figure, imhist(g)
  • 21.
  • 22. Histogram Matching (Specification) The toolbox implements histogram matching using the following syntax in histeq: g = histeq(f, hspec) >> f1 = histeq(f, 256);
  • 23. Spatial Filtering Neighborhood processing consists of (1) defining a center point, (2) performing an operation that involves only the pixels in a predefined neighborhood about that center point; (3) letting the result of that operation be the “response” of the process at that point; and (4) repeating the process for every point in the image. The process of moving the center point creates new neighborhoods, one for each pixel in the input image
  • 24. • The two principal terms used to identify this operation are neighborhood processing and spatial filtering, with the second term being more prevalent. • If the computations performed on the pixels of the neighborhoods are linear, the operation is called linear spatial filtering (the term spatial convolution also used); otherwise it is called nonlinear spatial filtering.
  • 26.
  • 27.
  • 28. The toolbox implements linear spatial filtering using function imfilter, which has the following syntax: g = imfilter(f, w, filtering_mode, boundary_options, size_options) The most common syntax for imfilter is g = imfilter(f, w, 'replicate') f = imread('peppers.png'); figure,imshow(f) w=[256 256]; g = imfilter(f, w, 'symmetric') figure, imshow(g)
  • 29.
  • 30. Standard Linear Spatial Filters: Syntax: W=fspecial(‘type’, parameters) Eg: originalRGB = imread('peppers.png’); imshow(originalRGB) h = fspecial('motion', 50, 45); filteredRGB = imfilter(originalRGB, h); figure, imshow(filteredRGB)
  • 31.
  • 32. Non liner spatial Filtering Syntax fp = padarray(f, [r c], method, direction) Eg 1: f=imread('peppers.png'); fp=padarray(f, [312 312], 'replicate', 'post') figure,imshow(f); figure,imshow(fp); Eg 2: >> fp = padarray(f, [3 2], 'replicate', 'post')
  • 33.
  • 34. Standard Non Linear Spatial Filters: The syntax of function ordfilt2 is g = ordfilt2(f, order, domain) to implement a min filter (order 1) of size mxn we use the syntax g = ordfilt2(f, 1, ones(m, n)) Eg: >> fn = imnoise(f, 'salt & pepper', 0.2); >> gm = medfilt2(fn); >> gms = medfilt2(fn, 'symmetric');