User:Yannick.novella

<!-- In computer vision, time-to-contact or time-to-collision (TTC) is the estimation of the time left for a video camera  to collide with an object in its field of view. It can be measured without knowing the distance that separate the object from the camera and without knowing the size of the object. However, the camera has to be moving toward the object at a constant velocity, which can also been unknown. Computation of the TTC is usually achieved using the optical flow.

Overview
Time-to-contact (TTC) is defined as the time before the camera would collide with the surface being viewed if the current motion of the camera would remain the same.

Intuitively, it is defined as follow:


 * $$T = -Z / \frac{\mathrm{d}Z}{\mathrm{d}t}$$

where $$Z$$ is the distance from the camera to the object and $$ \mathrm{d}Z / \mathrm{d}t $$ is the speed at which the camera is moving toward the object. The speed and the distance between the camera and the object is not known and cannot be deduced from images taken with a single camera. This is why it is important to find another way of calculating the TTC.

Optical Flow
On the diagram on the right, P is a fixed point of interest at coordinates $$(X,Y,Z)$$ where Z is the distance from the point to the camera. The image plan is fixed at a distance z=1 for convenience. The projection of P on the image plan is p. The image plan is moving forward with the camera at the speed $$ \mathrm{d}Z / \mathrm{d}t $$, making the projection of P changing to p' .

From the triangles we get that:


 * $$\frac{y}{z} = \frac{y}{1} = \frac{Y}{Z} $$

Differentiating with respect to time gives :


 * $$\dot{y} = \frac{\dot{Y}}{Z} - Y(\frac{\dot{Z}}{Z^2}) $$

Because P is not moving, we can set $$\mathrm{d}Y=0$$ and after substituting Y with yZ we get :


 * $$ \dot{y} = -y(\frac{\dot{Z}}{Z})$$

Finally after dividing by y and taking the reciprocals of each side we get :


 * $$ \frac{y}{\dot{y}} = - \frac{Z}{\dot{Z}} = \tau $$

where $$\tau$$ is the time-to-contact. The left side of this equation gives a method for calculating the ttc:

For a camera heading in the same direction as the focus of expansion (the point where the world seems to be flowing out of for a given direction of motion, FOE), pick a point in the image and divide its distance from the FOE by its divergence from the FOE. This method requires the calculation of the FOE, which is where the optical flow is used. The X and Y components of the optical flow vectors are averaged in order to get the FOE.

"Direct" method
The previous method described works well but requires the optical flow to be calculated. A direct approach is proposed by Berthold K.P Horn, Yajun Fang and Ichiro Masaki

This so called direct method is based on the analysis of only two frames of a video sequence captured with an uncalibrated camera, and therefore has no latency. It is making the use of the derivatives and gradients of image brightness and the motion field resulting from rigid body motion.

Robotics
Time-to-contact is important for mobile robot navigation. With this information, a robot is able to avoid collision with walls or any other objects, thus avoiding to get damaged. A mobile robot typically embarks a camera and travels at constant speed, which are the only two requirements to calculate time-to-collision. Obstacle avoidance can of course be achieved differently but TTC allows it without the use of other sensor than a camera.

Driving aid
Time-to-Contact can be a valuable information when driving. It has been integrated into various driving assistant applications to alert the driver when the distance to the car in front becomes to short or when the car gets too close to a wall when parking.

Other
Usually distance measurement is achieved with the aid of different types of sensors such as ultrasonic sensors or infra-red sensors. Animals however do not possess such sensors and relies on their vision to estimate distances. It is assumed that they are using TTC estimation in order to adapt to their environment.