Skip to content

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

Merged
merged 3 commits into from
Oct 22, 2019

Conversation

matheustguimaraes
Copy link
Contributor

No description provided.

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")
Copy link
Member

@cclauss cclauss Oct 22, 2019

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")

Copy link
Contributor Author

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):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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!

Copy link
Member

@cclauss cclauss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thanks.

@cclauss cclauss merged commit 5fd868c into TheAlgorithms:master Oct 22, 2019
stokhos pushed a commit to stokhos/Python that referenced this pull request Jan 3, 2021
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants