• No se han encontrado resultados

Capítulo IV. Herramientas informáticas

4.14. Mecanismos de Seguridad

Thanh-Hue

 Nguyen

-Thi Department of Telecommunications

Faculty of Electrical and Electronics Engineering HCM City University of Technology

Ho Chi Minh City, Vietnam [email protected]

Abstract  — Detecting regions that correspond to moving objects such as people and vehicles in video is the first basic step of almost surveillance system since it provides a focus of attention and simplifies the processing on subsequent analysis steps. Due to dynamic changes in natural scenes such as sudden illumination and weather changes, repetitive motions that cause clutter (tree leaves moving in blowing wind), motion detection is a difficult problem to process reliably. Frequently used techniques for moving object detection are temporal differencing and optical flow. The most attractive advantage of these algorithms is that the algorithm does not need to learn the background model from hundreds of images and can handle quick image variations without prior knowledge about the object size and shape. The algorithm has high capability of anti-interference and preserves high accurate rate detection at the same time. It also demands less computation time than other methods for the real-time surveillance. The effectiveness of the proposed algorithm for motion detection is demonstrated in a simulation environment and the evaluation results are reported in this paper.

Keywords  —   motion detection, optical flow, temporal differencing.

I. I NTRODUCTION

In recent years, motion detection has attracted a great interest from computer vision researchers due to its promising applications in many areas, such as video surveillance [7], traffic monitoring or sign language recognition. Although the existing techniques have undeniable advantages, moving object detection in complex environments is still far from being completely solved. However, it is still in its early developmental stage and needs to improve its robustness when applied in a complex environment. Several techniques for moving object detection have been proposed in [8], among them the three representative approaches are background subtraction, temporal differencing and optical flow. The traditional background subtraction method subtracts the  background model from the current image. It segments foreground objects accurately. It also detects foreground objects even if they are motionless. However, traditional  background subtraction is susceptible to environmental

changes, for example, in the cases of gradual or sudden illumination change. The result of background subtraction is always contaminated by a large number of erroneous foreground pixels. The major drawback of background subtraction is that it only works for static background, and hence background model update is required for dynamic  background scenes [8]. Another approach is based on temporal

difference, which attempts to detect moving regions by making use of the using the difference of consecutive frames (two or three) in a video sequence. This method is highly adaptive to dynamic environments, but generally does a poor job of extracting the complete shapes from some certain moving objects types. Optical flow is a velocity field associated with image changes. Most approaches to estimate optical flow are related to brightness changes between two scenes. It can achieve success of motion detection in the presence of camera motion or background changing. It can detect the motion accurately without even knowing the background.

In this paper, the temporal differencing method and optical flow method are mentioned due to their simplicity and efficiency. The temporal difference imaging helps to detect slow moving objects, resulting better object boundaries and speed up the algorithm. Optical flow gives object regions. We assume that the object with salient motion moves in an approximate consistent direction in a time period. The motion is calculated by differential techniques which compute velocity from spatiotemporal derivatives of image intensity or image filtered versions using low pass or band pass filters, by the Lucas-Kanade optical flow algorithm or Horn-Schunck optical flow algorithm.

II. TEMPORALDIFFERENCINGDETECTIONMETHOD

 A. Using information of three co nsecutive frames:

For this algorithm, the current frame is simply subtracted from the previous frame, and if the difference in pixel values for a given pixel is greater than the threshold, the pixel is considered part of the foreground. Subsequent images I (x, y, t-1), I (x, y, t) and I (x, y, t + 1) are subtracted and the difference image Idifference(x,y,t-1) is thresholded to get the region of changes.

diff1 = I(x, y, t) - I (x, y,t-1) diff2 = I(x, y, t+1) - I (x, y,t)

 Idifference(x,y,t-1) = (diff1>Td) or (diff2>Td) The threshold Td can be derived from image statistics.

 B. Using information of two consecutive frames (I(x,y,t) and  I(x,y,t+1)) and frame difference in the past

In order to detect cases of slow motion or temporally stopped objects, a weighted coefficient with a fixed weight for

the new observation is used to compute the temporal difference image Idifference(x, y, t) as shown in following equations [6]:

Idifference(x, y, t+1) = 255 if (Iaccum(x, y, t+1)>Td) Idifference(x, y, t+1) = 0, otherwise.

Iaccum(x, y, t+1) = (1-Waccum) Iaccum(x, y, t) + Waccum| I(x,y,t+1)- I(x,y,t)|

T d 3 mean(I accum (x, y, t 1)) Where,

