APeC: Automated People Counting from Video Georgino P. Adriano, Sarah Isabel V. Mendoza, Francesca Nicole J. Montinola and Prospero C. Naval, Jr. Computer Vision & Machine Intelligence Group Department of Computer Science College of Engineering University of the Philippines-Diliman

[email protected] ABSTRACT APeC is a video monitoring system that is used to count the number of people passing through a monitored area. A single camera is placed directly above the door to get the clear top view of the people passing with minimum of occlusion. Frames are extracted from video and the pixels of each frame are submitted to a Self-Organizing Map for classification as head or non-head. Connected component analysis is performed on the classified pixels to cluster them into different regions then size constraints are imposed on the regions to eliminate noise. The coordinates of each blob’s centroid are computed to identify its location and to which region the blob belongs (top, middle, or bottom). The Euclidean distance between blobs from the current and previous frames is then computed. A blob from the previous frame will be matched with another blob from the current frame if they have minimum Euclidean distance. Matching blobs represent the same person present in those frames. A particular blob will be counted if and only if it has passed through the three regions consecutively. Experiments show that our system is relatively robust even when there are shadows in the video.

1.

INTRODUCTION

Counting and monitoring human traffic is very valuable in many applications. It is a useful tool in estimating the resources needed in carrying out certain tasks. Understanding people flow pattern, for example, will be beneficial in mapping market strategies. It may also provide information for human activity analysis as well as help in providing research statistics useful for surveys. It could also be used in other fields like surveillance. The easiest and least complicated way of monitoring people is by manual counting. This method can be done along an entrance by an individual who is counting the number of people coming in or out. However simple this may be, it is a tedious and error-prone task. An automated system for counting people is the alternative to manual counting. Numerous systems are available coming in a wide variety of implementations and utilizing different kinds of technology such as infrared rays, binocular cameras, omni-directional cameras and image sensor systems. Infrared and laser systems have difficulty monitoring people entering simultaneously. Image processing systems encounter problems such as occlusion and quick illumination

changes, which affect the accuracy of people detection and counting. On the other hand, a network of image sensors can handle small crowds and count in real time but requires at multiple cameras. [4]. Although some of these systems claim to have achieved up to 80%-96% reliability [6], these systems might just be too expensive. Such systems will not be appropriate for small scale applications (i.e, in convenient stores, school libraries). Automated people counting thru image processing is not a simple task because people detection proves to be a difficult problem. The fact that people assume different shapes and sizes makes it challenging to define a single model as reference. Other systems use motion filtering to detect moving objects [7] instead. In addition to varying visual appearance is the problem of of occlusion. Existing systems dealt with occlusion using image segmentation and point feature tracking [5] where the system will look for certain components instead of looking at the whole picture. The goal of this system is to automate the counting of people. We want an accurate and reliable automated counting system that is sufficient for big scale applications yet reasonably priced and appropriate for small scale purposes as well.

2.

PEOPLE DETECTION MODULE

The goal of people detection is to be able to differentiate people from other objects present in each frame of the video stream. A single camera is placed directly above the door frame to capture the video from the top view. A person in each frame is represented by his head. The process is divided into 3 phases. First, pixels are classified under two distinct classes, head and non-head, using SOM PAK [1]. Afterwards, a connected component algorithm clusters the head pixels into regions. Finally, the components are filtered thru size constraints to eliminate noise and leave us with the blobs.

2.1

Detecting Hair

Hair detection utilizes SOM PAK, a C++ package, that classifies values to different equivalence classes defined by the feature map. This carries out the classification of each frame’s pixels into head and non-head. The first step involves training SOM PAK’s feature map based on the specific area the program will run. A training set of RGB values of hair and non-hair pixels is given. We utilize an 8 × 8

Figure 3: Classified regions after implementing connected components

which it counts the number of pixels belonging to each region. Regions lying within our given threshold become a head candidate which we call a ”blob.” Choosing a threshold is a balance between filtering too little noise or including unnecessary dark areas. We defined a range that accepts the blobs that represent human heads. Figure 1: System Overview SOM neural network. After training, each pixel vector is presented to the network. Let X be an input data vector. It may be compared with the Mi in any metric; the smallest of the Euclidean distances k X − Mi k is usually made to define the best-matching code, signified by the subscript c. Thus X is mapped onto the ”winning” node c relative to the parameter values Mi [1]. The given output by SOM PAK is further mapped into a head or non-head label.

2.2

Connected Components

Connected components algorithm involves labeling a set of pixels in which each pixel is connected to all other pixels. Every set of pixels is called region. Connected components labeling scans the labeled array and groups its pixels into regions based on its connectivity and label. Once all groups have been determined, each pixel is labeled with a region number (color labeling) according to the region it was assigned to. Connected component labeling works by scanning an image, pixel-by-pixel (from top to bottom, left to right) in order to identify connected pixel regions, i.e. regions of adjacent pixels which share the same set or RGB values V.

Figure 4: After size constraints are applied, regions not lying within the given threshold are eliminated from the image.

3.

3.1 Figure 2: Image with pixels classified as hair and non-hair pixels after SOM PAK.

2.3

Size Constraints

As a final step in people detection, the regions from the previous phase are filtered to eliminate noise and leave us with the blobs. A scan is made through the array during

PEOPLE COUNTING MODULE

The screen is first horizontally divided into 3 zones. The top (1) and bottom (3) areas are called the alerting zones, and the middle area (2) the tracking zone [3]. The algorithm tracks each blob (head) by computing the centroid and storing the current zone the blob is located according to its position. The blobs of the current frame will then be matched with the blobs of the previous to be able to track where the blobs had moved. A history of the zones each blob has gone to will be stored. When a blob passes continuously on all three zones, a counter will be incremented depending on the direction of the blob. If a certain blob does not move for a very long time, the inactivity counter will be incremented. When a certain blob is inactive or does not move its position for a certain period of time, it will be removed from the queue.

Blob Location

People detection performs connected component analysis on all the detected head pixels on a single frame where each region will pass through a threshold to eliminate the noise, head pixel clusters that are too few will not pass as heads, in the image. After the people detection phase, we are able to identify the blobs present in each frame. Next step is to compute the

coordinates of the centroid for each blob that passed the threshold, as shown in Fig. 6. The following equations yields the X and Y coordinates given that (x, y) ∈ C and N = number of pixels in the connected component: X ¯ = 1 X x N C 1 X Y¯ = y N C

3.2

Blob Tracking and Counting

1. Tracking is then performed by computing the Euclidean distance between all the blobs from the vector of the previous frame and the vector of the current frame. The blob distances are sorted in increasing order. 2. We traverse the list of distances and match the blobs starting from the smallest distance [3]. A blob can be given a partner only if it has not been previously matched. There is a one-to-one correspondence between blobs from the previous vector and the current vector, but it is not necessary to match all blobs. 3. Matched blobs represent the current state of previously identified blobs. After finding their matches, we update the old vector with the current coordinates and zone. 4. Unmatched blobs from the old vector represent blobs who were not detected in the current frame. Their idletime is incremented. Unmatched blobs from the new vector represent objects that have just entered the screen. They are added to the old vector. The temporary vector is emptied.

Figure 5: The X marks the centroid. The orientation of the camera assumes that people will be walking from top to bottom of the image or vice versa. On each screen is therefore three horizontal zones. The coordinates of the centroid then determines which zone the current blob is located. Fig. 6 shows the division of the image and the locations of the blobs’ centroids relative to the regions one blob is on the first region and the other blob is on the third region.

5. Once a blob has passed the alerting zone, through the tracking zone, and then to another alerting zone, a count is made [3]. We are able to determine the direction of the blob through its history tag. The history tag determines if the particular blob entered from the upper alerting zone or the lower alerting zone. When this blob passes the second alerting zone, it is immediately deleted from the vector. (If subsequent frames detect this blob, idletime will increment). 6. Blobs with a high idletime are either false heads or counted heads. Counted heads will accumulate idletime because these blobs will be leaving the screen, hence would no longer change its region. When their idletime reaches a certain value, they are deleted from the vector.

