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