SlideShare a Scribd company logo
1 of 38
Download to read offline
Digital Image
Processing
Unit-1 DIGITAL IMAGE FUNDAMENTALS
Prepared by
Lt. SAMRAJ S.,AP/ECE
Module-II
IMAGE ENHANCEMENT
➢Histogram Modification
✓ Histogram modification performs a function
similar to gray level mapping, but works by
considering histogram’s shape and spread
✓ Gray level histogram of an image is the
distribution of the gray levels in an image
✓ Examination of the histogram is one of the most
useful tools for image enhancement, as it makes
easy to see the modifications that may improve
an image
✓ The histogram can be modified by a mapping
function, which will stretch, shrink (compress),
or slide the histogram
✓ Histogram stretching and histogram shrinking
are forms of gray scale modification, sometimes
referred to as histogram scaling
✓ Histogram stretch
• The mapping function equation is as follows:
where: I(r,c)MAX is the largest gray level value in
the image I(r,c), I(r,c)MIN is the smallest gray
level value in I(r,c) and
MAX and MIN correspond to the maximum and
minimum gray level values possible (for an 8-bit
image these are 0 and 255)
• This equation will take an image and stretch the
histogram across the entire gray level range,
which has the effect of increasing the contrast of
a low contrast image
• If most of the pixel values in an image fall within
a small range, it is useful to allow a small
percentage of the pixel values to be clipped at
the low and high end of the range (for an 8-bit
image this means truncating at 0 and 255)
a) Low-contrast image
c) Image (a) after histogram stretch
b) Histogram of image (a)
d) Histogram of image after stretch
Histogram Stretching
a) Original image b) Histogram of original image c) Image after histogram stretching
with out clipping
d) Histogram of image (c) e) Image after histogram stretching with
clipping 1% of the values at the high
and low ends
f) Histogram of image (e)
Histogram Stretching with Clipping
✓ Histogram shrink
✓ The mapping function equation is as follows:
where I(r,c)MAX is the largest gray level value in
the image I(r,c), I(r,c)MIN is the smallest gray
level value in I(r,c) and
ShrinkMAX and ShrinkMIN correspond to the
maximum and minimum desired in the
compressed histogram
• Decreases image contrast by compressing the
gray levels
• However this method may not be useful as an
image enhancement tool, but it is used in an
image sharpening algorithm (unsharp masking) as
a part of an enhancement technique
a) Original image b) Histogram of image
c) Image after shrinking the histogram
to the range [75,175]
d) Histogram of image (c)
Histogram Shrinking
✓ Histogram slide
• Used to make an image either darker or lighter,
but retain the relationship between gray level
values
• Accomplished by simply adding or subtracting a
fixed number from all of the gray level values, as
follows:
where the OFFSET value is the amount to slide
the histogram
• In this equation we assume that any values slid
past the minimum and maximum values will be
clipped to the respective minimum or maximum
• A positive OFFSET value will increase the
overall brightness, while a negative OFFSET will
create a darker image
a) Resultant image from sliding the
histogram down by 50
b) Histogram of image (a)
c) Resultant image from sliding the
histogram up by 50
d) Histogram of image (c)
Histogram Slide
✓ Histogram equalization
• A technique where the histogram of the resultant
image is as flat as possible
• The theoretical basis for histogram equalization
involves probability theory, where we treat the
histogram as the probability distribution of the
gray levels
• Its function is similar to that of a histogram
stretch but often provides more visually pleasing
results across a wider range of images
• Consists of four steps:
1. Find the running sum of the histogram
values
2. Normalize the values from step (1) by
dividing by the total number of pixels
3. Multiply the values from step (2) by the
maximum gray level value and round
4. Map the gray level values to the results
from step (3) using a one-to-one
correspondence
Example:
3-bits per pixel image – range is 0 to 7.
Given the following histogram:
Number of Pixels
Gray Level Value (Histogram values)
0 10
1 8
2 9
3 2
4 14
5 1
6 5
7 2
1) Create a running sum of the histogram values.
This means the first value is 10, the second is
10+8=18, next 10+8+9=27, and so on. Here we
get 10, 18, 27, 29, 43, 44, 49, 51
2) Normalize by dividing by the total number of
pixels. The total number of pixels is:
10+8+9+2+14+1+5+0 = 51 (note this is the last
number from step 1), so we get: 10/51, 18/51,
27/51, 29/51, 43/51, 44/51, 49/51, 51/51
3) Multiply these values by the maximum gray
level values, in this case 7, and then round the
result to the closest integer. After this is done we
obtain: 1, 2, 4, 4, 6, 6, 7, 7
4) Map the original values to the results from step
3 by a one-to-one correspondence. This is done
as follows:
Original Gray Histogram
Level Value Equalized Values
0 1
1 2
2 4
3 4
4 6
5 6
6 7
7 7
▪ All pixels in the original image with gray level 0
are set to 1, values of 1 are set to 2, 2 set to 4, 3
set to 4, and so on. After the histogram
equalization values are calculated and can be
implemented efficiently with a look-up-table
(LUT), as discussed in Chapter 2
▪ We can see the original histogram and the
resulting histogram equalized histogram in Fig.
8.2.14. Although the result is not flat, it is closer
to being flat than the original histogram
Input image Resultant image after histogram equalization
Histogram Equalization Examples
1.
Input image Resultant image after histogram equalization
Histogram Equalization Examples (contd)
2.
Note: As can be seen histogram equalization provides similar results
regardless of the input image
• Histogram equalization of a digital image will not
typically provide a histogram that is perfectly flat,
but it will make it as flat as possible
• Histogram equalization may not always provide
the desired effect, since its goal is fixed – to
distribute the gray level values as evenly as
possible. To allow for interactive histogram
manipulation, the ability to specify the histogram
is necessary
✓ Histogram specification
• Process of defining a histogram and modifying
the histogram of the original image to match the
histogram as specified
• Key concept is to picture the original image
being histogram equalized, and the specified
histogram being histogram equalized
a
b
• Histogram specification consists of following 5
steps:
1. Specify the desired histogram
2. Find the mapping table to histogram
equalize the image, Mapping Table 1,
3. Find the mapping table to histogram
equalize the values of the specified
histogram, Mapping Table 2
• Histogram specification steps (continued)
4. Use mapping Tables 1 & 2 to find the
mapping table to map the original values
to the histogram equalized values and
then to the specified histogram values
5. Use the table from step (4) to map the
original values to the specified histogram
values
EXAMPLE:
1) Specify the desired histogram:
Number of pixels
Gray Level Value in desired histogram
0 1
1 5
2 10
3 15
4 20
5 0
6 0
7 0
2) For this we will use the image and mapping table from
the previous example, where the histogram equalization
mapping table (Mapping Table 1) is given by:
Original Gray Level Value Histogram Equalized
level values-OS equalized values-HS
0 1
1 2
2 4
3 4
4 6
5 6
6 7
7 7
3) Find the histogram equalization mapping table
(Mapping Table 2) for the specified histogram:
Gray Level Histogram Equalized
Value - OS Values – HS .
0 round(1/51)*7 = 0
1 round(6/51)*7 = 1
2 round(16/51)*7 = 2
3 round(31/51)*7 = 4
4 round(51/51)*7 = 7
5 round(51/51)*7 = 7
6 round(51/51)*7 = 7
7 round(51/51)*7 = 7
4) Use Mapping Tables 1 and 2 to find the final mapping
table by mapping the values first to the histogram
equalized values and then to the specified histogram
values. (Mapping Table 2, columns switched to match Fig. 8.2.16 – slide 57)
Mapping Table 1 Mapping Table 2
O H HS OS M
0 1 0 0 1
1 2 1 1 2
2 4 2 2 3
3 4 4 3 3
4 6 7 4 4
5 6 7 5 4
6 7 7 6 4
7 7 7 7 4
5) Use the table from STEP 4 to perform the histogram
specification mapping. For this all we need are columns
O (or OS) and M:
O M
0 1
1 2
2 3
3 3
4 4
5 4
6 4
7 4
Now, all the 0’s get mapped to 1’s, the 1’s to 2’s, the 3’s
to 3’s and so on
• In practice, the desired histogram is often
specified by a continuous (possibly non-linear)
function, for example a sine or a log function.
• To obtain the numbers for the specified
histogram the function is sampled, the values
are normalized to 1, and then multiplied by the
total number of pixels in the image
Original
image
Histogram Specification Examples
Histogram
of
original
image
Output image and its histogram
Specified histogram, exp(0.015*x)
Histogram Specification Examples (contd)
Original histogram
Output image and its histogram
Specified histogram, log(0.5*x+2)
Histogram Specification Examples (contd)
Original histogram

