MCPcopy Create free account
hub / github.com/PyImageSearch/imutils / translate

Function translate

imutils/convenience.py:17–23  ·  view source on GitHub ↗
(image, x, y)

Source from the content-addressed store, hash-verified

15 from urllib.request import urlopen
16
17def translate(image, x, y):
18 # define the translation matrix and perform the translation
19 M = np.float32([[1, 0, x], [0, 1, y]])
20 shifted = cv2.warpAffine(image, M, (image.shape[1], image.shape[0]))
21
22 # return the translated image
23 return shifted
24
25def rotate(image, angle, center=None, scale=1.0):
26 # grab the dimensions of the image

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…