element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
STEM Projects
  • Learn
  • Learning Center
  • STEM Academy
  • STEM Projects
  • More
  • Cancel
STEM Projects
Blog Blog #6: Hand Detection Module
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join STEM Projects to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Former Member
  • Date Created: 28 Sep 2015 7:51 AM Date Created
  • Views 578 views
  • Likes 1 like
  • Comments 2 comments
  • question_sensor
  • teachers_pet
  • teachers pet robotics design challenge
Related
Recommended

Blog #6: Hand Detection Module

Former Member
Former Member
28 Sep 2015

From the previous module, we know where the students are sitting. So we have rough estimate of the hand location of each student.

 

Challenges:

1. Students sitting in front of the classroom appear bigger than the students at the back, so the size of the hands isn't uniform for everyone.

2. Some students are left and some are right handed, so we cannot assume anything here and need to look for both hands for every student.

3. Occlusion is a big problem for students sitting at the back benches. They might get occluded completely from the camera's view and would be quite tough to detect if they raise their hands.

 

Assumptions:

1. Hand is raised for more than a second (it correlates directly with the FPS of the image acquisition)

2. Camera is well positioned to capture the whole class (in bigger classes there might be issues on boundaries), this is important for some applying some heuristics which I'll explain later.

3. Students don't move during the class, it is easy to handle this scenario. But due to limited scope of my project I'll use this assumption.

 

Approach:

1. Pre-processing Step (using heuristics):

This is again needed for making the whole system work fast and give robust results. Some Heuristics like

     i. remove faces at the ceiling/borders as they are most likely false positives

     ii. aspect ratio of faces is approximately fixed, use it to filter other negatives.

 

2. Background Subtraction Stage:

     Detecting and even like raising hands is an easy event in our scenario as we have the frames grabbed at every second. Hence if we just do a local background subtraction (near the previously found faces) then we know where the pixels have changed the intensity. The only thing to figure out is that whether it was a hand or not !

Diff_image = Current_frame - Previous_frame

 

3. Post-processing Stage:

The difference image isn't smooth due to the following reasons

     i. light changes in the image capture creates a non-zero value at each pixel

     ii. small movements of student's head or body creates a silhouette in background image

 

Above reasons are quite important to handle to get a proper detection of raised hand. To remove small pixel values and clusters/blobs of small patches, I used a simple morphological processing of erosion of image frames using a simple 'disk' as structuring material (Not going in details here). This step also helps in removing small movements of the body of students. I also used a heuristic of face location and hand's relative positioning which helps me in avoiding other background pixels being processing and hence I don't care about the values in those areas.

 

4. Hand Detection:

This part is the main think-tank of the whole system.

Main logic can again be divided into following parts

1. Use the size of the face to locate an approximate region of interest for both hand (I'll provide details later)

2. Use the above regions and check the value of post-processed difference image pixels in those locations. If there is a high sum value in the LHand or RHand region then the student has raised his/her hand.

3. To avoid the double counting of hands in similar region, I set the difference image pixels to zero after the above sum is calculated in the region.

Here is a snippet of the approach

image

 

5. Interesting scenario:

     Background Image logic of hand detection can get flawed if I use absolute difference of the images, as it will have high values during the hand raising and hand dropping instants. Initially, I didn't thought about this scenario and was getting twice detection. Later, I changed the logic to just calculate the image difference and ignore the negative pixels. This simple hack solves the problem at minimal cost/analysis.

  • Sign in to reply
  • Former Member
    Former Member over 9 years ago in reply to DAB

    They were, we had loads of fun while recording !

    I'll share a fun video when everyone started a dance move while raising hands alternately image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 9 years ago

    The students look so thrilled to be on camera.

     

    DAB

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube