# Foreground Object Detection Based On Background Subtraction Cultural Studies Essay

Asst.prof/ECE

Adhiparasakthi Engineering College

Melmaruvathur, India

Email:sakthidasan.sankaran@gmail.com

M.Sathya Kamatchi

PG Scholar/ECE

Adhiparasakthi Engineering College

Melmaruvathur, India

Email:sathya.sats89@gmail.com

Dr.V.Nagarajan

Professor/ECE

Adhiparasakthi Engineering College

Melmaruvathur, India

Email: nagarajanece@gmail.com

## Abstract—Due to mixture of Gaussians over color in each pixel, the trees waving in the wind and rippling water in dynamic texture scenes performs very poor. To address this problem ,background subtraction had used. Background subtraction is a process of extracting foreground objects in a particular scene. The proposed method had detected a foreground object using Fuzzy Color Histogram. It has an ability to attenuate color variations in background. Lab Color space model had used for determining the color features . Fuzzy model does not require estimation of any parameter. This is quite advantageous for achieving the robust background subtraction in a wide range of scenes with spatiotemporal dynamics. clusters in the image can be grouped together by using Fuzzy C-Means Algorithm. Morphological process can be used effectively for unwanted pixel removal from the background. Simulation results shows that the FCH can be used to track the foreground image boundary by the result of object detection. and foreground will be detected from dynamic background scene.

Keywords— LAB color space, FCH, FCM Algorithm.

## I.INTRODUCTION

Background subtraction is a class of techniques for segmenting out objects of interest in a scene for applications such as surveillance. There are many challenges in developing a good background subtraction algorithm. First, it must be robust against changes in illumination. Second, it should avoid detecting non-stationary background objects and shadows cast by moving objects. The purpose of this work is to obtain a real-time system which works well in indoor workspace kind of environment and is independent of camera placements, reflection, illumination, shadows, opening of doors and other similar scenarios which lead to errors in foreground extraction. Generalization of the Stauffer– Grimson background model, where each mixture component is modelled as a dynamic texture. proposed by B.Chan al. [1], derives an online K-means algorithm for updating the parameters using a set test2 of sufficient statistics of the model. Main advantage of these techniques is that it quantitatively and qualitatively outperforms state-of-the-art methods in scenes containing significant background motions.A New color histogram representation, called fuzzy color histogram (FCH) is presented in [2],where it considers the color similarity of each pixel’s color associated to all the histogram bins through fuzzy-set membership function. The proposed FCH is further exploited in the application of image indexing and retrieval. Real-Time Human Motion Detection and Tracking is presented in [3] which is used to automate video surveillance system for detecting and monitoring people in both indoor and outdoor environments. Object Detection and Modelling Algorithm for Automatic Visual People Counting System is presented in [4] which is used to identify individuals from top view images acquired from an overhead Surveillance camera. This work proposed Snake algorithm with effective external energy function and a half-circle template initialization for modelling passengers. Tracking and Counting People in Visual Surveillance Systems is presented in [5] which is used to identify foreground objects as characters, positions and sizes of foreground regions are treated as decision features. Moreover, the performance to track individuals is improved by using the modified overlap tracker, which investigates the centroid distance between Neighbouring objects to help on target tracking in occlusion states of merging and splitting. Fuzzy C-means clustering algorithm based on kernel method is presented in [6] which integrates FCM with Mercer kernel function and deals with some issues in fuzzy clustering. The FKCM algorithm is not only suitable for clusters with the spherical shape, but also other non-spherical shapes such as annular ring shape effectively. Background subtraction for temporally irregular dynamic textures is presented in [7] which proposes a generalization of the MoG model that handles dynamic textures. In the context of background modeling, it achieves better, more accurate segmentations than the competing methods, using a model whose complexity grows with the underlying complexity of the scene rather than the amount of time required to observe all aspects of the texture. Real-Time Discriminative Background Subtraction is presented in [8] which accommodates interactions among neighboring pixels, a global algorithm is then derived that explicitly distinguishes objects versus background using maximum a posteriori inference in a Markov random ﬁeld . Statistical Modeling of Complex Backgrounds for Foreground Object Detection is presented in [9] which establishes a novel algorithm for detecting foreground objects from complex environments. It consists of change detection, change classiﬁcation,foreground segmentation, and background maintenance. Good results of foreground detection were obtained. Spatiotemporal saliency in dynamic Scenes is presented in [10] which introduces the combination of discriminant center-surround saliency with the modeling power of dynamic textures yields a robust, versatile, and fully unsupervised spatiotemporal saliency algorithm, applicable to scenes with highly dynamic backgrounds and moving cameras.The paper is organized as follows:Section II presents Background subtraction using FCH. Section III explains about Fuzzy C-Means Algorithm. Section IV presents the simulation results of the proposed method. Finally, conclusion is given in Section V.

