<jupyter_start><jupyter_text>Image Translation  Import Libraries<jupyter_code>import cv2
import numpy as np
# Read/load Imput image
input_image = cv2.imread(r'D:\Computer Vision Bootcamp\images\expert.png')
cv2.imshow('Orginal Image', input_image )
cv2.waitKey(5000)
cv2.destroyAllWindows()
# Extract height and width from image
height, width = input_image.shape[:2]
print(height,width)
print("===========")

# Translate the height and width of the image to 1/4
height_fourth, width_fourth = height/4, width/4

# Translation matrix T
T = np.float32([[1,0,height_fourth],[0,1,width_fourth]])

# Printing the value of translation matrix
print(T)

# Using warpAffine to transform the image using the translation matrix, T
translation = cv2.warpAffine(input_image, T, (width,height))

# Showing the image
cv2.imshow('Translation', translation)
cv2.waitKey()
cv2.destroyAllWindows()<jupyter_output>512 512
===========
[[  1.   0. 128.]
 [  0.   1. 128.]]
StarcoderdataJupyterStructuredCleanDedup