Harika22 commited on
Commit
e8808fa
·
verified ·
1 Parent(s): 658d629

Update pages/7_Unstructured_data.py

Browse files
Files changed (1) hide show
  1. pages/7_Unstructured_data.py +25 -1
pages/7_Unstructured_data.py CHANGED
@@ -533,9 +533,33 @@ if file_type == "IMAGE":
533
  $$
534
  I(x,y) \cdot Scaling matrix = I'(x',y')
535
  $$
 
 
536
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
537
  ''')
538
-
539
 
540
 
541
 
 
533
  $$
534
  I(x,y) \cdot Scaling matrix = I'(x',y')
535
  $$
536
+ - **Scaling matrix:**
537
+ - [Sx 0 Tx
538
 
539
+ 0 Sy Ty]
540
+ - Sx is how much we can scale on x-axis
541
+ - Sy is how much we can scale on y-axis
542
+ - Formula:
543
+ $$
544
+ x' = x + shearX \cdot y \\
545
+ y' = y + shearY \cdot x
546
+ $$
547
+ ''')
548
+ st.code('''
549
+ import cv2
550
+ ## creation of scaling matrix
551
+ sx = 0.3
552
+ sy = 0.3
553
+ tx = 0
554
+ ty = 0
555
+ sc_m = np.array([[sx,0,tx],[0,sy,ty]],dtype=np.float32)
556
+ ## save and display the image
557
+ scale_img = cv2.warpAffine(img,sc_m,(2560,1600))
558
+ cv2.imshow("org_img",img)
559
+ cv2.imshow("scaled_img",scale_img)
560
+ cv2.waitKey()
561
+ cv2.destroyAllWindows()
562
  ''')
 
563
 
564
 
565