(IJCSIS) International Journal of Computer Science and Information Security,Vol. 8, No.2 May 2010
proposed here to highlight the desired foreground scene and itis given below.FRAME DIFFERENCING ALGORITHMStep0: Read the Video data.Step1: Convert it into video frames.Step2: Set the background image.Step3: Separate R, G, B components individually foreasy computation.bc_r = bg(:,:,1);bc_g = bg(:,:,2); bc_b = bg(:,:,3);Step4: Read the current frame from the video sequence.Step5: Separate R, G, B components individually for thecomputation.cc_r = fr(:,:,1);cc_g = fr(:,:,2); cc_b = fr(:,:,3);Step6: Subtract the R, G, B components of the current framefrom the R, G, B components of background frame.Step7: Check the threshold values of colour components.
(a) (b) (c)Figure 3. Background subtraction using frame differencing algorithm(a) Input video frame, (b) Background subtracted image, and (c) Silhoutteeof human body
V.
M
ORPHOLOGICAL
O
PERATION
Next, the proposed algorithm follows the morphologicaloperations which help to enhance the video frame for furtherprocesses. The morphological operations include dilation anderosion [16]. Finally, the noise has been removed usingmedian filtering. Dilation adds pixels to the boundaries of theobjects in an image. The number of pixels added or removedfrom the objects in an image depends on the size and shape of the structuring element. If F(j,k), for 1
≤
j,k
≤
N is a binaryvalued image and H(j,k), for 1
≤
j,k
≤
L, where L is an oddinteger, is a binary valued array called a structuring element,the dilation is expressed as in equation(1).G(j,k)=F(j,k)H(j,k)
⊕
(1)Erosion removes pixels on object boundaries. To erode animage,
imerode
function is used for our applications. Thedilation is expressed as in equation (2) where H(j,k) is an oddsize Lx L structuring element.G(j,k)=F(j,k)H(j,k)
⊗
(2)At the end of this stage, the median filtering has been usedto reduce the salt and pepper noise present in the frame. It issimilar to using an averaging filter, in that each output pixel isset to an average of the pixel values in the neighborhood of thecorresponding input pixel.VI.
T
HINNING
A
LGORITHM
In this paper, thinning operation can be used to findskeleton of the entire human body. The thinning operation isperformed by transforming the origin of the structuringelement to each pixel in the image. Then it is compared withthe corresponding image pixels. When the background andforeground pixels of the structuring element and an image arematched, the origin of the structuring element is considered asbackground. Otherwise it is left unchanged. Here, thestructuring element determines the use of the thinningoperation. The thinning operation is achieved by the hit-and-miss transform. The thinning of an image A
by a structuringelement B is given by equation (3).thin(A,B)=A-hit and miss(A-B)(3)Mostly the thinning operation has been used forskeletonization to produce a connected skeleton in the humanbody. Figure.4 shows the structuring elements forskeletonization by morphological thinning. At each iteration,the image is first thinned by the left hand structuring element,and then by the right hand one, and then with the remainingsix
90° rotations of the two elements.
Figure 4. Examples of structuring element for thinning operation
The process is repeated in cyclic fashion until none of thethinnings produce any further change. Normally, the origin of the structuring element is at the center. The steps of thinningalgorithm include,Step0: Partitioning the video frame into two distinctsubfields in a checkerboard pattern.Step1: Delete the pixel
p
from the first subfield if andonly if the conditions (4), (5), and (6) are satisfied.
H
X(p)=1
(4)
where
H
4X(p)=bii=11 if X2i-1 = 0 and ( x2i = 1 or x2i+1=1)bi=0 otherwise
∑
x1, x2,….x8 are the values of the eight neighbors of
p
, startingwith the east neighbor and numbered in counter-clockwiseorder.2minn(p),n(p) 312
≤ ≤
(5)
11http://sites.google.com/site/ijcsis/ISSN 1947-5500