-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add feature to capture gesture images #2
base: master
Are you sure you want to change the base?
Conversation
@@ -0,0 +1,47 @@ | |||
import os | |||
import sys | |||
import cv2 |
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.
Order imports alphabetically.
|
||
|
||
def main() : | ||
|
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.
Remove empty line.
imageName = input("Enter the image name") | ||
|
||
cap = cv2.VideoCapture(0) | ||
rootName = 'HandGestures/' + gestureClass |
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.
Use os.path.join
. Joining using /
is always a bad idea.
path = os.path.join("./", rootName) | ||
print(path) | ||
|
||
cv2.imwrite(path+"/{}{}.jpg".format(imageName, currentFrame), frame) |
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.
Same comment, use os.path.join
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.
Also, remove unnecessary new lines. What editor do you use? You can generally find these exceptions using a linter like flake8/pep8 while writing code. Try installing one of those.
No description provided.