Comute Viion - Hitogam Poceing D. S. Da IIT Mada, CHENNAI - 36
HISTOGRAM In a gay level image the obabilitie aigned to each gay level can be given by the elation: n, N Inut image,,2...l - - The nomalized intenity value L - No. of gay level in the image n - No. of ixel with gay level N - Total numbe of ixel The lot of with eect to i called HISTOGRAM of the image hitogam
Some image and thei hitogam Image with 2 ominent intenitie Foegound white
Some image and thei hitogam Image with moe ominent da bacgound Image with moe o le unifom coloing excet the bacgound
Hitogam ae Ue of hitogam imle to calculate Give infomation about the ind global aeaance of image and it oetie. Ued fo Image enhancement Ued fo Image comeion Ued fo Image egmentation Can be ued fo eal time oceing We hall now have a loo at Hitogam Equalization: Hee, the goal i to obtain a unifom hitogam fo the outut image.
Some baic eeent the gay level of image to be enhanced. It i nomalized in the ange [,] eeent blac eeent white T i tanfomation that oduce a level fo evey ixel in the oiginal image. T
HISTOGRAM EQUALIZATION Containt on T T hould atifie the following condition T i ingle valued and monotonically inceaing whee i in the ange [,] T alo vaie in the ange [,].The fit equiement i to enue that T i invetible, and monotonicity enue the ode of inceaing intenitie one to one 2.The econd equiement i to enue that eulting gay level ae in the ame ange a inut level onto The invee tanfomation fom bac to i denoted by T -
HISTOGRAM EQUALIZATION Continuou cae The gay level in an image can be viewed a andom vaiable in the inteval [, ] and thei df calculated If and ae two diffeent obability ditibution on and of inut and tanfomed image eectively, then the obability of a gay level value in the ange d hould be ame in the tanfomed image at gay level and ange d. So the df of deend on df of and the tanfomation function. d d
HISTOGRAM EQUALIZATION Continuou cae Conide the CDF to be the tanfomation function. i.e. d d T dt d d d w dw Thi T i ingle valued and monotonically inceaing alo the integation of a df i a df in the ame ange. So both containt atified. alying the leibniz ule Subtituting thi into the fit equation we get d d w dw,
HISTOGRAM EQUALIZATION Continuou cae i a df that i outide the inteval [,] and in the inteval [,] :- a unifom denity. Thu the tanfomation T yield a andom vaiable chaacteized by a unifom df. T deend on but alway i alway a unifom df. In dicete cae tae dicete value,, L- and obability of occuence of a gay level in an image i aoximated by: n N,...L -
Mathematically, the dicete fom of the tanfomation function fo hitogam equalization i given by Whee T n / N P j, j j,,2,..., j L n j i the numbe of time the j th gay level aea in the image L i the numbe of gay level P j i the obability of the j th gay level and N i the total numbe of ixel in the image Unlie the continuou at the dicete tanfomation may not oduce the dicete equivalent of a unifom df. Nevethele, it ead the hitogam to an a lage ange.
Dicuion on Hitogam equalization Thi method i comletely automatic. Invee tanfomation T - atifie both the condition onto and one to one and hence can be ued in the continuou cae In cae of dicete hitogam, it i oible if the inut image ha all the gay level. ALGORITHM INPUT: Inut image OUTPUT: Outut image afte equalization. Comute hitogam hx i 2. Calculate nomalized um of hitogam CDF 3. Tanfom inut image to outut image Hee follow an examle on how to efom hitogam equalization on an image. Next age
Examle on hitogam equalization Continuou Cae PDF of inut image:- 2 P 2 + 2, CDF i calculated a :- T - 2 + 2 2w + 2 dw T give 2 2 +
Examle on hitogam equalization Continuou Cae 2 ± 4-4 2, d d ± 2 Taing deivative with eect to 2 + 2, 2 d d, Unifom df
Examle on hitogam equalization Dicete cae a b n c d Cdf e Quant. Value 79.9.9 /7 /7 23.25.44 3/7 2/7 85.2.65 5/7 3/7 656.6.8 6/7 4/7 329.8.89 6/7 5/7 245.6.95 6/7 22.3.98 8.2. total 496. a Quantized Gay level; b a amle hitogam; c it df; d Comuted CDF and e aoximated to the neaet gay level.
Examle on hitogam equalization Dicete caecontd.. a /7 2/7 3/7 4/7 5/7 6/7 total b n 79 23 85 656 329 245 22 8 496 c.9.25.2.6.8.6.3.2. /7 2/7 3/7 4/7 5/7 6/7 T /7 3/7 5/7 6/7 6/7 7/7 7/7 7/7 /7 2/7 3/7 4/7 5/7 6/7 7/7 n 79 23 85 985 448.9.25.2.24. Oiginal Hitogam Tanfomation function The new hitogam
7 6 5 4 3 2 T T 2 4 6.3 P.2. 2 4 6
HISTOGRAM EQUALISATION - eviited Hee, the goal i to obtain a unifom hitogam fo the outut image. Some featue of Hitogam equalization ae a follow: Hitogam equalization i a oint oce Hitogam equalization caue a hitogam with cloely goued value to ead out into a flat o equalized hitogam. Seading o flattening the hitogam mae the da ixel aea dae and the light ixel aea lighte. Hitogam equalization doe not oeate on the hitogam itelf but ue the eult of one hitogam to tanfom the oiginal image into an image that will have equalized hitogam. Hitogam equalization do not intoduce new intenitie in the image. Exiting value will be maed to new value eeing actual numbe of intenitie in the eulting image equal o le than the oiginal numbe of intenitie.
d T d d d d d ; ; T T HISTOGRAM MODIFICATION ' ' T T T T T Examle: Let, T a + b; /* Linea cae */ } { T a b. a b a */ /*, 2 Gauian e If c */ /*, 2 ] / / [ Gauian Alo a ae Then a b c a +
If, e c 2 /* Gauian*/ Then, ae [ / a c+ b / a] 2
Hitogam ecification Hitogam ecification method develo a gay level tanfomation uch that the hitogam of the outut image matche that of the e-ecified hitogam of a taget image. Figue below how the flow diagam of hitogam ecification method Ax,y Inut Image Tx,y Taget Image Cx,y Outut Image HADA HTDT HCDC DT 255 DA 255 DC 255 Inut Taget Outut
Develoment of the method Continuou cae Continuou gay level and z of the inut and the taget image. Thei coeonding df ae and z z Let be the andom vaiable with the oety Conide thi T w v dw G Ideally we would want Gz T z z t dt So z mut atify the condition z G G z [ T ]
Develoment of the method Dicete cae The dicete fomulation of the method, hitogam i fit obtained fo both the inut and taget image. The hitogam i then equalized uing the fomula Whee T n j / n P j j n i the total numbe of ixel in the image, j,,2,...,l n j i the numbe of ixel with gay level j L i the numbe of gay level Fom the given z z i we can obtain v G z i z z i,,...l -
Develoment of the method Dicete cae 2 Hence z mut atify the condition [ T ],,...L - z G G ALGORITHM INPUT: Inut image, Taget image OUTPUT: Outut image that ha the ame chaacteitic a the taget image Ste: Read the Inut image and the Taget image. Obtain the hitogam of the inut image and the taget image. Equalize the inut and the taget image uing the equation. Calculate the tanfomation function G of the taget Image. Ma the oiginal image gay level to the final gay level z
Maing fom to via T v Maing fom z to v via Gz v q Gz T L- v Gz z z L- Invee Maing fom to z z z L-
A hand woed examle Two hitogam ae given to u n z z /7 79.9 /7 /7 23.25 /7 2/7 85.2 2/7 3/7 656.6 3/7.5 4/7 329.8 4/7.2 5/7 245.6 5/7.3 6/7 22.3 6/7.2 7/7 8.2 7/7.5 Inut hitogam Taget hitogam
A hand woed examle 2 Equalizing both the hitogam The fit hitogam /7 /7.9.25 cdf.9.44 Gay level /7 3/7 7 6 5 4 T 2/7 3/7.2.6.65.8 5/7 6/7 3 2 4/7 5/7.8.6.89.95 6/7 2 4 6 6/7.3.98 7/7.2
A hand-woed examle 3 The econd hitogam z /7 z cdfz K Gay level v /7 7 6 5 /7 2/7 3/7 4/7 5/7 6/7.5.2.3.2.5.35.65.85 /7 /7 /7 2/7 5/7 6/7 4 3 2 2 4 6 z Gz 7/7.5
T 7 6 5 4 3 2 T 2 4 6.3 P.2. 2 4 6 7 6 5 4 3 z z 2 2 4 6 z Gz
A hand-woed examle 4 Maing tage /7 /7 2/7 3/7 4/7 5/7 6/7 7/7 cdf.9.44.65.8.89.95.98 Equalized inut hitogam Gz K.5.35.65.85 z /7 /7 2/7 3/7 4/7 5/7 6/7 7/7 Equalized taget hitogam Maing function 2 3,4 5,6,7 3 4 5 6 7
Taget Image Inut Image Outut Image
Souce Image Diect Hitogam Secification Taget Image DHS Outut Image
Souce Image Diect Hitogam Secification Taget Image DHS Outut Image
Souce Image Diect Hitogam Secification DHS Outut Image Taget Image
End of Lectue - Hitogam Poceing