Skip to content
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

Create ellipse.py #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Create ellipse.py #4

wants to merge 2 commits into from

Conversation

bartkez
Copy link
Collaborator

@bartkez bartkez commented May 20, 2019

No description provided.

tasks/tasks/torpedoes/cv_solution/python_code/ellipse.py Outdated Show resolved Hide resolved
if (ratio > 1.5) and (ratio < 2.5):
# if np.any(img[x0, y0] == 0):
ellipse = cv2.fitEllipse(cnt)
cv2.ellipse(self.img, ellipse, (0, 0, 255), 2)
Copy link
Collaborator

Choose a reason for hiding this comment

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

(0, 0, 255) export to a static variable (for example to ELLIPSE_COLLOR as tuple)


if ellipse_area:
if (circle_area / ellipse_area < MAX_TOL) and (circle_area / self.img_area() * 100 < MAX_TOL):
if (ratio > 1.5) and (ratio < 2.5):
Copy link
Collaborator

Choose a reason for hiding this comment

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

magic numbers

magic numbers as static values, method has been refactored according to guideline, imshow is now commented as there's no use of it
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