Skip to main content
. 2024 Jan 22;24(2):693. doi: 10.3390/s24020693
Algorithm 1 OOS mirroring procedure
  • 1:

    procedure Augment_Dataset(images, annotations)

  • 2:

          T, N = 0.75, 2                           ▹ Width shortening and iterations count constants

  • 3:

          for each Iimages do

  • 4:

              image_annotations = select_image_data(I, annotations)

  • 5:

              for iteration = 1 to N do

  • 6:

                    O = randomly_select_OOS(image_annotations)

  • 7:

                    D = find_mirroring_direction(O, I)

  • 8:

                    EC = find_enlargement_coordinates(O, D)             ▹ O is mirrored onto EC area

  • 9:

                    while intersection_exists(EC, image_annotations) do

  • 10:

                        EC = reduce_width(EC, T, D)

  • 11:

                    end while

  • 12:

                    new_image = mirror_OOS(I, O, EC)

  • 13:

                    new_image_data = adjust_OOS_coordinates(image_annotations, O, EC) ▹ Onew = O + EC

  • 14:

                    save(new_image, new_image_data)

  • 15:

                    I, image_data = new_image, new_image_data

  • 16:

              end for

  • 17:

          end for

  • 18:

    end procedure