Skip to main content
. 2019 Mar 4;21(3):244. doi: 10.3390/e21030244
Algorithm 1 Proposed method for TII Enhancement
Input:I, G, G, n, ω
Output:IE(Enhanced image)
  Initialization: G, G
 1: fori=1 to n do
 2: Calculation of top-hat transform.
    MBi=I((IGi)Gi) (Equation (11))
    MDi=((IGi)Gi)I (Equation (12))
 3: Calculation of subtractions from neighboring scales, obtained through the top-hat transform. The top-hat is subtracted with the previous difference, from the first subtraction of the first neighboring top-hat.
SNBSi1=MBiMBi1,toi=2MBiSNBSi2,toi>2(Equation(13))
SNDSi1=MDiMDi1,toi=2MDiSNDSi2,toi>2(Equation(14))

 4: end for
 5: Calculation of the maximum values of all the multiple scales obtained.
  SMB=i=1nMBi (Equation (15))
  SMD=i=1nMDi (Equation (16))
  SSNBS=i=1n1SNBSi1 (Equation (17))
  SSNDS=i=1n1SNDSi1 (Equation (18))
 6: TII enhancement calculation.The contrast enhancement calculation consists of adding the results of the multiple bright scales to the original image and subtracting the results of the multiple dark scales.
  IE=I+ω×(SMB+SSNBS)ω×(SND+SSNDS) (Equation (19))
 7: return IE