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

Added finger counter #861

Merged
merged 10 commits into from May 13, 2021
Merged

Conversation

mehabhalodiya
Copy link
Contributor

@mehabhalodiya mehabhalodiya commented Apr 9, 2021

Description

  • Initially, I had gone through hand tracking and then I had used the hand landmarks to count of the fingers.
  • All of this is happening in realtime and requires close to no installations and configurations.
  • I have used OpenCV, along with some built-in modules of python like time and os.

Fixes #817

Finger counter using hand tracking

Have you read the Contributing Guidelines on Pull Requests?

  • Yes
  • No

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code follows the style guidelines(Clean Code) of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have created a helpful and easy to understand README.md
  • My documentation follows Template for README.md
  • My changes generate no new warnings
  • I have added tests/screenshots(if any) that prove my fix is effective or that my feature works.

Project Metadata

If there is no-file/nothing to fill the below fields with, then type: none

Example: If no requirements.txt needed/present then type in Requirments none => Requirments: none

Category:

  • Calculators
  • AI/ML
  • Scrappers
  • Social_Media
  • PDF
  • Image_Processing
  • Video_Processing
  • Games
  • Networking
  • OS_Utilities
  • Automation
  • Cryptography
  • Computer_Vision
  • Fun
  • Others

Title: Finger Counter using hand tracking

Folder: Finger-Counter

Requirements: requirements.txt

Script: finger_counter.py

Arguments: none

Contributor: mehabhalodiya

Description: A system that detects a human hand, segments the hand, counts the number of fingers being held up, and displays the finger count, from live video input.

@mehabhalodiya
Copy link
Contributor Author

I need some help like confirmation if it is working as I got a sudden problem like stuck somewhere and messed up all!

Can you please check from your side? @kaustubhgupta @santushtisharma10
Kindly help me.

Let me know if it's working well or else suggest me changes. I will go through that.
Afterwards I will create README.md file.

Copy link
Contributor

@kaustubhgupta kaustubhgupta left a comment

Choose a reason for hiding this comment

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

Minor change, else it worked at my end

cap.set(3, wCam)
cap.set(4, hCam)

folderPath = "FingerImages"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
folderPath = "FingerImages"
folderPath = "./Finger-Counter/FingerImages"

@kaustubhgupta kaustubhgupta added draft-pr This is draft-pr and not the final PR to be merged minor-change-not-bug Suggested a minor change in code, not a bug labels Apr 12, 2021
@mehabhalodiya mehabhalodiya marked this pull request as ready for review April 12, 2021 06:13
@mehabhalodiya
Copy link
Contributor Author

I will create a README.md file for this by tomorrow.

@kaustubhgupta kaustubhgupta removed the draft-pr This is draft-pr and not the final PR to be merged label Apr 13, 2021
Copy link
Contributor

@kaustubhgupta kaustubhgupta left a comment

Choose a reason for hiding this comment

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

Create the readme for this

@mehabhalodiya
Copy link
Contributor Author

@kaustubhgupta @santushtisharma10 @antrikshmisri Kindly review this.


<br>

### Hand tracking in real time
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
### Hand tracking in real time
## Hand tracking in real time


<br>

### Finger counter
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
### Finger counter
## Finger counter

@kaustubhgupta kaustubhgupta added the next review needed Approved by some mentors, more approvals needed label Apr 14, 2021
@antrikshmisri
Copy link
Contributor

@mehabhalodiya This code is exactly the same as this code on stackoverflow, unless it was asked by you. @kaustubhgupta @santushtisharma10

@mehabhalodiya
Copy link
Contributor Author

@mehabhalodiya This code is exactly the same as this code on stackoverflow, unless it was asked by you. @kaustubhgupta @santushtisharma10

Hello @antrikshmisri , I wasn't also aware of which you have provided the link like it exists there.
Actually I have gone through all steps and so understood it well that how it works! Even if you feel this wrong then you can suggest me changes.

I understand your point. Since my Code looks too similar, you can suggest/tell for some changes. So that you can verify whether I understand things fully, by refactoring a few parts.

This is my sincere request as I haven't copied from there.
Hope you will understand.

@kaustubhgupta
Copy link
Contributor

