Skip to content

πŸ–πŸΎ Counting fingers of hands using digital image processing principles

Notifications You must be signed in to change notification settings

NeilFabiao/Counting-Fingers-DIP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

18 Commits
Β 
Β 
Β 
Β 

Repository files navigation

Basics of Counting Fingers

This project was done using Matlab, and in the Project folder there are 3 other subsequent folders namely:

  • Data - where all the images used in each implementation are located.
  • src - or source code where each implementation counts fingers in their own different way (temporarily removed until end of July).
  • output - where the output files are located when the projects are built.

Understanding the Process

To count the number of fingers given an image, first one needs to understand the principles of segmentation and connected component labelling. These are needed to be applied in a precise manner that allows the hand present in the image to once processed not leave undesired noise, and an example of steps is as follows:

  1. Read image and analyse pixel values in the histogram.
  2. Given that the image is already in black and white with two distinct pixel regions, a threshold with the mean of the histogram is applied.
  3. Complement the image, this is to make the hand or foreground white and the background pixels black this is done to easily see missing pixel values for the following step.
  4. Fill holes and open the resulting image, this is done such that pixel values in the hand are not lost after the threshold.
  5. Erode the image to achieve the palm of the hand and dilate the image to have restoration of palm to the original size of the original hand for the next step.
  6. After achieving the palm of the hand we can apply subtraction of the opened image in step 4 with palm image in step 5.
  7. When subtracting two images we now achieve the fingers of the image but since we still have some unwanted pixels from the subtraction erosion is applied to the resulting image.
  8. Once the image is eroded and only the fingers are left to identify the distinct regions with different pixel values the process of connected component labelling is done. This is to count pixels in the same region, which once found are labelled as fingers.

Note: On implementation3(not included in this repo), it was possible to achieve the same results with the use Kmeans or GMM (gaussian mixture model), clustering the image data with higher degree of efficiency (the type of image is always a factor to consider).

Visualization of Steps

alt-text-1 alt-text-2

References

  1. Digital Image Processing Lecturer @ Wits

  2. Gonzalez, R. C. Woods, R. E. (2018), Digital image processing.

  3. Github and google

  4. https://github.com/black-shadows

Who do I talk to?

  • Repo owner Neil FabiΓ£o -> @neilfabiao

Note: The card on the color section has expired 😁, the data is safe to use πŸ‘πŸΎ.

About

πŸ–πŸΎ Counting fingers of hands using digital image processing principles

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages