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.
21 lines
528 B
Matlab
21 lines
528 B
Matlab
2 years ago
|
function data = augmentData_stepthree(data)
|
||
|
% Randomly flip images and bounding boxes horizontally.
|
||
|
tform = randomAffine2d('XReflection',true);
|
||
|
sz = size(data{1});
|
||
|
rout = affineOutputView(sz,tform);
|
||
|
|
||
|
% jitter
|
||
|
data{1} = jitterColorHSV(data{1},...
|
||
|
Contrast=0.2,...
|
||
|
Hue=0,...
|
||
|
Saturation=0.1,...
|
||
|
Brightness=0.2);
|
||
|
|
||
|
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
|