420 likes | 505 Views
Horn-Schunk Optical Flow. Presented by Phillip Woodhull for ECE 847. My Purpose. To research, implement, interpret, and demonstrate the Horn-Schunk algorithm for detecting optical flow.
E N D
Horn-SchunkOptical Flow Presented by Phillip Woodhull for ECE 847
My Purpose • To research, implement, interpret, and demonstrate the Horn-Schunk algorithm for detecting optical flow. • Specifically, I will be determining effects and good values for lambda and the number of iterations…more on that later.
What is Optical Flow? • According to Wikipedia: • “A concept which approximates the motion of objects within a visual representation” • According to Dr. Birchfield: • “The ‘apparent’ motion of the brightness pattern in an image”
Examples of optical flow • Although the picture is not moving, there is apparent downward motion inside the gray rectangle.
Examples of optical flow • My test videos were “Flower garden sequence” and “Person walking in a circle,” downloaded from Michael Black’s website: http://www.cs.brown.edu/people/black/
Examples of optical flow Flower garden
Examples of optical flow • There is essentially one major flow object in this video (the tree), with other minor flow objects in the background (the flowers, house, and small trees).
Examples of optical flow Before • For this project, I will be smoothing out the flowers pretty heavily for the sake of clarity in my results. After
Examples of optical flow Walking
Examples of Image Flow • The only actual flow object is the walker. However, there is also some random motion in the background due to random noise.
Differences between LK and HS • In Lucas-Kanade (LK), we assumed that blocks of pixels representing features moved exactly the same. • In Horn-Schunk (HS), the assumption is that groups of pixels move similarly, but not the same. • This interdependence on other pixels is produced by the use of a Laplacian (the “Mexican Hat”).
Differences between LK and HS • In LK, the displacement vectors u and v are values. • In HS, u and v are functionals, thus mandating the use of calculus of variations.
The Horn-Schunk Algorithm The algorithm according to Dr. Birchfield:
The Variables • Lambda • Number of iterations
The Variables: Lambda • Value of lambda • Lambda affects the weight of the gradient in the calculation of the motion vector. • The bigger lambda is, the smaller the effect of the gradient in the u and v vectors, and the larger the effect of the Laplacian.
The Variables: Lambda • Effects of lambda • Greater lambda produces greater directional accuracy in the vectors • Greater lambda produces shorter direction vectors, distorting the displacement magnitudes slightly.
The Variables: Lambda • My values of lambda • Flower garden: 140 • Walking: 200
The Variables • Lambda • Number of iterations
The Variables: Iterations • The number of iterations affects the sensitivity and accuracy of the detection. • The greater the number of iterations, the more motion will be detected. • The greater the number of iterations, the slower the algorithm will run (directly proportionally).
The Variables: Iterations • My number of iterations: • Flower garden: 5 • Walking: 4
Additional Variables • Some additional constraints • Thresholding of vectors • For this project, the displayed vectors were limited to those on a grid of every 4 pixels. • Vectors of magnitudes less than 2 so as to not clutter the final results. • Vectors of magnitudes more than 10 were eliminated because there is no motion that great in these sequences.
Additional Variables • The x and y gradient images were computed with a kernel size of 3 and a sigma of 1.7. • Both sequences’ images were smoothed with a size 3 kernel with a sigma of 1.7.
Conclusions • Lambda and the number of iterations is variable on the image itself and on the quality you are trying to achieve.
Conclusions • Since Horn-Schunck is a dense optical flow algorithm, pixels that are very close in brightness and proximity can be confused in the algorithm, producing occasional random results.
Conclusions • Finally, although Horn-Schunck is considered to be one of the best optical flow algorithms, it is still no match for the God-created human eye.