Computer Vision: Motion and Optical Flow
A property of a scene that I want to recover is motion. Given a sequence of images, we would like to estimate motion to see how things are moving with respect to the camera. An example is a camera surveillance system, or tracking the motion of facial sequences. Measuring the motion of a camera itself is important. We also need to track the motion for autonomous cars, etc.
Both cell phones and computer mouse have a tracking system which is based on estimating motion, also tracking facial features.
Let's first formalize what to measure.
Suppose there is a scene point, and it is given by image location. Given a time direction 𝛿t, how does the diagram move? This 3D displacement vector gets mapped with a 2D vector in the image space. A collection of 2D image space vectors is called the motion field images. These 2D image motion vectors are related to 3D vectors via the laws of perspective projection. Motion field is what we would like to measure.
The optical is the direction of the motion of a brightness pattern around a pixel, and the length of an arrow in the flow diagram is the magnitude of the motion.
Suppose there is a sphere that is spinning. If we take a series of images within time, all of them will look alike because the sphere is completely uniform. But clearly an object is moving, so there is a motion field. However, if a light source is moving, there is optical flow, but no motion field. Therefore, optical flow is not the same thing as motion flow. In general, we do assume that the optical field is the same as the motion field.
We start by formally defining optical flow. Let's take a particular pixel at location (x,y) and now the new coordinates of the pixel are (x + 𝛿x, y + 𝛿y) and the optical flow of the pixel is (𝛿x/𝛿t, 𝛿y/𝛿t) (displacement is (𝛿x, 𝛿y)) and the optical flow field is a set of optical flow vectors, one for every picel in the image. To do that, first define constraints on the optical flow vectors. We first assume that the brightness of an image pixel remains constant over time. I(x + 𝛿x. y + 𝛿y, t + 𝛿t) = I(x,y,t) which is the relationship of the intensity of a pixel before and after motion.
The second assumption is that the two images are taken in rapid succession meaning that time step 𝛿t is small, and the displacement (𝛿x, 𝛿y) is also relatively small. How is this useful? We can think about image intensities as a 3D function, dependent on 2 spatial coordinates. I(x + 𝛿x. y + 𝛿y, t + 𝛿t) = I(x, y, t) + (𝛿I/𝛿x)𝛿x + (𝛿I/𝛿y)𝛿y + (𝛿I/𝛿z)𝛿z, which is a Taylor First-Order Approximation. The value of a function of a point can be approximated by the value at the neighboring point added with the derivative of said function.
For the Taylor First-Order Approximation, we need to assume that the function is continuous. In theory we want to assume high enough resolution for continuous functions. This will only work if the images are smooth, without strong step edges. This is why these methods have problems around object boundaries. Ix is the horizontal image gradient and Iy is the vertical gradient.
We want to get Ix 𝛿x/𝛿t + Iy 𝛿y/𝛿t + It = 0. U and v are the optical elements and Ix and It are the flow gradients/vectors per pixel.
There are constraints for images, but we need additional constraints needed in order to solve images. There is one constraint that still fulfills modern optical flow methods that is covered here.
The Lucas Kanade Solution means that the optical flow is the same for all neighboring pixels in a small window, assuming that Ix(k,l)u + Iy(k,l)v + It(k,l) = 0, so now we have n^2 equations, and 2 unknowns can stack these equations into a series of equations and subsequently solve this system through a least squares solution. We made the assumption that the motion vectors for all the pixels in a small window will be the same, which is why motion vectors are similar for pixels that are neighboring.
There is a change of intensity along the x and y dimension, as well as a change of intensity in the time direction. Think about an edge that has an intensity gradient, and moves around the edge direction. These intensities will be cancelled out as a result.If the pixel moves along an edge, the eigenvalues are drastically different and we can only recover the motion that is perpendicular to and edge. Now if there are many gradients and full rank, we can reliably compute optical flow.









Comments
Post a Comment