3D Rotation image along specific axes
Rotate along X axis and translate 5 pixel along X axis
Rotate along XZ axis
Change main function with ideal arguments
python demo.py [path of the image] [degree to rotate] ([ideal width] [ideal height])
e.g., Example of rotating an image along yz-axis from 0 to 360 degree with a 5 pixel shift in +X direction
- rotated_img = it.rotate_along_axis(phi = ang, dx = 5)
+ #rotated_img = it.rotate_along_axis(phi = ang, dx = 5)
- #rotated_img = it.rotate_along_axis(phi = ang, gamma = ang)
+ rotated_img = it.rotate_along_axis(phi = ang, gamma = ang)
Then
python demo.py images/000001.jpg 360
it = ImageTransformer(img_path, img_shape)
it.rotate_along_axis(theta=0, phi=0, gamma=0, dx=0, dy=0, dz=0):
Code ported and modified from jepson and stackoverflow. Thanks for their excellent work!
Hou-Ning Hu / @eborboihuc