@antrikshmisri yes the code is way too similar. I think we should give @mehabhalodiya one more chance to improve upon the code as she has a good history of contributions (9 PRs merged: https://github.com/avinashkranjan/Amazing-Python-Scripts/pulls?q=is%3Apr+author%3Amehabhalodiya+is%3Aclosed)

@santushtisharma10 @antrikshmisri should we give her the chance?

@kaustubhgupta kaustubhgupta added hold Needs a second thought and removed minor-change-not-bug Suggested a minor change in code, not a bug next review needed Approved by some mentors, more approvals needed labels Apr 15, 2021
@mehabhalodiya
Copy link
Contributor Author

You all mentors can suggest me changes in this script, I will do that as per your instructions.
Asking to all three of you for some guidance in this so that I can perform it as you want me to do.
Kindly requesting to suggest me something in this.

@santushtisharma10
Copy link
Contributor

I agree, we should give her chance

@antrikshmisri
Copy link
Contributor

@kaustubhgupta Sure, we can her another chance based on her contributions. @mehabhalodiya Either restructure your code entirely or you can come up with some new features for it.

@mehabhalodiya
Copy link
Contributor Author

@kaustubhgupta Sure, we can her another chance based on her contributions. @mehabhalodiya Either restructure your code entirely or you can come up with some new features for it.

Yes, thank you for understanding me.
But I am stuck now like what should be modified?
Any of you can suggest me some changes as I am not knowing what to do further?
I need some help like @kaustubhgupta helped me in Youtube Video Downloader script.
Waiting for your response.

@mehabhalodiya
Copy link
Contributor Author

Kindly let me know if you want any changes because I myself don't know.
So asking to you all.

@mehabhalodiya
Copy link
Contributor Author

If you feel that it's good to go then please inform me.
If you are not satisfied with this then I will work until and unless you will guide me.
Awaiting...

@kaustubhgupta
Copy link
Contributor

Hi @mehabhalodiya,
The hand tracking module can't be changed that much. For the finger counting module, wrap your code in a class (as done in handtracking)

@mehabhalodiya mehabhalodiya marked this pull request as ready for review May 5, 2021 07:08
Comment on lines 68 to 70
cv2.imshow("Image", img)
cv2.waitKey(1)

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
cv2.imshow("Image", img)
cv2.waitKey(1)
cv2.imshow("Image", img)
if cv2.waitKey(1) == ord('q') :
break
cv2.destroyAllWindows()

Copy link
Contributor

Choose a reason for hiding this comment

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

@mehabhalodiya the script is working on my local system, just add these final changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for helping me wherever I got stuck :)

@santushtisharma10 santushtisharma10 added the next review needed Approved by some mentors, more approvals needed label May 6, 2021
@kaustubhgupta kaustubhgupta removed the hold Needs a second thought label May 6, 2021
@santushtisharma10
Copy link
Contributor

@antrikshmisri

@kaustubhgupta kaustubhgupta requested review from antrikshmisri and removed request for antrikshmisri May 8, 2021 04:10
@kaustubhgupta kaustubhgupta added Approved PR Approved and Ready to Merge gssoc23 Issues created for/by the GirlScript Summer of Code'23 Participants level2 Bug fixing, Adding small features and removed next review needed Approved by some mentors, more approvals needed labels May 8, 2021
Copy link
Contributor

@kaustubhgupta kaustubhgupta left a comment

Choose a reason for hiding this comment

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

@mehabhalodiya Add the requirements.txt file and update the PR template with project metadata. Look at this PR for reference: #1002

@kaustubhgupta kaustubhgupta added hold Needs a second thought and removed Approved PR Approved and Ready to Merge labels May 11, 2021
@kaustubhgupta
Copy link
Contributor

Update the PR template too

@mehabhalodiya
Copy link
Contributor Author

Update the PR template too

Updated!

@kaustubhgupta kaustubhgupta added Approved PR Approved and Ready to Merge and removed hold Needs a second thought labels May 11, 2021
@kaustubhgupta kaustubhgupta merged commit 10a3eed into avinashkranjan:master May 13, 2021
@kaustubhgupta kaustubhgupta added manual-db-update-req The PR was merged but db was not updated. Need to update the database manully and removed manual-db-update-req The PR was merged but db was not updated. Need to update the database manully labels May 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved PR Approved and Ready to Merge gssoc23 Issues created for/by the GirlScript Summer of Code'23 Participants level2 Bug fixing, Adding small features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Finger Counter using Hand Tracking
4 participants