Advertisement
Guest User

Untitled

a guest
Oct 18th, 2018
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.71 KB | None | 0 0
  1. import cv2
  2. import numpy as np
  3.  
  4. img = cv2.imread("2.PNG",0)
  5. rows, cols = img.shape
  6. shearTst = np.zeros((rows,cols*2,0 ),np.uint64)
  7.  
  8.  
  9.  
  10.  
  11. if img is None:
  12.     print('No image loaded')
  13.     exit()
  14.  
  15. Bx = 0.5
  16. By = 0.0
  17. x = 0
  18. y = 0
  19. r1 = 0
  20. c1 = 0
  21.  
  22. #array set 3x3
  23.  
  24.  
  25. arrayset = np.array(
  26.             [[1,Bx,0],
  27.             [By,1,0],
  28.             [0,0,1]])
  29.  
  30.  
  31.  
  32.  
  33. print(arrayset)
  34. for r in range (0,img.shape[0]):
  35.     for c in range (0, img.shape[1]):
  36.         r1 = r + c * By - x;
  37.         c1 = r * Bx + c - y
  38.         shearTst[r,c]
  39.         shearTst
  40.  
  41.  
  42.  
  43. print(r)
  44. print(c)
  45. print(r1)
  46. print(c1)
  47.  
  48.  
  49. print(img)
  50. print(shearTst)
  51.  
  52.  
  53. cv2.imshow('shearTst',shearTst)
  54. cv2.imshow('norm',img)
  55. cv2.waitKey(0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement