/Finger-Count-by-image-processing

Finger Count by image processing operations and math calculations

Primary LanguageJupyter Notebook

Finger-Count-by-image-processing

Strategy for counting fingers

  • Grab an ROI
  • Calculate a running average background value for 60 frames of video
  • Once avg value is found, then the hand can enter the ROI.
  • Set an ROI and calculate the average running value for some amount of frames.
    • image
  • Then once a hand enters, we can detect a change and apply thresholding.
    • ScreenShot_20210801191036
  • Once the hand enters the ROI, we will use a Convex Hull to draw a polygon around the hand.
    • image
  • Using some math, we ll calculate the center of the hand against the angle of outer points to infer finger count.
    • ScreenShot_20210801191120
  • First we will calculate the most extreme points (top, bottom, left, and right)
    • ScreenShot_20210801191458
  • We can then calculate their intersection and estimate that as the center of the hand
    • ScreenShot_20210801191515
  • Next we will calculate the distance for the point furthest away from the center
    • ScreenShot_20210801191541
  • Then using a ratio of that distance we create a circle
    • ScreenShot_20210801191611
  • Any points outside of this circle and far away enough from the bottom, should be extended fingers!
    • ScreenShot_20210801191622

Finger Count


project documentation

depend on Jose Portilla course