Harika22 commited on
Commit
d76ba39
·
verified ·
1 Parent(s): d0039ea

Update pages/7_Unstructured_data.py

Browse files
Files changed (1) hide show
  1. pages/7_Unstructured_data.py +14 -0
pages/7_Unstructured_data.py CHANGED
@@ -462,6 +462,20 @@ if file_type == "IMAGE":
462
  - +ve which is downwards
463
  - -ve which is upwards
464
  ''')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
465
 
466
 
467
 
 
462
  - +ve which is downwards
463
  - -ve which is upwards
464
  ''')
465
+
466
+ st.code('''
467
+ import cv2
468
+ ## creation of translation matrix
469
+ tx = 100
470
+ ty = 100
471
+ t_m = np.array([[1,0,tx],[0,1,ty]],dtype=np.float32)
472
+ t_img = cv2.warpAffine(img,t_m,(2560,1600),borderMode=cv2.BORDER_CONSTANT,borderValue=(0,0,0))
473
+ ## save and display the image
474
+ cv2.imshow("org_img",img)
475
+ cv2.imshow("trans_img",t_img)
476
+ cv2.waitKey()
477
+ cv2.destroyAllWindows()
478
+ ''')
479
 
480
 
481