Guest User

Untitled

a guest
Jul 17th, 2018
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. // values in absolute pixels
  2. box = [y_min, x_min, y_max, x_max];
  3.  
  4. // Make points relative to image
  5. pct = [box[0] / height, box[1] / width, box[2] / height, box[3] / width];
  6. //^
  7. //|
  8. //+--------+
  9. // |
  10. // v
  11. rot90 = [pct[1], 1 - pct[2], pct[3], 1 - pct[0]];
  12. // ^
  13. // |
  14. // +--------+
  15. // |
  16. // v
  17. rot180 = [rot90[1], 1 - rot90[2], rot90[3], 1 - rot90[0]];
  18. // ^
  19. // |
  20. // +--------+
  21. // |
  22. // v
  23.  
  24. rot270 = [rot180[1], 1 - rot180[2], rot180[3], 1 - rot180[0]];
Add Comment
Please, Sign In to add comment