You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
375 B
Matlab

2 years ago
function data = augmentData(data)
% Randomly flip images and bounding boxes horizontally.
tform = randomAffine2d('XReflection',true);
sz = size(data{1});
rout = affineOutputView(sz,tform);
data{1} = imwarp(data{1},tform,'OutputView',rout);
% Sanitize box data, if needed.
data{2} = helperSanitizeBoxes(data{2}, sz);
% Warp boxes.
data{2} = bboxwarp(data{2},tform,rout);
end