## II. BACKGROUND SUBTRACTION USING FCH

The proposed method gives a simple and robust method for background subtraction in dynamic texture scenes. The underlying principle behind our model is that colour variations generated by background motions are greatly attenuated in a fuzzy manner. Therefore, compared to preceding methods using local kernels , the future method does not require estimation of any parameters (i.e., nonparametric). This is quite advantageous for achieving the robust background subtraction in a wide range of scenes with spatiotemporal dynamics. Specifically, we propose to get the local features from the fuzzy colour histogram (FCH).Then, the background model is dependably constructed by computing the similarity between local FCH features with an online update procedure. In this paper, the colour histogram is viewed as a color distribution from the probability viewpoint. Given a color space containing color bins, the color histogram of image containing pixels is represented as , where is the probability of a pixel in the image belonging to the th color bin, and is the total number of pixels in the color bin. According to the total probability theory,can be defined as follows:

(1)

Where is the probability of a pixel selected from image I being the jth pixel, which is 1/N , and Pi/j is the conditional probability of the selected th pixel belonging to the ith color bin. The fuzzy color histogram (FCH) of image I can be expressed as F(I)=[f1,f2, f3,...... fn], where,

(2)

has been defined in (1), and is the membership value of

the th pixel in the color bin.

## Fig.1.Block diagram for proposed Background subtraction using FCH

In contrast with CCH, FCH considers not only the similarity of different colors from different bins but also the dissimilarity of those colors assigned to the same bin. Therefore, FCH effectively alleviates the sensitivity to the noisy interference.

## III. FUZZY C-MEANS ALGORITHM

An efficient method to compute FCH based on fuzzy -means (FCM) clustering algorithm. The FCM minimizes an objective function , which is the weighted sum of squared errors within each group, and is defined as follows:

Where V=[v1,v2, ....vc]T is a vector of unknown cluster prototypes.

, for 1 (4)

and

, for 1 and 1 (5)

Equations (4) and (5) cannot be solved analytically, but an approximate solution can be obtained by performing the following iterative procedures.

The Fuzzy C-Means Algorithm as follows:

Step-1: Input the number of clustersc, the wighting exponent,and error tolerance

Step-2: Initialisze the cluster centers vi, for 1 ≤i≤ c

Step – 3: Input data X= {x1, x2, .... xn}

Step-4: Calculate the c cluster centers {vi(l)} by (4)

Step-5: Update U(l) by (5)

Step-6:If and return to step 4;otherwise ,stop.

In this algorithm,classification of fine colors in CCH into clusters for FCH can be done. Due to the perceptual uniformity of CIELAB color space, the inner product can be simply replaced by , which is the Euclidean distance between the fine color and the cluster center . The fuzzy clustering result of FCM algorithm is represented by matrix , and is referred to as the grade of membership of color with respect to cluster center . Thus, the obtained matrix can be viewed as the desired membership matrix for computing FCH, i.e., . Moreover, the weighting exponent in FCM algorithm controls the extent or "spread" of membership shared among the fuzzy clusters. Therefore, we can use the parameter to control

