-
-
Notifications
You must be signed in to change notification settings - Fork 46.8k
Add algorithm to rotate images #1420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
fig = plt.figure(1) | ||
titles = ["Original", "Rotation 1", "Rotation 2", "Rotation 3"] | ||
for i in range(0, len(images)): | ||
plt.subplot(2, 2, i + 1), plt.imshow(images[i], "gray") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for i, image in enumerate(images):
plt.subplot(2, 2, i + 1), plt.imshow(image, "gray")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added enumerate in loop.
import cv2 | ||
|
||
|
||
def get_rotation(img, pt1, pt2, rows, cols): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Type hints? https://docs.python.org/3/library/typing.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added type hints in get_rotation(). Thanks for the help!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Thanks.
* Add algorithm to rotate image * Edit function to be compliant in Black and Flake8 formats * Add type hints in get_rotation() and enumerate() in loop
No description provided.