Waccum - real number between 0 and 1 which describes the temporal range for difference images Iaccum (x, y, t + 1) is initialized to an empty image.

The temporal difference is a simple method for detecting moving objects in a static environment in which the adaptive threshold Td can restrain the noise very well. Frame differencing has very low computational cost so it can be done in real-time. Thus, it has a great adaption to dynamic  background. A challenging task for frame differencing is to determine the value of the threshold. Different sequence requires a different threshold to classify the pixel as a foreground or background pixel.

III. OPTICALFLOWDETECTIONMETHOD

Optical flow is a concept which is close to the motion of objects within a visual representation. The goal of optical flow estimation is to compute an approximation to the motion field from time-varying image intensity [6]. Estimating the optical flow is useful in pattern recognition, computer vision, and other image processing applications. In this section, two optical flow methods are introduced, Lucas-Kanade Method and Horn-Schunck Method.

 A.  Lucas-Kanade Method

The Lucas-Kanade algorithm assumed that intensity values of any given region do not change but merely shift from one  position to another.

 I(x, y, t) = I(x+∆δ x, y+δ y, t+δt) Where



   



Hence:



Or



Set

 

  and

 

We have:

  

Lucas and Kanade assumed that the flow (Vx, Vy) is unchanged in a small window size NxN and numbering the  pixels as 1…p, a set of equations can be derived:

 Ix1Vx + Iy1Vy + It1 = 0  Ix2 Vx + Iy2 Vy + It2 = 0

 Ixp Vx + Iyp Vy + Itp = 0 (1)

System of equations (1) can be solved by the Least Mean Square (LMS) method for estimating the optical flow vector.

   ∑ ∑

∑ ∑  ∑

∑

The advantage for the method is its accuracy and robustness of detection in presence of noise.

 B.  Horn-Schunck Method

This algorithm is based on a differential technique computed by using a gradient constraint (brightness constancy) with a global smoothness to obtain an estimated velocity field [1][2]. There are two main processes for the implementation of

Fig 1. Optical flow vector corresponds to all window pixels.

the HS algorithm. The first one is an estimation of partial derivatives, and the second one is a minimization of the sum of errors by an iterative process to present the final motion vector.

Step 1. Estimati on of par ti al deri vatives Estimati on of classical par ti al deri vatives

This section presents the estimation process of the classical derivatives of image intensity or brightness from the image sequence [3]. The brightness of each pixel is constant along its motion trajectory in the image sequence. The relationship in continuous images sequence will be taken into account to estimate the original intensity for a gradient constraint. Let I(x,y,t) denote the gradient intensity (brightness) of point (x,y) in the images at time t. In each image sequence, Ix, Iy, and It are computed for each pixel:

 Ix = ¼ {Ix,y+1,t Ix,y,t + Ix+1,y+1,t Ix+1,y,t + Ix,y+1,t+1 - Ix,y,t+1 + Ix+1,y+1,t+1 - Ix+1,y,t+1}

 Iy = ¼{Ix+1,y,t Ix,y,t +Ix+1,y+1,t Ix,y+1,t +Ix+1,y,t+1 - Ix,y,t+1 + Ix+1,y+1,t+1 - Ix,y+1,t+1}

 It = ¼ {Ix,y,t+1 Ix,y,t + Ix+1,y,t+1 Ix+1,y,t + Ix,y+1,t+1 - Ix,y+1,t + Ix+1,y+1,t+1 - Ix+1,y+1,t}

Estimati on of parti al deri vatives on BF B k ernel

Barron et al. (1994) proposed a performance evaluation over many algorithms of optical flow and modification of some of the variant variables [1]. They use the kernel of mask coefficient (as Fig. 2) for gradient estimation which is expressed as:

 {         } 

 {         } 

    {         }

Step 2. M in imi zation

In practice, the image intensity or brightness measurement may be corrupted by quantization or noise. According to the equation for the rate of change of image brightness [3]:

 I(x,y,t) = I(x+u, y+v, t+1) ε = u Ix + v Iy + It = 0

where u and v are the horizontal and vertical motion vectors of optical flow, respectively. We can find optical flow by using iteration to minimize ε. Iterative equations are presented as:

   [       ̅   ]

 ̅  [       ̅   ]

Where



 and

̅

denote horizontal and vertical neighborhood averages (

 and

), which are initially set to zero and then the weighted average of the value at neighboring points based on the in Fig. 9. The smoothness weight (α) plays an important role where the brightness gradient is small, for which the suitable value should be determined.

