Advertisement
dan-masek

Untitled

Oct 17th, 2018
348
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)] on win32
  2. Type "help", "copyright", "credits" or "license" for more information.
  3. >>> import numpy as np
  4. >>> import cv2
  5. >>> a = np.arange(5*5).reshape(5,-1)
  6. >>> a
  7. array([[ 0, 1, 2, 3, 4],
  8. [ 5, 6, 7, 8, 9],
  9. [10, 11, 12, 13, 14],
  10. [15, 16, 17, 18, 19],
  11. [20, 21, 22, 23, 24]])
  12. >>> cv2.resize(a, (0, 0), fx=0.5, fy=0.5, interpolation=cv2.INTER_NEAREST)
  13. array([[ 0, 2],
  14. [10, 12]])
  15. >>> a = np.arange(4*6).reshape(4,-1)
  16. >>> a
  17. array([[ 0, 1, 2, 3, 4, 5],
  18. [ 6, 7, 8, 9, 10, 11],
  19. [12, 13, 14, 15, 16, 17],
  20. [18, 19, 20, 21, 22, 23]])
  21. >>> cv2.resize(a, (0, 0), fx=0.5, fy=0.5, interpolation=cv2.INTER_NEAREST)
  22. array([[ 0, 2, 4],
  23. [12, 14, 16]])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement