Replies: 1 comment
-
import albumentations as A
import numpy as np
import matplotlib.pyplot as plt
import cv2 as cv
img = np.full([100, 100, 3], 255, np.uint8)
t = A.Compose([
A.ShiftScaleRotate(
shift_limit_y=0,
# shift_limit_x=(0, 0.5), # shift right
shift_limit_x=(-0.5, 0), # shift left
p=1,
border_mode=cv.BORDER_CONSTANT,
value=0,
scale_limit=0,
rotate_limit=0,
)
])
plt.imshow(t(image=img)["image"])
plt.show() |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I want to shift my images only toward the right. So, I am using ShiftScaleRotate on an image with shift_limit_x. But the image is shifting in both the x and y directions. How can I shift it only towards the right?
Beta Was this translation helpful? Give feedback.
All reactions