Skip to main content
. 2020 Dec 27;21(1):122. doi: 10.3390/s21010122
Algorithm 1 Image Enhancement Processing
Input: YI.
Output: Yo
1  YI is the original image matrix, Yo is the enhanced image matrix.
2  FOR p = 1: s //s is the number of image samples
3    Implement random cropping based on grayscale matching for ysn:
4    (i) Perform random cropping, according to Formulas (4) and (5):
5      ypm=Crop(ysn,size).
6    (ii) Determine whether the following conditions are met: D(i,j)<DT
7      Yo=Yoypm
8 Randomly shift the randomly cropped image tensor ypm according to Equation (6):
9    ypk+1=Warp(ypm) then Yo=Yoypk+1
10  Randomly rotate ypm according to Formula (7):
11    ypk+2=Rotation(ypm) then Yo=Yoypk+2
12   Randomly scale ypm according to Formula (8):
13    ypk+3=Zoom(ypm) then Yo=Yoypk+3
14   Randomly adjust the brightness of ypm according to Equation (9):
15    ypk+4=Bright(ypm) then Yo=Yoypk+4
16  Normalize the enhanced, small-sized image according to Equation (10):
17    Yo=Yo/255.0
18 END
19 Return Yo