15
Fast motion detection from airborne videos using graphics processing unit Kui Liu Ben Ma Qian Du Genshe Chen Downloaded from SPIE Digital Library on 15 Jun 2012 to 130.18.64.136. Terms of Use: http://spiedl.org/terms

Fast motion detection from airborne videos using graphics

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Fast motion detection from airbornevideos using graphics processing unit

Kui LiuBen MaQian DuGenshe Chen

Downloaded from SPIE Digital Library on 15 Jun 2012 to 130.18.64.136. Terms of Use: http://spiedl.org/terms

Fast motion detection from airborne videos usinggraphics processing unit

Kui Liu,a Ben Ma,a Qian Du,a and Genshe Chenb

aMississippi State University, Department of Electrical and Computer Engineering,Mississippi State, Mississippi 39762

[email protected] Research Resources LLC, Germantown, Maryland 20874

Abstract. In our previous work, we proposed a joint optical flow and principal componentanalysis (PCA) approach to improve the performance of optical flow based detection, wherePCA is applied on the calculated two-dimensional optical flow image, and motion detectionis accomplished by a metric derived from the two eigenvalues. To reduce the computationaltime when processing airborne videos, parallel computing using graphic processing unit(GPU) is implemented on NVIDIA GeForce GTX480. Experimental results demonstrate thatour approach can efficiently improve detection performance even with dynamic background,and processing time can be greatly reduced with parallel computing on GPU. © 2012 Societyof Photo-Optical Instrumentation Engineers (SPIE). [DOI: 10.1117/1.JRS.6.061505]

Keywords: motion detection; optical flow; principal component analysis; graphics processingunit; complete unified device architecture.

Paper 11165SSP received Sep. 2, 2011; revised manuscript received Jan. 20, 2012; accepted forpublication Mar. 19, 2012; published online May 10, 2012.

1 Introduction

As an important step in studies related to security and defense applications, motion detection hasbeen widely investigated.1,2 Based on background changing or not, motion detection algorithmsare developed into two categories: those with static background and those with dynamic back-ground. For instance, for a video with static background, background subtraction approach iswidely used and generally works well in most video surveillance systems;3–5 however, thisapproach may not perform well for an airborne based video because the background isdynamically changing. Fast motion detection from airborne videos with dynamic backgroundis critical to achieve real-time or near real-time surveillance. Although some approaches on fastmotion detection are discussed in the literature (Refs. 6–9), they mainly focus on videos taken byground-based cameras where the background is basically static and moving objects are relativelylarge. In this paper, we aim at fast motion detection of small objects from airborne videos withdynamic background, which is challenging particularly when video quality is poor due to sensorplatform scintillation and atmospheric turbulence.

Optical flow is a popular technique to compute motion information and widely used in manymotion detection and analysis schemes.10,11 There are two classical methods:11–14 the Lucas-Kanade (LK) method and the Horn-Schunck (HS) method. Both of them are based on atwo-frame differential algorithm. Because the HS method can detect minor motions of objectsand provide a 100% optical flow field,15 we will focus on the HS method for optical flowcomputations in this research. Principal component analysis (PCA) is a typical approach inmultivariate analysis,16 which can decorrelate original data and order the transformed databased on variances. For optical flows in a local small window, moving objects have more con-sistent flows. Therefore, applying PCA to the optical flow field may magnify the differencebetween real motion and small random movements caused by turbulence, etc. We have proposeda joint optical flow and PCA approach for motion detection. Experimental results show that thisapproach actually is an effective way of analyzing outdoor videos. Combined with corner based

0091-3286/2012/$25.00 © 2012 SPIE

Journal of Applied Remote Sensing 061505-1 Vol. 6, 2012

Downloaded from SPIE Digital Library on 15 Jun 2012 to 130.18.64.136. Terms of Use: http://spiedl.org/terms

detection,17 it can reduce false alarms for videos with either static or dynamic background. It alsoperforms well to detect the shape of a moving object.

In this paper, we propose to expedite the motion detection process of our developed method.To save computational complexity, several strategies are proposed for the calculation of opticalflow and PCA. To support near real-time decision making, it will be ideal to achieve on-boardprocessing for airborne videos. A graphic processing unit (GPU) is a good choice for parallelimplementation. The comparison between serial and parallel versions illustrates the greatspeed-up performance of the GPU-based implementation.

This paper is organized as follows. Section 2 reviews the joint method based on optical flowand PCA. Section 3 presents low-complexity versions of optical flow and PCA calculation.Section 4 introduces parallel implementation details. Section 5 presents the experiment usingan airborne video. Finally, Sec. 6 draws the conclusion.

2 Motion Detection Using PCA and Optical Flow

2.1 Horn-Schunck Optical Flow

The Horn-Schunck (HS) method is based on partial derivatives of the image to estimate opticalflow. Because the HS algorithm assumes smoothness of the flow over the image, it applies aglobal constraint on smoothness to express the brightness variation in certain areas of frames. Letf ðx; y; tÞ denote an image frame f ðx; yÞ taken at time t. Assume that the gray values of imageobjects in subsequent frames do not change over time in a small neighborhood, i.e.,

f ðxþ δx; yþ δy; t þ δtÞ ¼ f ðx; y; tÞ: (1)

If δt ¼ 1, then

f ðxþ δx; yþ δy; t þ 1Þ ¼ f ðx; y; tÞ: (2)

Using local Taylor series approximation,

f ðxþ δx; yþ δy; t þ 1Þ ¼ f ðx; y; tÞ þ ∂f∂x

δxþ ∂f∂y

δyþ ∂f∂t

δt: (3)

Comparing Eq. (3) with Eq. (2), we have

∂f∂x

δxþ ∂f∂y

δyþ ∂f∂t

δt ¼ 0 (4)

and

∂f∂x

δxδt

þ ∂f∂y

δyδt

þ ∂f∂t

δtδt

¼ 0: (5)

Equation (5) can be rewritten as

f xuþ f yvþ f t ¼ 0; (6)

where u ¼ δxδt and v ¼ δy

δt are the x and y components of the velocity or optical flow, respectively,and f x ¼ ∂f

δx, f y ¼ ∂fδy and f t ¼ ∂f

δt , are the derivatives of the t-th image at (x, y) in the correspondingdirections, which can be computed as

f x ¼1

4ff ðx; yþ 1; tÞ − f ðx; y; tÞ þ f ðxþ 1; yþ 1; tÞ − f ðxþ 1; y; tÞ

þ f ðx; yþ 1; t þ 1Þ − f ðx; y; t þ 1Þ þ f ðxþ 1; yþ 1; t þ 1Þ − f ðxþ 1; y; t þ 1Þg; (7)

f y ¼1

4ff ðxþ 1; y; tÞ − f ðx; y; tÞ þ f ðxþ 1; yþ 1; tÞ − f ðx; yþ 1; tÞ

þ f ðxþ 1; y; t þ 1Þ − f ðx; y; t þ 1Þ þ f ðxþ 1; yþ 1; t þ 1Þ − f ðx; yþ 1; t þ 1Þg; (8)

Liu et al.: Fast motion detection from airborne videos using graphics processing unit

Journal of Applied Remote Sensing 061505-2 Vol. 6, 2012

Downloaded from SPIE Digital Library on 15 Jun 2012 to 130.18.64.136. Terms of Use: http://spiedl.org/terms

f t ¼1

4ff ðx; y; t þ 1Þ − f ðx; y; tÞ þ f ðxþ 1; y; t þ 1Þ − f ðxþ 1; y; tÞ

þ f ðx; yþ 1; t þ 1Þ − f ðx; yþ 1; tÞ þ f ðxþ 1; yþ 1; t þ 1Þ − f ðxþ 1; yþ 1; tÞg: (9)

Obviously, Eq. (6) alone is not sufficient to determine the two unknowns u and v. The HSmethod imposes a smoothness constraint to minimize the distortion in flow. The flow can beformulated as a global energy function:

E ¼ZZ

Lðu; vÞdxdy ¼ZZ

ðf xuþ f yvþ f tÞ2 þ α2ðj∇uj2 þ j∇vj2Þdxdy; (10)

where j∇uj2 ¼ ð∂u∂xÞ2 þ ð∂u∂yÞ2 ¼ u2x þ u2y and j∇vj2 ¼ ð∂v∂xÞ2 þ ð∂v∂yÞ2 ¼ v2x þ v2y are the magnitudesof the gradients ∇u and ∇v, respectively. Here, α2 is regularization constant; a large value of αresults in a smoother flow. Equation (10) can be minimized by solving the correspondingEuler-Lagrange differential equations:

∂L∂u

−∂∂x

∂L∂ux

−∂∂y

∂L∂uy

¼ 0∂L∂v

−∂∂x

∂L∂vx

−∂∂y

∂L∂vy

¼ 0; (11)

which results in:

f xðf xuþ f yvþ f tÞ − α2Δu ¼ 0 f yðf xuþ f yvþ f tÞ − α2Δv ¼ 0: (12)

In Eq. (12), Δ ¼ ∂2∂x2 þ ∂2

∂y2 represents the Laplacian operator. To separate uðx; yÞfrom Δuðx; yÞ, weuse the fact that

Δuðx; yÞ ¼ uðx; yÞ − uðx; yÞ; (13)

where uðx; yÞ is a weighted average in a neighborhood around the pixel (x, y). Then Eq. (12) canbe simplified as:

ðf 2x þ α2Þuþ f xf yv ¼ α2u − f xf t f xf yuþ ðf 2y þ α2Þv ¼ α2v − f yf t; (14)

from which u and v can be solved as:

u ¼ u − f xf xuþ f yvþ f tα2 þ f 2x þ f 2y

v ¼ v − f yf xuþ f yvþ f tα2 þ f 2x þ f 2y

: (15)

Since u and v depends on the neighboring values of the flow field, the solution should bereevaluated once the neighbors have been updated. Hence, the iterative solution is:

ukþ1 ¼ uk − f xf xuk þ f yvk þ f tα2 þ f 2x þ f 2y

; (16)

vkþ1 ¼ vk − f yf xuk þ f yvk þ f tα2 þ f 2x þ f 2y

; (17)

where the superscripts k and k þ 1 denote the k’th and (k þ 1)-th iteration, respectively. For thearea with small gradient, α2 plays an important role. A larger value of α2 results in a smootherflow. In our experiments using 8-bit videos, it is empirically set to be 30,000. The result of theHS method yields a high density of flow vectors, i.e., the flow information missing in the innerpart of homogeneous objects is filled in from the motion boundaries. This is a clear advantageover local methods.

Liu et al.: Fast motion detection from airborne videos using graphics processing unit

Journal of Applied Remote Sensing 061505-3 Vol. 6, 2012

Downloaded from SPIE Digital Library on 15 Jun 2012 to 130.18.64.136. Terms of Use: http://spiedl.org/terms

2.2 PCA and Optical Flow

Based on calculated optical flow vector (u, v), two optical flow images can be created with pixelvalues set as u and v, respectively. A mask of size n × n slides through the optical flow imagesU and V . For each location (x, y), a n2 × 2 data matrix X can be constructed to represent allthe optical flows covered by the mask, with the first column as u and the second column as v.The covariance matrix can be calculated as:

Σ ¼ XT X; (18)

where X is the optical flow matrix after mean removal. After eigen-decomposition, two eigen-values (λ1, λ2) are assigned to the central pixel of the mask. Motion detection is accomplished byanalyzing the eigenvalue(s). Compared to original u and v values in the optical flow image, thetwo eigenvalues λ1 and λ2 correspond to major and minor optical flow components respectively,which are more effective for motion detection. Figure 1 illustrates the proposed method with a3 × 3 mask.

Intuitively, taking λ1 into consideration is sufficient because it corresponds to the major flowcomponent, while λ2 corresponds to the minor flow component or even turbulence. An appro-priate threshold can be determined by using the Otsu’s method on the λ1 histogram.18 In practicalapplication, λ2 sometimes should be considered as well since pixels inside object boundariesusually have quite large λ2 but small λ1. Therefore, taking which part into consideration isnot trivial. Depending on specific video sequence, λ1 or λ2 or even both need to be used forthresholding. The detailed investigation will be given in the later sections.

The proposed motion detection algorithm can be summarized as follows:19

1. Calculate optical flow between two adjacent frames (after registration as needed).2. For each pixel in the two-dimensional (2-D) optical flow data, perform PCA for a local

mask, and two eigenvalues are assigned to the central pixel.3. Apply thresholding to the eigenvalues of all the pixels.

Some variants exist when implementing the proposed method differently.19

1. In step 1, optical flow data from multiple frames can be combined to emphasize thedesired optical flows of moving objects and to emphasize the randomness of turbulence.

2. In step 2, masks with different sizes can be used depending on the size of targets.Intuitively, for a large moving object, mask size should be large.

3. In step 3, thresholding can be applied on λ1 or λ2 combination of the two, depending onthe relative size of objects and the features of turbulence.

Fig. 1 Proposed method with a 3 × 3 mask.

Liu et al.: Fast motion detection from airborne videos using graphics processing unit

Journal of Applied Remote Sensing 061505-4 Vol. 6, 2012

Downloaded from SPIE Digital Library on 15 Jun 2012 to 130.18.64.136. Terms of Use: http://spiedl.org/terms

2.3 Quantitative Evaluation

A receiver operating characteristic (ROC) curve can be drawn to depict the tradeoff between hitrates and false alarm rates as the threshold being changed.20 The hit rate and false alarm rate aredefined as:

hit rate ¼ hit area

hit areaþmissing part; (19)

false alarm rate ¼ false alarm area

false alarm areaþ hit area: (20)

After an ROC curve is drawn, the area under the curve can be estimated. A large area meansbetter detection performance.

3 Low-Complexity Algorithms

3.1 Spatial Filtering

When dealing with matrix differential operation and convolution, separate linear filtering canalways make full use of its competitive advantage. It decomposes a 2-D spatial filtering processinto two substages, row and column filtering. The column filtering is usually applied on theresult of row filtering.21 Take the 3 × 3 local averaging for instance, the traversal convolutioncan be separated into a 3 × 1 column filter and 1 × 3 raw filter:

"1

1

1

#× ½ 1 1 1 � ¼

"1 1 1

1 1 1

1 1 1

#: (21)

For Eqs. (7)–(9), the derivative f x, f y, and f t in optical flow can be calculated using fourseparate linear filters:

�−11

�× ½ 1 1 � ¼

�−1 −11 1

�; (22)

�1

1

�× ½−1 1 � ¼

�−1 1

−1 1

�: (23)

If the Sobel operators are used to calculate the derivatives, then the four linear filters are

"−10

1

#× ½ 1 2 1 � ¼

"−1 −2 −10 0 0

1 2 1

#; (24)

"1

2

1

#× ½−1 0 1 � ¼

"−1 0 1

−2 0 2

−1 0 1

#: (25)

For local average u and v, the two filters are:

"1∕40

1∕4

#þ ½ 1∕4 0 1∕4 � ¼

"0 1∕4 0

1∕4 0 1∕40 1∕4 0

#(26)

Liu et al.: Fast motion detection from airborne videos using graphics processing unit

Journal of Applied Remote Sensing 061505-5 Vol. 6, 2012

Downloaded from SPIE Digital Library on 15 Jun 2012 to 130.18.64.136. Terms of Use: http://spiedl.org/terms

and the net effect is to apply the Laplacian operator"0 1 0

1 −4 1

0 1 0

#:

Here, “+” in Eq. (26) denotes that the two one-dimensional (1-D) filters are applied on theoriginal image.

Table 1 shows the advantage of separate linear filters especially when the window size n islarge. An n × n window for an m-pixel image is separated into a 1 × n row filter and an n × 1

column filter. If the window size is 5 × 5 and the image size is 720 × 312, the number of opera-tions by the separate linear filtering are 2.2 × 106. In the regular spatial convolution, the numberof computation is 5.6 × 106. Compared to 2-D filtering, 1-D filters are more suitable to parallelcomputing.

Table 1 Number of multiplications using 2-D and 1-D filtering.

Regular 2-D filtering Separate 2 1-D filtering

Local average calculation n2m 2 nm

Derivative calculation n2m 2 nm

Table 2 summarizes the number of multiplications in terms of window size n × n and the numberof pixels m.

Original Fast

Covariance matrix calculation 3 n2m 3 mþ 2 nm

Eigenvalue determination Oð23Þm 4m

Fig. 2 Optical flow and PCA parallel algorithm.

Liu et al.: Fast motion detection from airborne videos using graphics processing unit

Journal of Applied Remote Sensing 061505-6 Vol. 6, 2012

Downloaded from SPIE Digital Library on 15 Jun 2012 to 130.18.64.136. Terms of Use: http://spiedl.org/terms

3.2 Fast PCA

PCA includes data covariance matrix calculation and its eigen-decomposition. For optical flow

data, the covariance matrix Σ ¼hu2uv

uvv2

i. Since the PCA in the joint method is applied to the

area covered by a local window, u2, uv, v2 at each location (x, y) are repeatedly computed if usingthe 2-D filtering. However, we can generate three matrices for the whole image: U2, UV, andV2, then retrieve the corresponding valued of u2, uv, v2 without repeated calculation. We alsoemploy the separate linear filters for local averaging when computing Σ.

Eigen-decomposition using singular value decomposition (SVD) is also computationally

expensive. However, for a 2 × 2 covariance matrixhx1x2

x2x4

i, the two eigenvalues can be easily

solved as:

λ1 ¼x1 þ x4 þ

ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiðx1 − x4Þ2 þ 4x22

p2

; (27)

