ImageProcessing
CosimoDistante
Lecture6:MonochromeandColorprocessing
Pointwise operator: algorithms that execute simple operation on the single pixel without involving neighboring pixels
I0(i,j)=Opointwise[II(i,j)]
If II(i,j) > 150 then IO(i,j)=1 else IO(i,j)=0
Local Operator: algorithms that define the new value of a pixel based on the intensity values of the neighboring pixels II input image, F(i,j) a window defined over the analysing pixel I0 output image
I0(i,j)=Olocale{II(ik,jl); (ik,jl)∈F(i,j)}
Median filter with window size 3×3
Global Operator: algorithms that extract global information from the image They use all pixels of the image
R=Oglobal[II(i,j)]
Histogram H(x) is the frequency of intensity value x The histogram HI(x) can be seen as the results of the global operatorfor the input image I With the histogram we loose spacial information
R.S.Gaborski 6
0 50 100 150 200 250 3000
0.005
0.01
0.015
0.02
0.025
0.03
0 50 100 150 200 250 3000
0.01
0.02
0.03
0.04
0.05
0.06
0 50 100 150 200 250 3000
0.01
0.02
0.03
0.04
0.05
0.06
Original Dark Light
Contrast manipulation Given: x gray level of input image II(i,j), y gray level of output image I0(i,j), T(x) the gray level transform (manipulation)
y=T(x)
Linear
y=β(x-xa)
with xa≤x≤xb and the stretching coefficient obtained by the ratio of the output gray level range and input gray level range Δx=xb-xa.
β =Δ
Δ
yx
Example: the interval of the most frequent levels in the image is [50..100] Then Δx=50 different levels That can be stretched to 256 levels (Δy) to have a better quality
Linear
stretching
Linear with multiple paths
α =yxa
a ab
ab
xxyy
−
−=β
)()(
max
max
b
b
xxLyyL
−
−=δ
ya and yb are constants used to increase or decrease the global illumination
Linear with multiple paths – special case
If α=0 and δ=0 Then stretching is related to interval (xa,xb) While are excluded (clipping) gray levels less than xa and greater than xb
This is useful when we know the object is in (xa,xb) in order to segment it. IF xa=xb≡xT, the output image is named Binary Image.
background object
Quadratic transformation:
y=x2 Expand high gray level and compress lower gray level Square root transf. Opposite behavior as previous transf. Log transform Applied when the range of gray levels in input image is much wider than the wanted range in output image (in Fourier representation)
Non Linear
xy =
yxx
e
e
=+
+
log ( )log [ max( )]
11
0 50 100 150 200 250 3000
50
100
150
200
250
300
0 50 100 150 200 250 3000
50
100
150
200
250
300
0 50 100 150 200 250 3000
50
100
150
200
250
300
Negative
Complementing with respect to the maximum gray level of the input image Inverse Useful to visualize very dark details of an image
y = 1x
with x > 0
xLy −= max
Imm. Original Negative Inverse
R.S.Gaborski 14
HistogramEqualizaGon• ThehistogramequalizaGontransformaGongenerates
animagewithequallylikelyintensityvalues• Theintensityvaluesintheoutputimagecoverthefull
range,[01]• TheresulGngimagehashigherdynamicrange• Recallthevaluesinthenormalizedhistogramare
approximatelytheprobabilityofoccurrenceofthosevalues
• ThehistogramequalizaGontransformisthecumulaGvedistribuGonfuncGon(CDF)
R.S.Gaborski 15
Histogram CDF
CUMULATIVEDISTRIBUTIONFUNCTION
Histogram equalization
Histogram equalization
Histogram equalization Algorithm
GivenNxMthaimagesizeandLmaxthemaximumgraylevelsFirststepistocreatethehistogramoftheimageHI
ThenbuildthecumulaGvehistogramHc
ThencomputethemappingfuncGon
andremapeverypixel
Hc(x)
R.S.Gaborski 19
InputImage OutputImage
HistogramEqualizaGon
R.S.Gaborski 20
HistogramEqualizaGonExample
• g=histeq(f,nlev)wherefistheoriginalimageandnlevnumberofintensitylevelsinoutputimage
Adaptive Histogram Equalization (AHE)
SinceoureyesadapttolocalregionsinsteadofenGreimage,itisusefultoopGmizeimageenhancementlocallyTheimageisdividedinagridofnon-overlappingregions
histogramequalizaGonappliedineachregion
Contrast Limited Adaptive Histogram Equalization (CLAHE)
OperateaclipontheequalizedhistogramComputethecumulaGvehistogram
ßisthecliplimitandαclipfactor
smaxmaximumallowedslopeForX-rayimagessmax=4PerformhistogramequalizaGonlocallyandoperateaclippingredistribuGngthepixels
Nota%onchangeNisthenumberofgraylevelsMthetotalnumberofpixelsinImage
Contrast Limited Adaptive Histogram Equalization (CLAHE)
h(n)
n
β h(n)-β Nota%onchangeNisthenumberofgraylevelsMthetotalnumberofpixelsinImage
Contrast Limited Adaptive Histogram Equalization (CLAHE)
Original Image
CLAHE
Histogram Equalization