import cv2
import numpy as np
#print([x for x in dir(cv2) if x.startswith('COLOR_')])
img=cv2.imread('../data/apple.jpg')
h,w=img.shape[:2]
print((w,h))

src_points=np.float32([[0,0],[w-1,0],[0,h-1]])
dest_points=np.float32([[0,int(0.1*h)],[int(0.7*w),int(0.2*h)],[int(0.2*w),int(0.67*h)]])
affine_matrix=cv2.getAffineTransform(src_points,dest_points)
img_output=cv2.warpAffine(img,affine_matrix,(w,h))
cv2.imshow('Image',img)

cv2.imshow('Output',img_output)
cv2.waitKey()

87958519506c321759a22435fb4e956db8102a36
<mask token>

<mask token>
print((w, h))
<mask token>
cv2.imshow('Image', img)
cv2.imshow('Output', img_output)
cv2.waitKey()

<mask token>
img = cv2.imread('../data/apple.jpg')
h, w = img.shape[:2]
print((w, h))
src_points = np.float32([[0, 0], [w - 1, 0], [0, h - 1]])
dest_points = np.float32([[0, int(0.1 * h)], [int(0.7 * w), int(0.2 * h)],
    [int(0.2 * w), int(0.67 * h)]])
affine_matrix = cv2.getAffineTransform(src_points, dest_points)
img_output = cv2.warpAffine(img, affine_matrix, (w, h))
cv2.imshow('Image', img)
cv2.imshow('Output', img_output)
cv2.waitKey()

import cv2
import numpy as np
img = cv2.imread('../data/apple.jpg')
h, w = img.shape[:2]
print((w, h))
src_points = np.float32([[0, 0], [w - 1, 0], [0, h - 1]])
dest_points = np.float32([[0, int(0.1 * h)], [int(0.7 * w), int(0.2 * h)],
    [int(0.2 * w), int(0.67 * h)]])
affine_matrix = cv2.getAffineTransform(src_points, dest_points)
img_output = cv2.warpAffine(img, affine_matrix, (w, h))
cv2.imshow('Image', img)
cv2.imshow('Output', img_output)
cv2.waitKey()

import cv2
import numpy as np
#print([x for x in dir(cv2) if x.startswith('COLOR_')])
img=cv2.imread('../data/apple.jpg')
h,w=img.shape[:2]
print((w,h))

src_points=np.float32([[0,0],[w-1,0],[0,h-1]])
dest_points=np.float32([[0,int(0.1*h)],[int(0.7*w),int(0.2*h)],[int(0.2*w),int(0.67*h)]])
affine_matrix=cv2.getAffineTransform(src_points,dest_points)
img_output=cv2.warpAffine(img,affine_matrix,(w,h))
cv2.imshow('Image',img)

cv2.imshow('Output',img_output)
cv2.waitKey()