λ2 ¼x1 þ x4 −

ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiðx1 − x4Þ2 þ 4x22

p2

: (28)

Table 2 summarizes the number of multiplications in terms of window size n × n and thenumber of pixels m.

Fig. 3 Layout of the thread block grid for the row filtering pass.21

Fig. 4 Layout of the thread block grid for the column filtering pass.21

Liu et al.: Fast motion detection from airborne videos using graphics processing unit

Journal of Applied Remote Sensing 061505-7 Vol. 6, 2012

Downloaded from SPIE Digital Library on 15 Jun 2012 to 130.18.64.136. Terms of Use: http://spiedl.org/terms

4 Implementation

A GPU is a processor attached to a graphic card for floating point operations. A graphicsaccelerator incorporates custom microchips which contain special mathematical operationscommonly used in graphics rendering. The efficiency of the microchips, therefore, determinesthe effectiveness of the graphics accelerator. A GPU implements a number of graphics primitiveoperations much faster than the host CPU. Many of them feature a linear time complexity in thenumber of pixels; thus, they are particularly well-suited for real-time image processing. Today,parallel GPUs have begun making computational inroads against the CPU as a subfield ofresearch called general purpose computing on GPU. NVIDIA’s complete unified device archi-tecture (CUDA) platform is the most widely adopted programming model for GPU computing,with OpenCL also being offered as an open standard.22

GPU is usually treated as a parallel computer with shared memory architecture. As allprocessors of the GPU can share data within a global memory space, it perfectly fits thedata parallelism. However, because of its applied shared memory model, the major bottleneckis memory communication between the host and device; unnecessary data transfer between host

Fig. 5 (a) Input frame; (b) optical flow (ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiu2 þ v2

p); (c) optical flow (u ∩ v ); (d) Kalman; (e) GMM;

(f) DSTEI; (g) MHI; (h) Yao’s method; (i) Cao’s method; and (j) joint method.

Liu et al.: Fast motion detection from airborne videos using graphics processing unit

Journal of Applied Remote Sensing 061505-8 Vol. 6, 2012

Downloaded from SPIE Digital Library on 15 Jun 2012 to 130.18.64.136. Terms of Use: http://spiedl.org/terms

and device should be avoided as much as possible.23 In other words, most of the data computa-tion should take place in GPU without interruption. Since data sharing between GPU coresis a time consuming job, the data throughput requirement makes current GPUs inappropriatefor solving a bunch of small matrix operation problems. Two principal rules of GPU program-ming should be followed: 1. to parallelize a large number of scalar/vector addition/multiplications if possible, and 2. to reduce communications between host and devices asmuch as possible.

The CUDA CUBLAS library provides high performance computing implementation for theBasic Linear Algebra Subprograms (BLAS) level 1 to level 3 operations. Thus, our parallelalgorithms are designed to utilize the existing parallel linear algebra library. The flow chartof the GPU implementation on Optical Flow and PCA algorithm is shown in Fig. 2. It is similarto the serial version although it has to send data back and forth between host and device. To fullytake advantage of GPU computing power and reduce unnecessary host/device communicationoverhead, the large size of matrix/vector multiplications, such as PCA, eigen-decomposition,and sliding widow addition or subtraction in optical flow are conducted in GPU, while themanipulations of relatively small constant computation is left in CPU. Figures 3 and 4 givethe detail layout of the thread block grid for the row and column filtering pass based on separatelinear filtering.

5 Experiments

5.1 The Performance of PCA and Optical Flow

The experiment was based on an airborne video with a moving background. It was taken by acamcorder mounted on a helicopter. In addition to atmospheric turbulence, the small size of

Fig. 6 Combined results on the airborne video. (a) Corner detection. (b) The four vehicles in (a).(c) Extracted region using the MHI method. (d) Extracted region using the joint method.

Liu et al.: Fast motion detection from airborne videos using graphics processing unit

Journal of Applied Remote Sensing 061505-9 Vol. 6, 2012

Downloaded from SPIE Digital Library on 15 Jun 2012 to 130.18.64.136. Terms of Use: http://spiedl.org/terms

objects and scintillation from the airborne platform further increase the difficulties of detection.Figure 5(a) shows an input frame, where three moving vehicles on the highway are highlightedwith yellow circles. The adjacent frames were preregistered using the method in Ref. 17 Wecompared our proposed method with the original optical flow method, the motion detectionmethods based on Kalman filtering,24 background modeling using GMM,25 difference-basedspatial temporal entropy image (DSTEI),26 forward-backward motion history image (MHI),27

