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−((I⊖Gi)⊕Gi′) (Equation (11))
    MDi=((I⊕Gi)⊖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.
SNBSi−1=MBi−MBi−1,toi=2MBi−SNBSi−2,toi>2(Equation(13))
SNDSi−1=MDi−MDi−1,toi=2MDi−SNDSi−2,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=1n−1SNBSi−1 (Equation (17))
  SSNDS=∑i=1n−1SNDSi−1 (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