# INTRODUCTION ith the rapid development of economic society, the crowd flowing in various public places and facility is more and more frequent. Effectively managing and controlling the crowd in public places become an important issue. People counting system based on this kind of demand arises, which can be used in the crowd surveillance and management, but also can be used in commercial domain such as market survey, traffic safety as well as the architectural design domain and so on. The research on counting people has the profound significance and the broad prospect because it directly or indirectly improves the staffs' working efficiency and the utilization of building facilities in various places. In the past history of this project different methods have been developed to count the number of people. But some of them have problems associated with them; hence we are trying to overcome them in this system. In developing the method for counting the number of people in complex indoor spaces, our goal is to develop a method such that it should be robust, easily realizable and effective. It should have high recognition rate in relatively stable environment and relatively sufficient light. A people counter is a device used to measure the number and direction of people traversing a certain passage or entrance per unit time. The resolution of the measurement is entirely dependent on the sophistication of the technology employed. The device is often used at the entrance of a building so that the total number of visitors can be recorded. Many different technologies are used in people counter devices, such as infrared beams, computer vision, thermal imaging and pressure-sensitive mats. # II. # LITERATURE SURVEY Authors like Lin SF, Chao HX, T.Zhao, R. Nevatia addressed issue of people counting. It consist of methods like: fitting method based on low level feature, feature point tracking, object detection method. Fitting method is easy to use, but as it has neglected individual concept and skipped single object tracking process, it becomes difficult to acquire correct people counting information. Object tracking method has high precision because it detects directly object. And feature point tracking method acquires people counting information by tracking moving feature point, then applying cluster analysis for further point track. But though this method is insusceptible of camera angle, but has lower accuracy. Hence to overcome these difficulties and problems new method should be invented. And this method can be easily realized and suitable for environment. It can also be useful for understanding personal information. Author Xi Zhao, Emmanual, Dellandrea and liming Chen mensioned in paper "People counting System Based on Face Detection and Tracking in video." that in literature most of work is relied on moving object detection and tracking, based on the assumption that all the moving objects are people.They proposed an approach in which people counting is based on face detection , tracking and trajectories classification. # Global Journal of Computer Science and Technology Volume XI Issue XXIII Version I it is also necessary. They mentioned that there is successful development of detecting abandoned objects and people tracking. People tracking is relatively easy as compared to people counting in groups. Mutual occlusion is the most problematic in group counting. Several techniques for group counting estimation is suggested such as foreground \detection using mixture of Gaussian, foreground detection using pixel layering, shadow Emoval. Duan-Yu Chen, Chih-Wen Su, Yi-Chong Zeng, Hong -Yuan Mark Liao proposed a system "An Online People Counting System for Electronic Advertising Machine" for counting the number of people watching a TV-wall advertisement or electronic billboard without countingrepetitions by using stationary camera. In this first of all face detection and face filtering is done, in which, SVM based face detector is used. Face filtering is used to filter false positive face. Then feature extraction is performed on torso of human subject. Then an online classifier trained by Fisher's Linear discriminant strategy is developed. Fang Zhu and Xinwei Yang suggested "People Counting Based on Support Vector Machine" infrared people counting method. In data processing procedure pattern recognition idea can be introduced according to characteristics of time continuous data collected by infrared sensors. In this method people counting is based on two steps. First is data acquiring in which infrared signal information is collected. Second is data processing in which noise removing and normalization is done by standardization and data segmentation. Then feature extraction is performed. Lastly classification and identification of people who go through infrared area is done. When several people go through infrared signal at the same time, this method counts number of people accurately. # III. # PROPOSED SYSTEM In this paper, a new robust method for counting people in complex indoor spaces is presented. As shown in Fig. 1 the method for counting people diagram, the method has counted the number of people in the indoor spaces through four modules: image preprocessing module, morphology processing module, image marking module and people counting module, in order to master the information of the indoor for increasing efficiency and utilization of building facilities. Image pre-processing module chooses image greying, background subtraction based on threshold, median filtering algorithm and threshold segmentation to eliminate background interference. The morphology processing module uses the improved erosion operation and the improved dilation operation to extract target feature. Then the following image marking module uses connected component detection algorithm, setting the object feature and shape judgment condition to remove false contouring and marking object region by rectangle frame. Finally, people counting module is used to count the number of people. # a) Image Processing Module The captured video images need preprocessing in the method for counting people. In our method, the main function of image pre-processing module is to eliminate background interference and extract the foreground object information, that is, the foreground object in the image sequence will be extracted from the background. The result of this module as the basis of the people counting will directly affect the accuracy of people counting result. First, in image pre-processing module we capture images using a single camera, which is hanged in the middle of the roof in order to cover the entire housing and own a better sensitivity. Secondly, we use image greying turn current image and background image into two gray images. Thirdly, we use background subtraction based on threshold process the two gray images to extract the foreground object for detecting the relative static and moving human object. Finally, we use median filtering method eliminate noise and then use maximum between-cluster variance threshold segmentation method turn the foreground object image into a binary image. Now we detail the image pre-processing module. # i. Image greying Image greying is defined by throwing away the colour information and using gray express image luminance. In the beginning of image pre processing module, we use image greying turn the current colour image and the background colour image into two gray images. Image greying is to make the colour components R, G, B equal. Gray image has 256 Gray Levels because R, G, B range is from 0 to 255. In this paper we perform image greying thought weighted average method, which gives R, G, B different weights and makes the value of R, G, B weighted average as follow: # R=G=B=rR+gG+bB (1) Among analysis, we can gain the most reasonable gray image when r=0.299 , g=0.587, b=0.114 as follow: R=B=G=0.299*R+O.587*G+0.114*B(2) ii. Background subtraction based on threshold Using image greying, two gray images which include the current gray image and the background gray image are received. We use background subtraction based on threshold process the two gray images to eliminate background interference and extract the foreground object information image. Threshold selection is a key issue. As the gray values of head generally below 90, we choose maximum between cluster variance adaptive threshold method whose threshold is chosen within the range [0, 90]. If the pixel gray difference is bigger than the threshold, the pixel value in input gray image is seen as foreground stored in the image, else the pixel is considered as white pixel which value is 255. Through those processing, the majority of background disturbance is eliminated. Moreover, in some public spaces such as cyber bar, computer room, laboratory, the computer frame to the object extracting influence should be considered. Because computer frame and the top of head have approximate gray value, the head which locates near computer will be divided into two sections only using background subtraction. Allowing for this question, if the frame gray value of current image below 90 and the number of pixels which variation of the frame upper and lower or the frame left and right are bigger than the threshold is bigger than the set number, the pixel value in input gray image is seen as foreground stored in the result image, else the pixel is considered as white pixel which value is 255.This improved method effectively resolves the computer frame disturbance question. # iii. Median filtering method After background subtraction based on threshold, the foreground object images have a certain extent noise interference. The noise makes image quality deteriorated, causes the image blurred, even submerges the image feature and affects the analytic result. Therefore in the pre-processing module we adopt median filtering method to eliminate noise. Median filtering commonly uses a sliding template including the odd number of points, with the median of each template window gray value instead of the gray value of designated point. In this system, + template median filtering is used to eliminate the noise of foreground object image. After arranging the values of five pixels including the pending pixel and 4-neighbors of the pending pixel from small to big, we choose the median of the gray levels as the value of the pending pixel. Median filtering can obvious reduce noise and make image smoothing, which filters the small object blocks and highlights the feature information we need. iv. Threshold segmentation Threshold segmentation is fundamental approach to segmentation that enjoys a significant degree of popularity. It needs a right threshold to divide the image into object and background. Maximum between-cluster variance threshold segmentation algorithm is used to change the object image after median filtering into a binary image. This algorithm as follows: In our method, threshold value T is chosen within the range 6) is widely applied to image processing, which mainly includes dilation, erosion, opening and closing operation. Because the binary object images after image pre-processing module often have the discrete noise and holes in object region, morphology processing module is used to remove the isolated noise and fill the hole in the object region, which first uses an improved erosion operation and then uses an improved dilation operation. # i. Improved erosion operation In this system, an improved erosion operation is proposed, which does the first erosion operation using 3 x3 template as B to process the binary object image, then does the second erosion operation using r template as B. Through two times erosion operation, the binary image is removed isolated noise and becomes clean. ii. Improved dilation operation After erosion operation, an improved dilation operation is used in the method, which performs the first dilation operation using template as B, then performs the second dilation operation using 3x3 template as B. Through two times dilation operation, those holes in the object region are filled and some gaps are bridged. Morphology processing module can improve the accuracy of counting system through enhancing the object feature. This step has laid a good foundation for the further image marking. # c) Image Marking Module Image marking module aims to mark the head region. First, image marking module uses connected component detection algorithm, then sets the object feature and shape judgment condition, fmally, removes false contouring based on the object feature and shape judgment condition, simultaneously uses rectangle frame mark object region. # i. Connected component detection algorithm Connected component detection algorithm [7] is to fmd all the pixels which belong to the same connected component and to give the same marking to the same connected component pixels. Through this algorithm, we gain a marking image in which the value of each pixel is the value of its regional marking. As shown in Fig. 2 the image marking scheme, the connected component detection algorithm has been done as follows: Setting the initialization of marking counter is 0 and using column-based scan method to mark those pixels (the gray values are equal to 0 )based on those marking of those pixels' four pixels which have been scanned, at the same time carrying on the following marking algorithm judgment: Step I: If the gray values of four pixels which separately lie the lower left, the left, the upper left, the up of current pixel are 255, the marking counter adds one. Step 2: If the gray values of four pixels which separately lie the lower left, the left, the upper left, the up of current pixel have the same marking but not all are equal to marking value 0 , the marking is given current pixel. Step 3: If the gray values of four pixels which separately lie the lower left, the left, the upper left, the up of current pixel have different marking and two kind of marking (not including the marking is zero), judge the size of two kind of marking, the small marking is given current pixel, then scanning the whole image, changing the marking of pixel which has already been labeled as the big marking value into small marking value, the marking counter subtracts one. Step4: All pixels carry out the 2nd step .when all pixels processing are completed, the algorithm is over. ii. Object feature and shape judgment condition setting After connected component detection algorithm, we should scan the whole marking image to count the area ,barycentric coordinates, upper left coordinate and lower right coordinate of rectangle frame which belongs to different connected components with different marking value. In order to extract real head information, we choose object area and shape characteristics as object feature. If the connected component isn't in line with the shape attribute, then we judge it as false object and the counter subtracts one, else if it is in line with area classification judgment condition, then we judge it as object, else judge it as false object and the counter subtracts one. Allowing that two head possible connected together, we count the average area of head (avgs2) when the connected component was in line with the shape attribute condition. If avgs2 is in line with the following judgment condition of two people connected together, then we judge the connected component region as two people and the counter adds two. iii. Marking object region After the above processing, we get the real head object information, including the area, barycentric coordinates, upper left coordinate and lower right coordinate of rectangle frame. Using the coordinates of rectangle frame, we can mark the real rectangle frame region including object features. Image marking module is the foundation of the following people counting module. # d) People Counting Module From the above analysis we can draw the conclusion that the value of marking counter is the number of people head and can receive the head average area of object through taking the average of the sum about the head pixels in those rectangle frames, therefore the outputs of the system include the image size, the number of people head and the goal (number of people) average area. In people counting module, the number of people head is the people counting result we need. The method for counting people is a robust method and low cost for using a single camera, which can be used in complex indoor spaces. IV. # CONCLUSION Uptill now people counting system is used for the purposes such as to facilitate security management as well as urban planning. In military application for instance in urban warfare, soldiers might not be able to check every room of building. Sending a camera into a room that could autonomously report how many people are present can help soldiers assess threat level. But apart from this we can use this system in shopping malls. We can count number of people going in particular section and if there is too much crowd in that section then we can segregate the crowd by applying some technique. For example in shopping mall if too much crowd is in ladies clothes especially for jeans clothes, then we can suggest the manager to provide separate section for jeans clothes, so that crowd get segregated. We can also find out which section is more crowded on particular day of a week. Also we can use this system in public places such as cyberbar, computer room, laboratory classroom, conference room etc. ![[0, 90] because gray values of head generally below 90. The result of threshold segmentation © 2011 Global Journals Inc. (US) Global Journal of Computer Science and Technology Volume XI Issue XXIII Version I 55 2011 December Segmentation and Counting of People through Collaborative Augmented Environment is a binary image including object information. After image pre-processing module, we receive a clear binary object image, which is eliminated background interference and beneficial to the next processing. b) Morphology Processing Module Mathematical morphology processing (](image-2.png "") ![](image-3.png "") December"Counting People in Groups" the importance of camera surveillance in the era of growing security concerns, and © 2011 Global Journals Inc. (US) Global Journal of Computer Science and Technology Volume XI Issue XXIII Version I DecemberSegmentation and Counting of People through Collaborative Augmented Environment © 2011 Global Journals Inc. (US) Global Journal of Computer Science and Technology Volume XI Issue XXIII Version I 56 2011 December Segmentation and Counting of People through Collaborative Augmented Environment * Estimation of number of people in crowded scenes using perspective transformation SFLin YChen HXChao IEEE Transactions on Systems, Man and Cybernetics-Part A : Systems and Humans 3 6 2001 * Tracking multiple humans in complex situation TZhao RNevatia IEEE Transactions on Pattern Analysis and Machine Intelligence 26 9 2004 * Segmentation and tracking of multiple humans in crowded environment TZhao RNevatia BWu IEEE Transactions on Pattern Analysis and Machine Intelligence 30 7 2007 * Background subtraction in highly dynamic scenes VijayMahadevan NunoVasconcelos IEEE conference on Computer Vision and Pattern Recognition 2008. 2008 6 * Driver Eyes Identification Based on Infrared Illuminator WeiDi RongbenWang International conference on Computational Intelligence and Software engineering 2009 * Processing colour and complex data using mathematic morphology MattWheeler MichaelAMuda National Aerospace and Electronics Conference 2000 * An algorithm with reduced operations for connected components detection in ITU-T group 3/4 coded images EmmaRegentova ShanhramLatifi ShulanDeng Yao IEEE Transactions on Pattern Analysis and Machine Intelligence 24 2002 * A method of counting the passing people by using the stereo images KTerada DYoshida SOe JYamaguchi Proceedings of the International Conference on Image Processing the International Conference on Image Processing 1999. 1999 2 ICIP 99. * Automatic counting of interacting people by using a single uncalibrated camera SVelipasalar Y.-LTian AHampapur IEEE International Conference on Multimedia and Expo 2006. July 2006 * Bayesian human segmentation in crowded situations TZhao RNevatia Proceedings of the IEEE Computer Society Conference on Computer Vision and Pattern Recognition the IEEE Computer Society Conference on Computer Vision and Pattern Recognition 2003. June 2003 2 * Tracking multiple humans in crowded environment TZhao RNevatia Proceedings of the IEEE Computer Society Conference on Computer Vision and Pattern Recognition the IEEE Computer Society Conference on Computer Vision and Pattern Recognition 2004. June-2 July 2004 2 II-406-II-413 * Counting crowded moving objects SRabaud Belongie IEEE Computer Society Conference on Computer Vision and Pattern Recognition US 2006. June 2006. 2011 1 * Global Journal of Computer Science and Technology XI 2011 Issue XXIII Version I * December Segmentation and Counting of People through Collaborative Augmented Environment 13 DKong HGray Tao 18th International Conference on Pattern Recognition, ICPR 2006 Counting pedestrians in crowds using viewpoint invariant training * A system for counting people in video images using neural networks to identify the background scene PAMehta TJStonham Journal of Pattern Recognition 29 8 1996 * People counting in complex scenarios TSchl¨ogl BWachmann HBischof WKropatsch 2003 Technical report * Privacy preserving crowd monitoring: Counting people without people models or tracking ABChan ZS JLiang NVasconcelos Proceedings of the International Conference on Computer Vision and Pattern Recognition the International Conference on Computer Vision and Pattern Recognition 2008 * Realtime vision-based people counting system for the security door JWKim KSChoi BDChoi SJKo Proceedings of International Technical Conference On Circuits Systems Computers and Communications International Technical Conference On Circuits Systems Computers and Communications 2002 * Counting crowded moving objects SRabaud Belongie Proceedings of the International Conference on Computer Vision and Pattern Recognition the International Conference on Computer Vision and Pattern Recognition 2006 * People counting in transport vehicles SHarasse LBonnaud MDesvignes Proceedings of the International Conference on Pattern Recognition and Computer Vision the International Conference on Pattern Recognition and Computer Vision 2005 * Semi-automatic face segmentation for face detection in video LTsishkou EChen Bovbel International Conference on Intelligent Access to Multimedia Documents on the Internet 2004