Yao’s method in Ref. 28, and Cao’s method in Ref. 29.Figure 5(b) and 5(c) shows the detection results based on optical flow values, where three

vehicles on the highway were completely detected and the shape of the vehicles were outlinedcompactly. Figure 5(d)–5(i) is the results from other methods. From comparison, the detectedvehicles’ sizes were too small when using the Kalman filtering, GMM, and Yao’s method, whiletoo big when using DSTEI, MHI, and Cao’s method. False alarm pixels also increased in theseresults. Figure 5(h) is the result of the joint method, which could further reduce false alarm,and the vehicle sizes seemed to be more reasonable. Although the proposed method providedthe best result, there were still several false alarm pixels, mainly located around the edgesof buildings.

Corner-based detection17 can be used to remove false alarms found in the above detectionresults. Harris corners30 were detected from two different images, from which many false alarmpixels around buildings could be removed. False alarms were further reduced through localtracking of detected corners in several consecutive frames. In conjunction with the proposedmethod, the complete regions of moving objects can be segmented for the corner based detectionwhile the false alarm can be reduced.17,19 As shown in Fig. 6(a), the corner-based method canaccurately detect the three vehicles without false alarms; however, it detects only a cornercorresponding to an object as detailed in Fig. 6(b). Figure 6(c) shows the extracted vehicles

Fig. 7 Combined results on another airborne video. (a) Corner detection. (b) The four vehicles in(a). (c) Extracted region using the MHI method. (d) Extracted region using the joint method.

Liu et al.: Fast motion detection from airborne videos using graphics processing unit

Journal of Applied Remote Sensing 061505-10 Vol. 6, 2012

Downloaded from SPIE Digital Library on 15 Jun 2012 to 130.18.64.136. Terms of Use: http://spiedl.org/terms

using the MHI method, where the object sizes were slightly magnified. Figure 6(d) is theextracted vehicles using the proposed method, where the object sizes were reasonably reducedand pruned. The result using another airborne video is shown in Fig. 7, which further demon-strates that the proposed method can better extract object shapes.

There are 123 ground truth pixels in the airborne frame (of size 720 × 313) in Fig. 5. Table 3lists the performance of the joint method when using different window size and decision metric,which shows that λ1 ∪ λ2 with a 5 × 5 window provided the best performance for this video.Figure 8 shows the ROC curves of different methods, where the joint method outperformedothers.

Table 3 The area of ROC in the airborne video.

Area of ROC λ1 λ1∪λ2 λ1∩λ2 λ2 λ1 þ λ2

3 × 3 0.6327 0.6833 0.6495 0.6335 0.6022

5 × 5 0.6957 0.7125 0.6773 0.6640 0.6237

7 × 7 0.6716 0.6742 0.6390 0.6310 0.6213

9 × 9 0.6517 0.6604 0.6088 0.6242 0.6033

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

false alarm

hit r

ate

optical flow

kalmanDSTEI

GMM

MHI

Cao's MethodYao's Method

propsed method

Fig. 8 ROC curves by different methods.

Table 4 The processing time (in ms) for PCA calculation with different window size.

CPU CPUþGPU

3 × 3 135.3 20.5

5 × 5 143.9 20.5

7 × 7 153.3 19.6

9 × 9 159.6 18.5

11 × 11 166.4 18.5

13 × 13 175.7 18.0

15 × 15 186.5 17.5

17 × 17 185.9 18.4

Liu et al.: Fast motion detection from airborne videos using graphics processing unit

Journal of Applied Remote Sensing 061505-11 Vol. 6, 2012

Downloaded from SPIE Digital Library on 15 Jun 2012 to 130.18.64.136. Terms of Use: http://spiedl.org/terms

5.2 Parallel Implementation

In our experiment, we took the very recent GeForce GTX 480 with 480 cores and 1.5 GBmemory. The CPU is Intel core i7-860 2.80 GHz and 4 Gb memory. Only the low-complexityalgorithms in Sec. 3 were implemented.

Table 4 shows the PCA processing time for different window size. In the serial version, therunning time was increased when the window size was larger; in the parallel version, it was notchanged much. As for the running time for optical flow computation: CPU along required26.5 ms, with GPU the time was reduced to 12.8 ms. The speedup performance is shown inFig. 9, which was improved with a spatial larger window.

6 Conclusion

In this paper, we further study a joint optical flow and PCA approach for motion detection. Wefocus on the HS method for optical flow computation since it can provide a 100% optical flowfield. Instead of considering the original optical flow, the two eigenvalues of the covariancematrix of local optical flows are analyzed. Because the first eigenvalue represents the majormotion component and the second eigenvalue represents the minor motion component, theyare more useful to detect true motions while more successfully suppressing false alarms.This joint method is also effective in extracting the actual size of a moving object in conjunctionwith difference image-based corner detection.

Both optical flow and PCA are computationally expensive, in particular, when 2-D spatialfiltering is involved in the original algorithm. We develop low-complexity versions based onseparate 1-D filtering. The two eigenvalues can be determined by directly solving a quadraticfunction instead of using SVD. The running time is dramatically decreased. The savings aremore significant for larger sliding windows.

The GPU-based parallel implementation of low-complexity versions of optical flow and PCAare designed. With the workload being balanced between GPU and CPU, the parallel implemen-tation shows high scalability on our test machine (i.e., NVIDIA’s GTX480). The speedupperformance is remarkable for larger sliding windows.

References

1. A. Mitiche and P. Bouthemy, “Computation and analysis of image motion: a synopsis ofcurrent problems and methods,” Int. J. Comput. Vis. 19(1), 29–55 (1996), http://dx.doi.org/10.1007/BF00131147.

2. W. Hu et al., “A survey on visual surveillance of object motion and behaviors,” IEEE Trans.Syst. Man. Cybern. C Appl. Rev. 34(3), 334–352 (2004), http://dx.doi.org/10.1109/TSMCC.2004.829274.

3. S.-C. S. Cheung and C. Kamath, “Robust techniques for background subtraction in urbantraffic video,” Proc. Vis. Comm. Imag. Process. 1, 881–892 (2004).

4. H. Shimai et al., “Adaptive background estimation based on robust statistics,” Syst. Comput.Jpn. 38, 98–108 (2007), http://dx.doi.org/10.1002/scj.10612.

0

2

4

6

8

10

12

3×3 5×5 7×7 9×9 11×11 13×13 15×15 17×17

Fig. 9 Speed-up performance.

Liu et al.: Fast motion detection from airborne videos using graphics processing unit

Journal of Applied Remote Sensing 061505-12 Vol. 6, 2012

Downloaded from SPIE Digital Library on 15 Jun 2012 to 130.18.64.136. Terms of Use: http://spiedl.org/terms

5. C. Stauffer and W. E. L. Grimson, “Adaptive background mixture models for real-timetracking,” in Proc. IEEE Conference on Computer Vision and Pattern Recognition,Vol. 2, pp. 246–252 (1999).

6. R. Culter and L. S. Davis, “Robust real-time periodic motion detection, analysis, and appli-cations,” IEEE Trans. Pattern Anal. Mach. Intell. 22(8), 781–796 (Aug. 2000), http://dx.doi.org/10.1109/CVPR.1999.784637.

7. J. Pons et al., “Fast motion detection in compressed domain for video surveillance,”Electron. Lett. 38(9), 409–411 (2002), http://dx.doi.org/10.1049/el:20020290.

8. J. Zheng et al., “Fast motion detection based on accumulative optical flow and double back-ground model,” Lect. Notes Comput. Sci. 3802, 291–296 (2005), http://dx.doi.org/10.1007/11596981_43.

9. N. Lu et al., “An improved motion detection method for real-time surveillance,” IAENG Int.J. Comp. Sci. 35(1) (2008).

10. H. Yalcin et al., “A flow-based approach to vehicle detection and background mosaickingin airborne video,” in Proc. IEEE Conference on Computer Vision and Pattern Recognition,Vol. 2, pp. 1202 (2005), http://dx.doi.org/10.1109/CVPR.2005.29.

11. B. K. P. Horn and B. G. Schunck, “Determining optical flow,” Artif. Intell. 17(1–3),185–203 (1981), http://dx.doi.org/10.1016/0004-3702(81)90024-2.

12. B. K. P. Horn and B. G. Schunck, “Determining optical flow,” Artif. Intell. 59(1–2), 81–87(1993), http://dx.doi.org/10.1016/0004-3702(93)90173-9.

13. B. D. Lucas and T. Kanade, “An iterative image registration technique with an applicationto stereo vision,” in Proc. of the 7th International Joint Conference on Artificial Intelli-gence, Vol. 2, pp. 674–679 (1981).

14. B. Ruhn, J. Weickert, and C. Schnorr, “Lucas/Kanade meets Horn/Schunck: combininglocal and global optic flow methods,” Int. J. Comput. Vis. 61(3), 211–231 (2005),http://dx.doi.org/10.1023/B:VISI.0000045324.43199.43.

15. K. Pearson, “On lines and planes of closest fit to systems of points in space,” Philos. Mag.2(6), 559–572 (1901), http://dx.doi.org/10.1080/14786440109462720.

16. H. Hotelling, “Analysis of a complex of statistical variables into principal components,”J. Educ. Psychol. 24(6), 417–441 (1933), http://dx.doi.org/10.1037/h0071325.

17. K. Liu, H. Yang, B. Ma, and Q. Du, “A joint optical flow and principal component analysisapproach for motion detection,” in 2010 IEEE International Conference on AcousticsSpeech and Signal Processing (ICASSP), pp. 1178–1181 (14–19 March 2010), http://dx.doi.org/10.1109/ICASSP.2010.5495379.

18. N. Otsu, “A threshold selection method from gray-level histograms,” IEEE Trans. Syst.Man. Cybern. C Appl. Rev. 9(1), 62–66 (1979), http://dx.doi.org/10.1109/TSMC.1979.4310076.

19. K. Liu, Q. Du, H. Yang, and B. Ma, “Optical flow and principal component analysis-basedmotion detection in outdoor videos,” EURASIP J. Adv. Signal Process. (2010), http://dx.doi.org/10.1155/2010/680623.

20. T. Fawcett, “An introduction to ROC analysis,” Pattern Recogn. Lett. 27(8), 861–874(2006), http://dx.doi.org/10.1016/j.patrec.2005.10.010.

21. V. Podlozhnyuk, “Image Convolution with CUDA,” http://developer.download.nvidia.com/compute/cuda/1.1Beta/x86_64_website/projects/convolutionSeparable/doc/convolutionSeparable.pdf (2007).

22. Nvidia. [Online]. Available: http://developer.download.nvidia.com/compute/cuda/2_3/docs/CUBLAS_Library_2.3.pdf.

23. H. Yang, Q. Du, and G. Chen, “Unsupervised hyperspectral band selection using graphicsprocessing units,” IEEE J. Select. Top. Earth Observat. Rem. Sens. 4(3), 660–668 (2011),http://dx.doi.org/10.1109/JSTARS.2011.2120598.

24. K.-P. Karmann and A. V. Brandt, “Moving object recognition using an adaptive backgroundmemory,” in Time-varing Image Processing and Moving Object Recognition, V.Cappellini,Ed., Vol. 2, pp. 297–307, Elsevier, Amsterdam (1990).

25. P. Kaewtrakulpong and R. Bowden, “An improved adaptive background mixture model forreal-time tracking with shadow detection,” in Proc. of 2nd European Workshop onAdvanced Video-based Surveillance Systems (2001).

Liu et al.: Fast motion detection from airborne videos using graphics processing unit

Journal of Applied Remote Sensing 061505-13 Vol. 6, 2012

Downloaded from SPIE Digital Library on 15 Jun 2012 to 130.18.64.136. Terms of Use: http://spiedl.org/terms

26. G. Jing, C. Siong, and D. Rajan, “Foreground motion detection by difference-based spatialtemporal entropy image,” in Proc. of IEEE TENCON Conference (2004), http://dx.doi.org/10.1109/TENCON.2004.1414436.

27. Z. Yin and R. Collins, “Moving object localization in thermal imagery by forward-backward MHI,” in Proc. of IEEE Computer Vision and Pattern Recognition Workshop(2006), http://dx.doi.org/10.1109/CVPRW.2006.131.

28. F. Yao, G. Shao, A. Sekmen, and M. Malkani, “Real-time multiple moving targets detectionfrom airborne IR imagery by dynamic Gabor filter and dynamic Gaussian detector,”EURASIP J. Imag. Video Process., Article ID 124681 (2010), http://dx.doi.org/10.1155/2010/124681.

29. X. Cao et al., “Vehicle detection and tracking in airborne videos by multi-motion layeranalysis,” Mach. Vis. Appl. 1–15 (2011), http://dx.doi.org/10.1007/s00138-011-0336-x.

30. C. Harris and M. J. Stephens, “A combined corner and edge detector,” in Proceedings of the4th Alvey Vision Conference, pp. 147–152 (1988).

Biographies and photographs of the authors are not available.

Liu et al.: Fast motion detection from airborne videos using graphics processing unit

Journal of Applied Remote Sensing 061505-14 Vol. 6, 2012

Downloaded from SPIE Digital Library on 15 Jun 2012 to 130.18.64.136. Terms of Use: http://spiedl.org/terms