According to the characteristic of the HS algorithm, when applied with the BFB kernel it provides simplicity in the algorithm with reasonable performance and better quality.

However, it has two major drawbacks [3], the value of the smoothing weight (α) cannot be defined exactly because the suitable value is varying upon different image sequences.

Another problem is the suitable iteration times also cannot be defined for the best outcome, which impacts the processing time for the best motion vector at the output.

IV. EXPERIMENTALESULTS

In this section, the proposed algorithms are tested using Matlab program with an avi format input video files. The detected moving regions are marked with red pixels.

Although these two algorithms are quite simple, they lead to satisfactory results. The high accuracy moving object  boundaries obtained from this approach can be combined with

the other moving region extraction results in order to obtain good segmentations.

Fi g 2. The kernel coefficient ò BFB

Fig 3 . Weighted average kernel at neighboring points.

Fig. 6 and 7 presents the results obtained by two optical flow algorithms (Lucas-Kanade and Horn-Schunck). One can notice that the detection accuracy of the Horn-Schunck algorithm is higher than the Lucas-Kanade algorithm.

However, for the small objects, the Lucas-Kanade algorithm seems to be more effective.

V. CONCLUSIONS ANDFUTUREWORK 

In this paper, we have introduced algorithms for moving object detection and some experimental results achieved by these algorithms. The results are suitable with the proposed theories. The proposed algorithm detects the foreground effectively. We realize that temporal differencing method gives object boundaries, meanwhile optical flow method gives object regions.

In the future work, we desire to achieve the improvement of moving object detection algorithm by researching new approaches which are integrated the advantage of temporal differencing method and optical flow method. Furthermore, we can also use some of the morphological processing methods to gain the better results.

ACKNOWLEDGMENTS

I’m grateful to the useful advice of Dr. Truong Cong Dung  Nghi for helping me complete this work.

EFERENCES

[1] J. L. Barron, D. J. Fleet, and S. S. Beauchemin. “Performance of optical flow techniques”, International Journal of Computer Vision, 12(1):43– 

77, 1994.

[2] B.K.P. Horn and B.G. Schunck, “Determining optical flow”, Artificial Intelligence 17(1-3): pp.185-203, 1981.

[3] D. Kesrarat and V. Patanavijit, “ Tutorial of Motion Estimation Based on Horn-Schunk Optical Flow Algorithm in MATLAB”, 15(1): 8 -16, Jul. 2011

[4] D. J. Fleet and Y. Weiss, “Optical Flow Estimation”, Mathematical models for Computer Vision: The Handbook. N. Paragios, Y. Chen, and O. Faugeras (eds.), Springer, 2005.

[5] Gottipati. Srinivas Babu, “Moving object detection using Matlab”, International Journal of Engineering Research & Technology, Vol. 1 Issue 6, Aug. 2012.

[6]  N. Lu et al., “An Improved Motion Detection Method for Real-Time Surveillance”, IAENG International Journal of Computer Science, Feb.

2008.

[7] Y. Tian and A. Hampapur, “Robust Salient Motion Detection with Complex Background for Real-time Video Surveillance”, IEEE Computer Society Workshop on Motion and Video Computing, Breckenridge, Colorado, January 5 and 6, 2005.

[8] Y. Dedeo˘glu, “Moving object detection, Tracking and classification for Smart video surveillance”, M.S. thesis, Aug. 2004.

Fi g 4 . Difference in frame 20/21/22, Td=30

Fig 5 . Difference in frame 20/21, Waccum = 0.5, Td=15

Fi g 6. Lucas- Kanade’s algorithm with 2 grayscale image  frames 130/131

Fi g 7. Horn-Schunck ’s algorithm with 2 grayscale image  frames 100/101, alpha=25, iterative=95

[9] Wikipedia, the free encyclopedia. 20 February 2007. Lucas Kanade method. Available: http://en.wikipedia.org/wiki/Lucas_Kanade_method [10] Y. Shan and R.S. Wang, “Improved algorithms for motion detection and

tracking”, Optical Engineering, vol. 45, n 6, June 20 06.

[11] The MathWorks, Inc., “Image Processing Toolbox™ User‟s Guide”.

Version 8.3, [Online]. http:// www.mathworks.com

[12] K. E. Appiah, “Smart Detector: An Intelligent Hardware based Video Surveillance”, M.S. thesis, Stockholm, Jun. 2004.

[13] S. Seitz et al., “Motion and optical flow”, 2013.

[14] Gonzalo Vaca-Castano, “Matlab Tutorial. Optical Flow”, 2013.

Documento similar