GMU:Tutorials/Performance Platform/Capture with Processing: Difference between revisions

From Medien Wiki
Line 10: Line 10:


[[File:blobDetect1.jpg]]
[[File:blobDetect1.jpg]]
'''Code in Processing'''


==Webcam Setup of the DBL==
==Webcam Setup of the DBL==

Revision as of 15:21, 30 July 2016

Introduction

My purpose of this tutorial is about how to calculate the amounts of people in the platform. And due to this platform system is not specifically structured to count the amounts of people, I decide to set my own webcam as an external set to count the amounts of people in a area that my webcam is able to capture.

The tracking system in the lab of course can count the amount of people due to the capture of skeleton of people somehow, however, it has a limitation that only two or three can be counted. So, you can also choose to use the tracking system to count the people if you only want to count the people less than three.

Algorithm of calculation

There are many ways for the computer vision to calculate the capture area to serve for your purpose. To calculate the amounts of people, you may use face detection or blob detection. Here, I am going to use blob detection cause there exists the case someone who will walk in front of somebody, then the face will not be well detected by the webcam. Blob detection will be great to calculate the amounts of people if we are going to set the webcam on the roof of lab, so that every person that inside the capture area will be detected as a blob.

BlobDetect1.jpg

Code in Processing

Webcam Setup of the DBL

Hanging of Webcam

Hanging webcam on the roof in DBL is not so difficult, you can use the staircase and plastic cable zip to install it on the silver beam, but PLEASE do remember to put the paperboard to under the staircase to make sure not destroy the platform.

WebcamSet-01.jpg

WebcamSet-02.jpg

WebcamSet2.jpg

Hardware: Webcam

Due to the height of DBL lab is only around 2.5 meters, so when a normal webcam is set on the roof, the capture area is quite limited. I tried with several cheap webcams I can get:

1: fitTek[1] which is fine and cheap to test with blob detection, but it is not so stable and accurate cause its low resolution.

2: Logitech C270[2] which is not so expensive with high resolution and wide angle display.


Software: Logitech Camera Settings

Since I decided to use Logitech C270, I found there will have a problem to drive it in Mac OS. It is totally fine if you are using PC, you can download the driver for your PC here:[3] For who are using Mac OS, you can go to app store and download the app called: Logitech Camera Settings. It is quite useful and you can use it to set Logitech webcam as your webcam input source in your mac laptop, more importantly, you can use it to change the settings of your external Logitech webcam, such as: Brightness; Contrast; Color Intensity; White Balance, which will be very useful to have a better settings for blob detection.


Blob Detection with default settings

WebcamTest3.jpg

Blob Detection with customized settings

WebcamTest4.png

You can change the webcam settings to better serve for your blob detection according to the light environment, hence, you will have more accurate result about the amount of visitors in the capture area.

Limitation

Blob detection is still not the most accurate one to calculate the amount of visitors, but it works somehow in this case, you need to adjust the webcam settings and the light environment in the platform. For the light environment, more bright the background is, there will have stronger pixel difference to be better for the blob detection. And please pay attention to the shadows caused by light, the shadows will also be captured by the webcam, if the shadows are not well controlled, they will interfere the accuracy to calculate.

I was once planning to also set up a spotlight in the platform to test my project, then I found the shadows are big factors in calculating the blobs.

Limit-08.jpg

Limit-07.jpg

Limit-09.jpg