More Related Content

Similar to ModuleII090.pdf

Image processing second unit Notes
Image processing second unit NotesImage processing second unit Notes
Image processing second unit NotesAAKANKSHA JAIN
 
Histogram based Enhancement
Histogram based Enhancement Histogram based Enhancement
Histogram based Enhancement Vivek V
 
Histogram based enhancement
Histogram based enhancementHistogram based enhancement
Histogram based enhancementliba manopriya.J
 
2024-master dityv5y65v56u4b6u64u46p 0318-25.pdf
2024-master dityv5y65v56u4b6u64u46p 0318-25.pdf2024-master dityv5y65v56u4b6u64u46p 0318-25.pdf
2024-master dityv5y65v56u4b6u64u46p 0318-25.pdfnatnaeltamirat6212
 
Contrast enhancement using various statistical operations and neighborhood pr...
Contrast enhancement using various statistical operations and neighborhood pr...Contrast enhancement using various statistical operations and neighborhood pr...
Contrast enhancement using various statistical operations and neighborhood pr...sipij
 
Fast Segmentation of Sub-cellular Organelles
Fast Segmentation of Sub-cellular OrganellesFast Segmentation of Sub-cellular Organelles
Fast Segmentation of Sub-cellular OrganellesCSCJournals
 
International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)IJERD Editor
 