the extent of similarity sharing among different color bins in FCH. The membership matrix can be thus adjusted according to different image retrieval applications. In general, if higher noisy interference is involved, larger value should be used. This algorithm works by assigning membership to each data point corresponding to each cluster center on the basis of distance between the cluster center and the data point. More the data is near to the cluster center more is its membership towards the particular cluster center. Clearly, summation of membership of each data point should be equal to one. After each iteration membership and cluster centers are updated according to the formula:

(6)

Where,'n' is the number of data points, represents the jth cluster center, 'm' is the fuzziness index m € [1, ∞],'c' represents the number of cluster center, represents the membership of ith data to jth cluster center. represents Euclidean distance between ith data and jth cluster center. Main objective of fuzzy c-means algorithm is to minimize:

J(U,V)= (8)

Where,'||xi – vj||' is the Euclidean distance between ith data and jth cluster center.

https://sites.google.com/site/dataclusteringalgorithms/_/rsrc/1273877211822/fuzzy-c-means-clustering-algorithm/fuzzy.jpg

## Fig.2.Results of Fuzzy c-means clustering

It gives best result for overlapped data set and comparatively better then k-means algorithm. Unlike k-means where data point must exclusively belong to one cluster center here data point is assigned

membership to each cluster center as a result of which data point may belong to more then one cluster center.

B) MORPHOLOGICAL FILTERING

Morphological image processing is a collection of non-linear operations related to the shape or morphology of features in an image. Morphological operations rely only on the relative ordering of pixel values, not on their numerical values, and therefore are especially suited to the processing of binary images. Morphological operations can also be applied to grey scale images such that their light transfer functions are unknown and therefore their absolute pixel values are of no or minor interest. Morphological techniques probe an image with a small shape or template called a structuring element. The structuring element is positioned at all possible locations in the image and it is compared with the corresponding neighbourhood of pixels. A morphological operation on a binary image creates a new binary image in which the pixel has a non-zero value only if the test is successful at that location in the input image.It consists of two operations,Erosion and Dilation. Erosion removes small-scale details from a binary image but simultaneously reduces the size of regions of interest, too. By subtracting the eroded image from the original image, boundaries of each region can be found: b = f − (f sign-erosions ) where f is an image of the regions, s is a 3×3 structuring element, and b is an image of the region boundaries. The Dilation of an image f by a structuring element s (denoted f sign-dilations) produces a new binary image g = f sign-dilations with ones in all locations (x,y) of a structuring element's orogin at which that structuring element s hits the the input image f, i.e. g(x,y) = 1 if s hits f and 0 otherwise, repeating for all pixel coordinates (x,y). Dilation has the opposite effect to erosion - it adds a layer of pixels to both the inner and outer boundaries of regions. Results of dilation or erosion are influenced both by the size and shape of a structuring element. Dilation and erosion are dual operations in that they have opposite effects.

## IV. SIMULATION RESULTS

The simulation results for Background subtraction in dynamic texture scene using Fuzzy color histogram(FCH).First,the RGB image is converted into LAB color space .It is shown in Fig.3 (a) and (b).

## Fig.3.(a).RGB colour image

## RGB is Red, Green and Blue and is a colour space where all colours are created out of Red Green and Blue ink or light.It is useful for full color editing because it has wide range of colors..In this,the input image is resized by 120X120 pixels. Resizing factor will be numbers less than one (that is, fractions) will shrink the image; numbers greater than one (that is, multiples) will enlarge the image. The input image will be resized to the dimensions of the specified image. The resized input image will be converted into LAB space model. The input image can be numeric or logical and it must be non-sparse. The output image is of the same class as the input image.

## Fig.3.(b).LAB color space conversion

A LAB color space is a color-opponent space with dimension L for lightness and a and b for the color-opponent dimensions, based on nonlinearly compressed CIE XYZ color space coordinates. In this process, the RGB image is converted into LAB color space. Color space defined by the CIE, based on one channel for Luminance (lightness) (L)and two color channels (a and b). One problem with the XYZ color system, is that colorimetric distances between the individual colors do not correspond to perceived color differences. The Luminance ranges from 0 to 100, the A component ranges from -120 to +120 (from green to red) and the B component ranges from -120 to +120 (from blue to yellow).

