Skip to main content
. 2024 Oct 4;24(19):6425. doi: 10.3390/s24196425
Algorithm A1 Algorithm for resizing an image
1: for x=1 to image width in pixels do
2:  for y=1 to image height in pixels do
3:   Arrange augmented y matrix using the weights from the referenced equations:
1y1y12y131y2y22y231y3y32y331y4y42y43W1(Sy)W0(Sy)W1(Sy)W2(Sy)
                ▹W are the weight functions and Sy is the scaling factor in y direction.
4:   Apply the Gauss Jordan elimination method to solve for p values by Equation (A7):
p=W1(Sy)fi1,j+W0(Sy)fi,j+W1(Sy)fi+1,j+W2(Sy)fi+2,j
5:   Enter the y value of the pixels
6:   Arrange augmented x matrix using the weights from the referenced equations:
1x1x12x131x2x22x231x3x32x331x4x42x43W1(Sx)W0(Sx)W1(Sx)W2(Sx)
                ▹W are the weight functions and Sx is the scaling factor in x direction.
7:   Apply the Gauss Jordan elimination method to solve for p values by Equation (A9):
p=W1(Sx)fi,j1+W0(Sx)fi,j+W1(Sx)fi,j+1+W2(Sx)fi,j+2
8:   Enter the x value of the pixels to searched equation
9:  end for
10: end for
11: Perform rounding on each pixel value