CONTRAST ENHANCEMENT TECHNIQUES USING HISTOGRAM EQUALIZATION METHODS ON COLOR...
CONTRAST ENHANCEMENT TECHNIQUES USING HISTOGRAM EQUALIZATION METHODS ON COLOR...CONTRAST ENHANCEMENT TECHNIQUES USING HISTOGRAM EQUALIZATION METHODS ON COLOR...
CONTRAST ENHANCEMENT TECHNIQUES USING HISTOGRAM EQUALIZATION METHODS ON COLOR...IJCSEA Journal
 
Image enhancement ppt nal2
Image enhancement ppt nal2Image enhancement ppt nal2
Image enhancement ppt nal2Surabhi Ks
 
DSP presentation_latest
DSP presentation_latestDSP presentation_latest
DSP presentation_latestHaowei Jiang
 
The Effectiveness and Efficiency of Medical Images after Special Filtration f...
The Effectiveness and Efficiency of Medical Images after Special Filtration f...The Effectiveness and Efficiency of Medical Images after Special Filtration f...
The Effectiveness and Efficiency of Medical Images after Special Filtration f...Editor IJCATR
 
Image enhancement
Image enhancementImage enhancement
Image enhancementAyaelshiwi
 
Image enhancement lecture
Image enhancement lectureImage enhancement lecture
Image enhancement lectureISRAR HUSSAIN
 
Intensity Transformation and Spatial filtering
Intensity Transformation and Spatial filteringIntensity Transformation and Spatial filtering
Intensity Transformation and Spatial filteringShajun Nisha
 

Similar to ModuleII090.pdf (20)

h.pdf
h.pdfh.pdf
h.pdf
 
Histogram processing
Histogram processingHistogram processing
Histogram processing
 
Image processing second unit Notes
Image processing second unit NotesImage processing second unit Notes
Image processing second unit Notes
 
Histogram based Enhancement
Histogram based Enhancement Histogram based Enhancement
Histogram based Enhancement
 
Histogram based enhancement
Histogram based enhancementHistogram based enhancement
Histogram based enhancement
 
DIP_Lecture5.pdf
DIP_Lecture5.pdfDIP_Lecture5.pdf
DIP_Lecture5.pdf
 
DIP_Lecture5.pdf
DIP_Lecture5.pdfDIP_Lecture5.pdf
DIP_Lecture5.pdf
 
2024-master dityv5y65v56u4b6u64u46p 0318-25.pdf
2024-master dityv5y65v56u4b6u64u46p 0318-25.pdf2024-master dityv5y65v56u4b6u64u46p 0318-25.pdf
2024-master dityv5y65v56u4b6u64u46p 0318-25.pdf
 
Contrast enhancement using various statistical operations and neighborhood pr...
Contrast enhancement using various statistical operations and neighborhood pr...Contrast enhancement using various statistical operations and neighborhood pr...
Contrast enhancement using various statistical operations and neighborhood pr...
 
Fast Segmentation of Sub-cellular Organelles
Fast Segmentation of Sub-cellular OrganellesFast Segmentation of Sub-cellular Organelles
Fast Segmentation of Sub-cellular Organelles
 
International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)International Journal of Engineering Research and Development (IJERD)
International Journal of Engineering Research and Development (IJERD)
 
CONTRAST ENHANCEMENT TECHNIQUES USING HISTOGRAM EQUALIZATION METHODS ON COLOR...
CONTRAST ENHANCEMENT TECHNIQUES USING HISTOGRAM EQUALIZATION METHODS ON COLOR...CONTRAST ENHANCEMENT TECHNIQUES USING HISTOGRAM EQUALIZATION METHODS ON COLOR...
CONTRAST ENHANCEMENT TECHNIQUES USING HISTOGRAM EQUALIZATION METHODS ON COLOR...
 
Image enhancement ppt nal2
Image enhancement ppt nal2Image enhancement ppt nal2
Image enhancement ppt nal2
 
DSP presentation_latest
DSP presentation_latestDSP presentation_latest
DSP presentation_latest
 
Imagee.pptx
Imagee.pptxImagee.pptx
Imagee.pptx
 
The Effectiveness and Efficiency of Medical Images after Special Filtration f...
The Effectiveness and Efficiency of Medical Images after Special Filtration f...The Effectiveness and Efficiency of Medical Images after Special Filtration f...
The Effectiveness and Efficiency of Medical Images after Special Filtration f...
 
Image enhancement
Image enhancementImage enhancement
Image enhancement
 
ijecct
ijecctijecct
ijecct
 
Image enhancement lecture
Image enhancement lectureImage enhancement lecture
Image enhancement lecture
 
Intensity Transformation and Spatial filtering
Intensity Transformation and Spatial filteringIntensity Transformation and Spatial filtering
Intensity Transformation and Spatial filtering
 

More from SamrajECE

reservation-policy-required-followed for admission
reservation-policy-required-followed for admissionreservation-policy-required-followed for admission
reservation-policy-required-followed for admissionSamrajECE
 
Module-V 096.pdf
Module-V 096.pdfModule-V 096.pdf
Module-V 096.pdfSamrajECE
 
Module-IV 095.pdf
Module-IV 095.pdfModule-IV 095.pdf
Module-IV 095.pdfSamrajECE
 
Module-IV 094.pdf
Module-IV 094.pdfModule-IV 094.pdf
Module-IV 094.pdfSamrajECE
 
Module-IV 093.pdf
Module-IV 093.pdfModule-IV 093.pdf
Module-IV 093.pdfSamrajECE
 
ModuleII092.pdf
ModuleII092.pdfModuleII092.pdf
ModuleII092.pdfSamrajECE
 
ModuleII091.pdf
ModuleII091.pdfModuleII091.pdf
ModuleII091.pdfSamrajECE
 

More from SamrajECE (8)

reservation-policy-required-followed for admission
reservation-policy-required-followed for admissionreservation-policy-required-followed for admission
reservation-policy-required-followed for admission
 
M4L12.ppt
M4L12.pptM4L12.ppt
M4L12.ppt
 
Module-V 096.pdf
Module-V 096.pdfModule-V 096.pdf
Module-V 096.pdf
 
Module-IV 095.pdf
Module-IV 095.pdfModule-IV 095.pdf
Module-IV 095.pdf
 
Module-IV 094.pdf
Module-IV 094.pdfModule-IV 094.pdf
Module-IV 094.pdf
 
Module-IV 093.pdf
Module-IV 093.pdfModule-IV 093.pdf
Module-IV 093.pdf
 
ModuleII092.pdf
ModuleII092.pdfModuleII092.pdf
ModuleII092.pdf
 
ModuleII091.pdf
ModuleII091.pdfModuleII091.pdf
ModuleII091.pdf
 

Recently uploaded

CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
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
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
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
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
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
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 

Recently uploaded (20)

OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
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
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.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
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
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
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
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
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 