## Fig.4.Foreground features

The part of a scene situated towards the front or nearest to the viewer is called Foreground objects. Foreground features can be obtained from Fuzzy color histogram.It is shown in Fig.4. A color space containing color bins, the color histogram of image containing pixels. Probability of a pixel in the image belonging to the th color bin, and is the total number of pixels in the the color bin.Here, FCH considers not only the similarity of different colors from different bins but also the dissimilarity of those colors assigned to the same bin.

## Fig.5.Morphological output

Morphological filtering can be used to remove unwanted pixels in the image. Two operations can be carried out Dilation and Erosion. . It is shown in above Fig. 5.Results of dilation or erosion are influenced both by the size and shape of a structuring element.

## Fig.6.Object detection

Finally, after Morphological process the segmented object can be detected. By Foreground tracking method the object can be detected.It is shown in above Fig.6. Object detection has applications in many areas of computer vision, including image retrieval and video surveillance.

## IV. CONCLUSION

In this work, the background can be subtracted using Fuzzy color histogram. Then, Fuzzy C-Means algorithm can be done to get the foreground features. In fuzzy clustering, each point has a degree of belonging to clusters, as in fuzzy logic, rather than belonging completely to just one cluster. Thus, points on the edge of a cluster, may be in the cluster to a lesser degree than points in the center of cluster. The proposed method shows that Background Subtraction for accurate foreground detection from dynamic picture using fuzzy color histogram features and tracking using boundary tracking method. It is very Less sensitive to noise ,more suitable for dynamic background scene and accuracy is more . Therefore it is used in various applications such as Computer Vision, Object Tracking and Surveillance.In Future, expected to achieve detection of moving objects based on Background subtraction through dynamic threshold detection and morphological approach.

## V. REFERENCES

B. Chan, V. Mahadevan, and N. Vasconcelos, "Generalized Stauffer-Grimson background subtraction for dynamic scenes," Machine Vision Applications, volume 22, no. 5, pp. 751–766, 2011.

JuHan and Kai-Kuang Ma, " Fuzzy color histogram and its use in color image retrieval ", in Image Processing, IEEE Transactions, volume 11 ,pp. 944 - 952 , August 2002 .

Zarka. N., Alhalah. Z. , Deeb.R. , "Real-Time Human Motion Detection and Tracking", in Information and Communication Technologies,IEEE conference,pp. 1 – 6,April 2008.

Jaijing.K, Kaewtrakulpong.P. ,Siddhichai. S, "Object detection and modeling algorithm for automatic visual people counting system",in IEEE conference,volume 2,pp.1062-1065,May 2009.

Chih-chang chen,Hsing- Hao Lin,Chen,O.T., "Tracking and counting people in visual surveillance system",in IEEE conference,pp.1425-1428,May 2011.

Zhong-dong Wu , Wei-xin Xie and Jian-ping Yu , "Fuzzy C-means clustering algorithm based on kernel method",in Computational Intelligence and Multimedia Applications,pp.49-54,September 2003.

G. Dalley, J. Migdal, and W. Grimson, "Background subtraction for temporally irregular dynamic textures," in Proc. IEEE Workshop on Applications of Computer Vision (WACV), January 2008, pp. 1–7.

Li Cheng, Minglun Gong, Dale Schuurmans, and Terry Caelli, "Real-Time Discriminative Background Subtraction," in Proc. IEEE Workshop on Applications of Computer Vision (WACV), January 2011, pp. 1–7.

L. Li, W. Huang, I. Y.-H. Gu, and Q. Tian, "Statistical modeling of complex backgrounds for foreground object detection," IEEE Transactions Image Processing, volume 13, no. 11, pp. 1459–1472, November 2004.

V. Mahadevan and N. Vasconcelos, "Spatiotemporal saliency in dynamic scenes," IEEE Transaction Pattern Analysis Machine,volume 32,no.1, pp. 171–177, January 2010.