4. EXPERIMENTAL RESULTS 4.1 System Hardware and Software

Figure 6: Every blob’s region can be identified through the centroid’s location. Above, one blob is in the first region, and the other blob is on the second region.

We chose a top-view orientation of the camera because it provided a clear view of people passing through a certain area and minimized the cases of occlusion [3]. The camera was located at the same height as the top of the door hedge (Fig. 8).

After identifying the blob and determining its properties, an instance of the blob will then be created and will be stored in a temporary vector of all the blobs on the current frame. The properties stored are: its current zone, zone history, x and y coordinates of the centroid and the idletime tag. The table below illustrates these blobs: VECTOR Blob1 Blob2

Zone 1 2

History 1 2

¯ X 191 101

Y¯ 31 106

Idletime 0 0

Figure 7: Position of the Camera

Samples taken were transferred to a computer using a VGA capture card. For the time being, videos are captured using software bundled with the capture card (Matrox). There are future plans of integrating live video capturing with the system. The captured samples were saved in .avi format at 20 frames per second, and a size of 820 × 560 pixels which are used as inputs to our program. We implemented our system using Java 1.4 SDK, and used the Java Media Framework package to capture every frame from the video clip and reduce its size to 246 × 168 pixels. In using the SOM PAK, we incorporated this C++ package into our Java program by calling the commands of SOM PAK through Java. We tested the system on a computer having a Celeron 1.7 GHz processor and 256 Mb memory on a Windows XP platform. In capturing the images and producing the text file with the corresponding RGB values, the system did not run in real time. It only averaged 2 frames per second. This poor performance may be attributed to the size and resolution of the images captured and can be improved by taking the value of alternating pixels instead of every single one.

4.2

People Detection Module

In people detection, the system is moderately accurate in identifying the head pixels. The neural network was trained from sample values of hair pixels from the video clips we captured. Since the self organizing map classifies the pixels based on the RGB values, there are some cases where the system fails to identify the objects correctly (see Fig. 8, second frame).

• Non heads recognized by SOM PAK grouped together may also mimic heads when they are almost the same size and shape as heads. Examples are shadow areas and dark objects such as back packs. Applying a size constraint reduces the errors and limitations mentioned above. The size constraint limits the number of regions to those whose pixel count are within the given threshold. This eliminates the small regions and thus the noise, as well as the large regions which are probably shadow areas or non heads (see Fig. 8, fourth frame). However, it sometimes mistakenly identifies blobs that have the same size as heads but do not represent real heads or blobs which represent two objects but are identified as a single blob only.

4.3

• When a blob goes back and forth between two regions before exiting to the opposite side of its entry, • When a blob that represents a person is not identified in the current frame but is successfully identified in the previous and succeeding frames, • When an object from the background is wrongly identified as a blob. This will never be counted as a person because it does not travel through the regions and it will just accumulate idle time and will eventually be deleted.

Figure 8: From left: the original frame, after SOM PAK, after connected components, after size constraints The connected components algorithm further gives meaning to the classified pixels produced by SOM PAK. By grouping head-pixels in close proximity of one another, it gives an approximation of the objects present in the image. After this algorithm is applied to the image, a new image is produced now showing resulting different regions. We assigned every region a color for us to be able to determine the grouping of the regions. Our system was able to successfully group the head pixels by region (see Fig. 8, third frame). However, there are still some limitations to it.

• Small and insignificant spots in the image are grouped into a head region when we know very well that they are nothing but noise. • Dark objects near each other are identified as one region instead of separate regions. This happens when the head is located near a shadow or the door. It also happens when the person is wearing a dark colored shirt.

People Counting Module

The people counting module is moderately accurate in counting the people passing. Through the Euclidean distance computed between blobs from previous and current frames; it was able to correctly match the blobs that represented the same person. Tracking of a blob’s motion was possible through the blob’s characteristics such as current region, region history, x y coordinates and idle time. As output, it prints out the number of people passing in each direction (upwards or downwards), separately. The algorithm can also handle the following situations:

