File size: 769 Bytes
dcd2bd2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | function image = data_augmentation(image, mode)
if mode == 1
return;
end
if mode == 2 % flipped
image = flipud(image);
return;
end
if mode == 3 % rotation 90
image = rot90(image,1);
return;
end
if mode == 4 % rotation 90 & flipped
image = rot90(image,1);
image = flipud(image);
return;
end
if mode == 5 % rotation 180
image = rot90(image,2);
return;
end
if mode == 6 % rotation 180 & flipped
image = rot90(image,2);
image = flipud(image);
return;
end
if mode == 7 % rotation 270
image = rot90(image,3);
return;
end
if mode == 8 % rotation 270 & flipped
image = rot90(image,3);
image = flipud(image);
return;
end
|