Skip to main content
. 2023 Feb 17;9(2):46. doi: 10.3390/jimaging9020046
Algorithm 1 Random Local Rotation
  •  1:

    Input: The training dataset D

  •  2:

    Output: The augmented training dataset D˜

  •  3:

    Create a subset say DD by randomly selecting N images from D

  •  4:

    Create an empty set say D*

  •  5:

    forIDdo

  •  6:

        Randomly generate centre (x,y) and radius r within image I

  •  7:

        Form a circular area Cx,y,r within image I with centre (x,y) and radius r

  •  8:

        Randomly generate angle θ[0,2π]

  •  9:

        Form image I˜ by rotating the area within Cx,y,r in image I with angle θ

  • 10:

       Add I˜ into D*

  • 11:

    end for

  • 12:

    Way 1: D˜D*DD

  • 13:

    Way 2: D˜D*D