Real-Time Dense and Accurate Parallel Optical Flow using CUDA

ABSTRACTA large number of processes in computer vision are based on the image motion measurement, which is the projection of thereal displacement on the focal plane. Such a motion is currently approximated by the visual displacement ﬁeld, called opticalﬂow. Nowadays, a lot of different methods are commonly used to estimate it, but a good trade-off between execution time andaccuracy is hard to achieve with standard integrations. This paper tackles the problem by proposing a parallel implementationof the well-known pyramidal algorithm of Lucas & Kanade, in a Graphics Processing Unit (GPU). It is programmed using theCompute Uniﬁed Device Architecture from NVIDIA corporation, to compute a dense and accurate velocity ﬁeld at about 15 Hzwith a 640 ×480 image deﬁnition. Keywords: image processing, monocular vision, optical ﬂow, parallel processing, GPU, CUDA. 1 INTRODUCTION1.1 Context The perception of the environment is a necessary pro-cess in many robotic tasks. Indeed, it is used as well fornavigation and obstacle detection in intelligent trans-port systems [2], which was the original context ofthis work, as for automatic video monitoring. To thisend, monocular vision is a convenient solution sincethe camera is a low cost sensor providing rich two-dimensional information contained in a single frame.Also, the depth of each image point can be estimatedfrom the study of two or more successive frames. Theﬁrst step in any process, whatever it deals with obstacledetection [9] or object tracking, is the optical ﬂow com-putation, that is an estimation of the apparent motionor the matching points between different images. Thus,we will focus on determining a dense subpixelic opti-cal ﬂow by only using two consecutive frames from avideo sequence, so that the velocity ﬁeld could be usedby most of processes.In addition, recent developments of GraphicsProcessing Units (GPUs) for High Performance Com-puting (HPC) were the main motivation of this work.Thanks to the Compute Uniﬁed Device Architecture(CUDA) from NVIDIA corporation, phenomenal en-Permission to make digital or hard copies of all or partof this work for personal or classroom use is grantedwithout fee provided that copies are not made or dis-tributed for proﬁt or commercial advantage and thatcopies bear this notice and the full citation on the ﬁrstpage. To copy otherwise, or republish, to post onservers or to redistribute to lists, requires prior speciﬁcpermission and/or a fee.hancement have been performed (up to a one hundredfactor [15]) by ofﬂoading computationally-intensiveactivities from the CPU to the GPU. The main re-quirement in order to use this promising solution isto have a highly parallelizable algorithm. In brief,this study is looking forward to provide an opticalﬂow respecting the previously described constraints bytaking advantage of parallel computing performs on aGPU.The paper is organized as follows. The rest of thissection presents some optical ﬂow estimation methodscommonly used in real-time robotic systems. Then,section 2 describes in detail the chosen algorithm whilesection 3 explains its parallel computing scheme. Fi-nally the last section presents experimental results andproposes a comparison tool for real-time optical ﬂowalgorithms.