Mistakes in counting can be attributed to the false positives in the people detection module. Shadow pixels connected with a person’s blob affects the identification of the blob’s location in the frame. In effect, the blob’s region tracking is also affected.

5.

CONCLUSION AND FUTURE WORK

In this paper, we have shown that People detection can be achieved by applying image processing. In particular, SOM PAK, an implementation of self organizing map, was used in the initial phase of the detection. The neural network was trained to classify each pixel in the image as head and non-head. The labeled data will then be processed by the connected components algorithm to isolate each heads into regions. Based on the experimental results we defined a size constraint that will filter the image from noise and eliminate the objects mistakenly identified as heads. Thus, we were be able to localize each person passing below the single camera.

After the localization of heads the people counting process comes in. The first step is finding the position of the blobs in terms of its x and y coordinates. The centroid will be computed and would serve as a representation of the blobs’ location. Each frame was divided into three zones and each blob is labeled depending upon the region where their coordinates have been located. On the consecutive screen, each blob will be tracked/traced by matching a particular blob from the previous screen according to its Euclidean distance. The pair of blobs is considered as one person who has just change his/her position. A history tag is also updated so that we can keep track of the blobs’ zone history, or on what particular regions the blob has gone through. If a blob is able to pass through all three regions consecutively, then a counter will be incremented. This eliminates all cases of the fake head problem or the shadows that were sometimes identified as heads, because they will not move or pass through all the regions. Future work includes, integrating live video capture and optimizing the whole system so that it will run in real time.

6.

ACKNOWLEDGMENTS

We would like to thank Ms. Riza Batista for assistance during our people detection phase, especially in the Self Organizing Map algorithm and the connected components analysis.

7.

REFERENCES

[1] T. Kohonen, J. Hynninen, J. Kangas, and J. Laaksonen, “SOM PAK: The Self Organizing Map program package”, Technical Report A31, Helsinki University of Technology, Laboratory of Computer and Information Science, FIN-02150 Espoo, Finland, 1996. [2] R. Jain, et al., “Connected Components”, www.cs.unr.edu/˜bebis/CS791E/ Notes/ConnectedComponents.pdf. [3] G. Sexton, X. Zhang, G. Redpath, D. Greaves, “Advances in automated pedestrian counting”, University of Northumbria at Newcastle, England, CEM Systems. Northern Ireland. [4] S. Stillman, R. Tanawongsuwan, and I. Essa, “Tracking multiple people with multiple cameras”, College of Computing, GVU Center, Georgia Institute of Technology Atlanta, GA 30332-0280 USA [5] D. Moore, “A real-world system for human motion detection and tracking”, California Institute of Technology. June 5, 2003. [6] H. Goldstein, “People counting using image processing”, Technion - Israel Institute of Technology, Department of Computer Science, Advanced Programming Lab B. July 1999. [7] A. Branca, M. Leo, G. Attolico, and A. Distante, “People detection in dynamic images”, Istituto Elaborazione Segnali ed Immagini, Italy, 2002.

APeC: Automated People Counting from Video

Connected component analysis is ... people from other objects present in each frame of the video ... Afterwards, a connected component algorithm clusters the.

192KB Sizes 1 Downloads 157 Views

Recommend Documents

Real-Time People Counting Using Multiple Lines
system, achieving a correct people counting rate of. 95%. 1. ... task in order to increase security, to control capacity, or to design marketing ... We have developed a real-time system using a .... For every test the same low quality wireless CCTV.

