affine_translate
result = affine_translate(dx, dy)
Input: dx, dy · Output: result
What it is
dx/dy are numbers, the horizontal/vertical shift amount.
Overloads
One call shape — this function is not overloaded.
| Code | Input | Output | Description |
result = affine_translate(dx, dy) | dx numbernot documented yetdy numbernot documented yet | result Mat | Returns a new 3x3 homogeneous-coordinate Mat encoding that translation. |
Examples
From the documentation, and run by the build -- the output and the figure below are what the engine actually produced. Simplest first.
img = load_image("sample.bmp")
# Rotate 30 degrees about the origin, then shift right/down by (50, 20).
M = affine_translate(50, 20) * affine_rotate(30)
out = imwarp(img, M, method="bilinear", bbox="loose", fill=255)
imshow(out)
from images