2 INTRODUCTION A Bayesian marked point process (MPP) model is developedto detect and count people in crowded scenes.The model couples a spatial stochastic process governing number and placement of individuals with a conditional mark process for selecting body shape.It automatically learns the mark (shape) process from training video by estimating a mixture of Bernoulli shape prototypes along with an extrinsic shape distribution describing the orientation and scaling of these shapes for any given image location.The reversible jump Markov Chain Monte Carlo framework is used to efficiently search for the maximum a posteriori configuration of shapes, leading to an estimate of the count, location and pose of each person in the scene.

3 MotivationDetecting and counting people in video of a crowded scene a challenging problem.Problems likethe spatial overlap between people makes it difficult to delineate individuals as connected component blobs within a background subtraction imageWhy Crowd Counting?to increase situational awareness for crowd control and public safely by providing real-time estimates of the number of people entering or exiting a venue.

6 MARKED POINT PROCESSES FOR CROWD COUNTINGConsider counting pedestrians in a frame of video given a foreground mask image produced by background subtraction.The goal is to determine the number and configuration of binary pedestrian shapes that best explains the foreground mask data.One can think of this process as trying to place a set of cutout shapes over the foreground mask to “cover” the foreground pixels while trying to avoid covering the background pixels.If we assume rectangular shapes, leading to the problem of finding a rectangular cover.

7 PRILIMINARIESA spatial point process is a stochastic process that is suitable for modeling prior knowledge on the spatial distribution of an unknown number of objects.A realization of the process consists of a random countable set of points {s1, , sn} in a bounded region S Є Rd.An MPP couples a spatial point process Z with a second process defined over a “mark” space M of shapes such that a random mark mp ∊ M is associated with each point p ∊ Z.

8 Contd…For example, a 2D point process of rectangular marks has elements of the form si = (pi, (wi, hi, ϴi)) specifying the location, width, height and orientation of a specific rectangle in the image.In this paper, a novel marked point process is proposed thatweaves the prior knowledge of the spatial pattern, extrinsic size and transformation of objects,with intrinsic geometric shape information modeled by a mixture of Bernoulli distributions.Thus, the realization of the MPP in this paper consists of an image location p defined on a bounded subset of R2, together with a mark m defining a geometric shape to place at point p.

9 MODELA Bayesian approach to model the objects in the scene as a set of configurations from an MPP that incorporates prior knowledge such as expected sizes of people in the image or knowledge about image regions where people will not appear.The prior term for an object as ∏(si) , and assume independence among the objects.Priors in MPPs are typically factored so that the mark process is independent from the spatial point process, that is∏(si) = ∏(pi) ∏(mi) .However, this common approach ignores obvious and strong correlations between the size and orientation of projected objects and their 2D image locations in views taken by a static camera.

10 Introduce a conditional mark process for rectangles representing the shape and orientation of a 2D bounding box, conditioned on spatial location, leading to a factored prior of the form∏(si) = ∏(pi) ∏(wi , hi , ϴ i|pi)The prior for the point process ∏(p i) is chosen as a homogeneous Poisson point process.This means that the total number of objects follows a Poisson distribution, and given the number of objects, the locations are i.i.d. and each uniformly distributed in the bounded region.

11 The conditional mark process:We represent the prior for ∏(wi , hi , ϴ i|pi) as independent Gaussian distributions on the width, height and orientation of a pedestrian bounding box centered at a given image location pi.The spatially varying mean and variance parameters for each random mark are stored in lookup tables indexed by the image location.

12 LikelihoodFormally,let y i be the binary value of pixel i in the observed foreground mask data,with 1 = foreground, 0 = background.To compute the goodness of fit of a proposed configuration of shapes to the data,a common way is to first map the configuration into a label image where pixels are labeled foreground if any of the shapes cover it,and background otherwise, so that each pixel in the label image has a one-to-one counterpart in the observed foreground mask.

13 Let x i be the values in the label image.Since both x i and y i are binary variables, Bernoulli distributions are used to characterize p(y i |x i ).A mixture of Bernoulli Distributions is used instead of modelling the foreground and background separately.The resulting x i in the label image is therefore no longer a binary variable, but a continuous variable ranging from [0, 1] , the mean parameter of the Bernoulli distribution p(y i |x i).

14 Assuming conditional independence among the pixels,the joint likelihood function can be written as

15 This likelihood function is biased towards MAP solutions with multiple overlapping rectangles that claim almost the same set of foreground pixels.Many authors address this problem by including a “hardcore” penalty that disallows any overlap by adding an infinite penalty when overlap occurs .This is too strict for the present application of people counting, who may overlap in the view.Another principled approach is to add pairwise interaction terms into the likelihood function to penalize the area of overlap between each pair of shapes.The later approach is followed in the paper.

16 ESTIMATING EXTRINSIC SHAPE PARAMETERSOrientation Estimation:Since we know pedestrians will be oriented vertically, it suffices to determine the vertical vanishing point of the scene, which completely determines the 2D image orientation of a vertical object at any pixel.Conversely, we can estimate the vertical vanishing point from the measured major axis of elliptical blobs extracted from foreground masks of walking people.Often automatically generated foreground masks are noisy, requiring robust estimation techniques.

17 HEIGHT AND WIDTH ESTIMATIONA reasonable first-order model of many scenes can assume that people are walking or standing on a planar ground surface.The planarity assumption regularizes the computation of size, by constraining the relative depth of people in the scene as a function of image location.Simplified by considering views where the vertical vanishing point is along the y axis of the image coordinate system, which can be achieved with an in-plane image rotation.If the vanishing point is far from the image, i.e. for small tilt angles, such as from an elevated camera looking down a hallway, size in the image is dominated by depth from the camera, and is linearly proportional to row number in the image.

19 Learning intrinsic shape classes“soft” segmentation of shape by representing the probability of each pixel being foregrounduse a mixture of Bernoulli distributions to model the learned shape prototypes that are rectangular patches of spatially varying μ(xi) values, one per pixel, learned from a training dataset of observed foreground masks.High μ values implies foreground

20 select a random subset of frames labeled with ground truth bounding boxesthen run background subtraction to get fg/bg masks, which are overlaid with the bounding boxes to extract a set of binary shape patterns, each scaled to a standard sizeThe training samples are a set of binary variables.

21 X = {xi, , xN} as the collection of N training shape patterns, where xi = (xi1, , xiD)T (D being the size of the shape pattern).Modellin X by a mixture of Bernoulli distributions

22 INFERENCETo perform Bayesian inference of the best configuration of person shapes in the image, a prior term is defined for the marked point process to combine with the likelihood.Finding the mode of the resulting posterior then provides a MAP estimate over the configuration space.The decision to go to a new configuration is decided based on the Metropolis-Hastings acceptance ratio

23 RJMCMC based Sampling procedureBirth ProposalDeath ProposalUpdate ProposalThe RJMCMC procedure is iterated between 500 and 3000 times, with the larger number of iterations being needed when there are more people in the scene.The move probability for birth, death and update proposals are set to be 0.4, 0.2 and 0.4, respectively

26 SummaryProposed a marked point process model to detect and count people in crowds. Our model captures the correlations between the mark process (i.e., bounding box size/orientation) and the spatial point process by automatically estimating an extrinsic shape mapping.The model augmented with intrinsic shape information modeled by a weighted mixture of Bernoulli distributions.The learned shape prototypes are more realistic than simple geometric shapes, which leads to more accurate foreground fitting.