Automated Detection of Engagement using Video-Based Estimation of ...
Abstract—We explored how computer vision techniques can be used to detect ... supervised learning for detection of concurrent and retrospective self-reported engagement. ...... [49] P. Ekman and W. V. Friesen, Facial Action Coding System: A ... [On

Real-Time People Counting Using Multiple Lines
is performed by analyzing an image zone composed by ... predefined observed area in an image. .... http://www.vicomtech.es/ingles/html/proyectos/index_p.

Automated Detection of Engagement using Video-Based Estimation of ...
Abstract—We explored how computer vision techniques can be used to detect engagement while ... supervised learning for detection of concurrent and retrospective self-reported engagement. ...... [Online]. Available: http://msdn.microsoft.com/en-us/l

Automated recognition of human activities in video ...
10.1117/2.1201405.005489. Automated recognition of human activities in video streams in real-time. Sebastiaan Van den Broek, Johan-Martijn ten Hove,.

Counting of service paid from contingencies.PDF
_-* i. (Dr,M,Raghavafih). General. Page 2 of 2. Counting of service paid from contingencies.PDF. Counting of service paid from contingencies.PDF. Open. Extract.

Counting of Service paid from contingencies.PDF
FileNo.27l20I1 (PNM). File No. 312013 (PNM). f. Page 2 of 2. Counting of Service paid from contingencies.PDF. Counting of Service paid from contingencies.

understanding mathematics from counting to calculus pdf
Whoops! There was a problem loading more pages. Retrying... understanding mathematics from counting to calculus pdf. understanding mathematics from ...

MOE APEC Scholarship Application Form_PDF.pdf
Whoops! There was a problem loading this page. MOE APEC Scholarship Application Form_PDF.pdf. MOE APEC Scholarship Application Form_PDF.pdf. Open.

Double Counting
3 Cool proofs using double counting. The following is a proof of Cayley's formula, which counts the number of trees on n distinct vertices. There are several other proofs of this fact (using bijection, linear algebra, and recursion), but the double c

Counting Project.pdf
173rd shape. Nth shape. Page 3 of 4. Counting Project.pdf. Counting Project.pdf. Open. Extract. Open with. Sign In. Main menu. Displaying Counting Project.pdf.

Double Counting
If there is a desired unknown quantity in the problem, try to find two ways to count some other quantity .... http://www.artofproblemsolving.com/Forum/index.php. 5.

Insights from DoubleClick Video advertising momentum
bringing new energy to media companies, content creators, and advertisers. Big ... This global analysis is based on billions of served video ads which are aggregated to preserve ..... Using our tools, advertisers can build ads, measure results ...

Insights from DoubleClick Video advertising momentum
bringing new energy to media companies, content creators, and advertisers. Big ... video, while entertainment broadcasters are moving to online distribution. ... notes with insights gleaned from Google's video advertising solutions. We'll.

Counting Codes over Rings
Sep 3, 2012 - [x,y] = x1y1 + ททท + xnyn. For any code C over R, we define the orthogonal to be. C⊥ = {x ∈ Rn ∣. ∣[x,c]=0, ∀c ∈ C}. Throughout the paper we assume that the rings are all Frobenius, see [8] for a definition of this cla

counting animals.pdf
Sign in. Loading… Whoops! There was a problem loading more pages. Whoops! There was a problem previewing this document. Retrying... Download. Connect ...

State counting
Feb 10, 2013 - PHY452H1S Basic Statistical Mechanics. Problem Set 3: State counting ..... w/index.php?title=N-sphere&oldid=534164100. [Online; accessed ...

Do video games make people violent?
Jan 27, 2016 - However, a large group of academics said they felt the methodology of the ... "If you play three hours of Call of Duty you might feel a little bit ...

pdf-1292\the-asia-pacific-economic-cooperation-apec-meetings-in ...
... of the apps below to open or edit this item. pdf-1292\the-asia-pacific-economic-cooperation-apec-meetings-in-honolulu-a-preview-by-michael-f-martin.pdf.

Automated Question Answering From Lecture Videos
Proceedings of the 38th Hawaii International Conference on System Sciences ... Question Answering systems are designed based on .... Calvados is a dry apple.

State counting
Some numbers With N = 300 and a ≈ 5 ˚A, and ignoring spaces (i.e. η = 1, for a non-physical infinite packing), our globular diameter is approximately. 2 × 5 ˚A 3. √. 300 ≈ 67 ˚A. (1.38). This is actually not much different than the maximum