Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // values in absolute pixels
- box = [y_min, x_min, y_max, x_max];
- // Make points relative to image
- pct = [box[0] / height, box[1] / width, box[2] / height, box[3] / width];
- //^
- //|
- //+--------+
- // |
- // v
- rot90 = [pct[1], 1 - pct[2], pct[3], 1 - pct[0]];
- // ^
- // |
- // +--------+
- // |
- // v
- rot180 = [rot90[1], 1 - rot90[2], rot90[3], 1 - rot90[0]];
- // ^
- // |
- // +--------+
- // |
- // v
- rot270 = [rot180[1], 1 - rot180[2], rot180[3], 1 - rot180[0]];
Add Comment
Please, Sign In to add comment