open source pkg v1

This commit is contained in:
Vijay Yadev
2020-08-04 19:12:31 -04:00
parent bef213dba9
commit c389fc2c47
3708 changed files with 1624220 additions and 1 deletions

View File

@@ -0,0 +1,15 @@
function [bbox_out] = rectify(bbox_in)
%convert bboxA to square
heights = bbox_in(:,4) - bbox_in(:,2);
widths = bbox_in(:,3) - bbox_in(:,1);
max_side = max([widths'; heights'])';
% Correct the starts based on new size
new_min_x = bbox_in(:,1) + 0.5 * (widths - max_side);
new_min_y = bbox_in(:,2) + 0.5 * (heights - max_side);
bbox_out = [new_min_x, new_min_y, new_min_x + max_side, new_min_y + max_side];
end