ModuleII090.pdf

  • 1. Digital Image Processing Unit-1 DIGITAL IMAGE FUNDAMENTALS Prepared by Lt. SAMRAJ S.,AP/ECE
  • 3. ➢Histogram Modification ✓ Histogram modification performs a function similar to gray level mapping, but works by considering histogram’s shape and spread ✓ Gray level histogram of an image is the distribution of the gray levels in an image ✓ Examination of the histogram is one of the most useful tools for image enhancement, as it makes easy to see the modifications that may improve an image
  • 4. ✓ The histogram can be modified by a mapping function, which will stretch, shrink (compress), or slide the histogram ✓ Histogram stretching and histogram shrinking are forms of gray scale modification, sometimes referred to as histogram scaling
  • 5.
  • 6. ✓ Histogram stretch • The mapping function equation is as follows: where: I(r,c)MAX is the largest gray level value in the image I(r,c), I(r,c)MIN is the smallest gray level value in I(r,c) and MAX and MIN correspond to the maximum and minimum gray level values possible (for an 8-bit image these are 0 and 255)
  • 7. • This equation will take an image and stretch the histogram across the entire gray level range, which has the effect of increasing the contrast of a low contrast image • If most of the pixel values in an image fall within a small range, it is useful to allow a small percentage of the pixel values to be clipped at the low and high end of the range (for an 8-bit image this means truncating at 0 and 255)
  • 8. a) Low-contrast image c) Image (a) after histogram stretch b) Histogram of image (a) d) Histogram of image after stretch Histogram Stretching
  • 9. a) Original image b) Histogram of original image c) Image after histogram stretching with out clipping d) Histogram of image (c) e) Image after histogram stretching with clipping 1% of the values at the high and low ends f) Histogram of image (e) Histogram Stretching with Clipping
  • 10. ✓ Histogram shrink ✓ The mapping function equation is as follows: where I(r,c)MAX is the largest gray level value in the image I(r,c), I(r,c)MIN is the smallest gray level value in I(r,c) and ShrinkMAX and ShrinkMIN correspond to the maximum and minimum desired in the compressed histogram
  • 11. • Decreases image contrast by compressing the gray levels • However this method may not be useful as an image enhancement tool, but it is used in an image sharpening algorithm (unsharp masking) as a part of an enhancement technique
  • 12. a) Original image b) Histogram of image c) Image after shrinking the histogram to the range [75,175] d) Histogram of image (c) Histogram Shrinking
  • 13. ✓ Histogram slide • Used to make an image either darker or lighter, but retain the relationship between gray level values • Accomplished by simply adding or subtracting a fixed number from all of the gray level values, as follows: where the OFFSET value is the amount to slide the histogram
  • 14. • In this equation we assume that any values slid past the minimum and maximum values will be clipped to the respective minimum or maximum • A positive OFFSET value will increase the overall brightness, while a negative OFFSET will create a darker image
  • 15. a) Resultant image from sliding the histogram down by 50 b) Histogram of image (a) c) Resultant image from sliding the histogram up by 50 d) Histogram of image (c) Histogram Slide
  • 16. ✓ Histogram equalization • A technique where the histogram of the resultant image is as flat as possible • The theoretical basis for histogram equalization involves probability theory, where we treat the histogram as the probability distribution of the gray levels • Its function is similar to that of a histogram stretch but often provides more visually pleasing results across a wider range of images
  • 17. • Consists of four steps: 1. Find the running sum of the histogram values 2. Normalize the values from step (1) by dividing by the total number of pixels 3. Multiply the values from step (2) by the maximum gray level value and round 4. Map the gray level values to the results from step (3) using a one-to-one correspondence
  • 18. Example: 3-bits per pixel image – range is 0 to 7. Given the following histogram: Number of Pixels Gray Level Value (Histogram values) 0 10 1 8 2 9 3 2 4 14 5 1 6 5 7 2
  • 19. 1) Create a running sum of the histogram values. This means the first value is 10, the second is 10+8=18, next 10+8+9=27, and so on. Here we get 10, 18, 27, 29, 43, 44, 49, 51 2) Normalize by dividing by the total number of pixels. The total number of pixels is: 10+8+9+2+14+1+5+0 = 51 (note this is the last number from step 1), so we get: 10/51, 18/51, 27/51, 29/51, 43/51, 44/51, 49/51, 51/51 3) Multiply these values by the maximum gray level values, in this case 7, and then round the result to the closest integer. After this is done we obtain: 1, 2, 4, 4, 6, 6, 7, 7
  • 20. 4) Map the original values to the results from step 3 by a one-to-one correspondence. This is done as follows: Original Gray Histogram Level Value Equalized Values 0 1 1 2 2 4 3 4 4 6 5 6 6 7 7 7
  • 21. ▪ All pixels in the original image with gray level 0 are set to 1, values of 1 are set to 2, 2 set to 4, 3 set to 4, and so on. After the histogram equalization values are calculated and can be implemented efficiently with a look-up-table (LUT), as discussed in Chapter 2 ▪ We can see the original histogram and the resulting histogram equalized histogram in Fig. 8.2.14. Although the result is not flat, it is closer to being flat than the original histogram
  • 22.
  • 23. Input image Resultant image after histogram equalization Histogram Equalization Examples 1.
  • 24. Input image Resultant image after histogram equalization Histogram Equalization Examples (contd) 2. Note: As can be seen histogram equalization provides similar results regardless of the input image
  • 25. • Histogram equalization of a digital image will not typically provide a histogram that is perfectly flat, but it will make it as flat as possible • Histogram equalization may not always provide the desired effect, since its goal is fixed – to distribute the gray level values as evenly as possible. To allow for interactive histogram manipulation, the ability to specify the histogram is necessary
  • 26. ✓ Histogram specification • Process of defining a histogram and modifying the histogram of the original image to match the histogram as specified • Key concept is to picture the original image being histogram equalized, and the specified histogram being histogram equalized
  • 27. a b
  • 28. • Histogram specification consists of following 5 steps: 1. Specify the desired histogram 2. Find the mapping table to histogram equalize the image, Mapping Table 1, 3. Find the mapping table to histogram equalize the values of the specified histogram, Mapping Table 2
  • 29. • Histogram specification steps (continued) 4. Use mapping Tables 1 & 2 to find the mapping table to map the original values to the histogram equalized values and then to the specified histogram values 5. Use the table from step (4) to map the original values to the specified histogram values
  • 30. EXAMPLE: 1) Specify the desired histogram: Number of pixels Gray Level Value in desired histogram 0 1 1 5 2 10 3 15 4 20 5 0 6 0 7 0
  • 31. 2) For this we will use the image and mapping table from the previous example, where the histogram equalization mapping table (Mapping Table 1) is given by: Original Gray Level Value Histogram Equalized level values-OS equalized values-HS 0 1 1 2 2 4 3 4 4 6 5 6 6 7 7 7
  • 32. 3) Find the histogram equalization mapping table (Mapping Table 2) for the specified histogram: Gray Level Histogram Equalized Value - OS Values – HS . 0 round(1/51)*7 = 0 1 round(6/51)*7 = 1 2 round(16/51)*7 = 2 3 round(31/51)*7 = 4 4 round(51/51)*7 = 7 5 round(51/51)*7 = 7 6 round(51/51)*7 = 7 7 round(51/51)*7 = 7
  • 33. 4) Use Mapping Tables 1 and 2 to find the final mapping table by mapping the values first to the histogram equalized values and then to the specified histogram values. (Mapping Table 2, columns switched to match Fig. 8.2.16 – slide 57) Mapping Table 1 Mapping Table 2 O H HS OS M 0 1 0 0 1 1 2 1 1 2 2 4 2 2 3 3 4 4 3 3 4 6 7 4 4 5 6 7 5 4 6 7 7 6 4 7 7 7 7 4
  • 34. 5) Use the table from STEP 4 to perform the histogram specification mapping. For this all we need are columns O (or OS) and M: O M 0 1 1 2 2 3 3 3 4 4 5 4 6 4 7 4 Now, all the 0’s get mapped to 1’s, the 1’s to 2’s, the 3’s to 3’s and so on
  • 35. • In practice, the desired histogram is often specified by a continuous (possibly non-linear) function, for example a sine or a log function. • To obtain the numbers for the specified histogram the function is sampled, the values are normalized to 1, and then multiplied by the total number of pixels in the image
  • 37. Output image and its histogram Specified histogram, exp(0.015*x) Histogram Specification Examples (contd) Original histogram
  • 38. Output image and its histogram Specified histogram, log(0.5*x+2) Histogram Specification Examples (contd) Original histogram