In this lecture we're going to explain the notion of cross ratios. We're going to also use cross ratios to do what we call single view metrology. How to measure distances in single pictures. When we have a line segment marked from one length to another, with a parallel projection then we know from very basic geometry that the ratios are preserved. This means that if the middle point of one segment is B, it will map to the middle point of the other segment Q. If we have a Euclidian transformations, not even projections, then we know that the lengths are exactly preserved. It will have transformations like the one in the picture like a parallel projection then the ratios are preserved. But what happened in a projection with a camera where the rays are not parallel? They intersect at the projection center. Is the middle point of a segment preserved? No, if we take the middle point of a segment in the image then when we back project on a plane in the scene these will not be anymore in the middle of the segment in the scene. So what is really preserved? The entity what is preserved is the cross ratio. The cross-ratio can be defined only with four points, as opposed to the usual ratio, which is between three points. You will have the projected information, between two quadrupled points. A, B, C, D and A primed, B primed, C primed, and D primed. Then the cross ratio is preserved. How is the cross ratio defined? It is defined as the double ratio. We take AC by AD and we divide it by BC by BD. The way to remember the cross ratio is that you write AA and BB and you adjust them. Fill in CD and CD. This cross ratio remains invariant under any projective transformation like the projection on the camera image. How it can it be used to measure distances? Imagine that we have this crossing and we have a 4 km sign and a 2 km sign. When a car is approaching the crossing, C's, 4 kilometer, and then the kilometer. We call these two points A and B. Now the car has already passed these two points and these are the points C in front of the crossing D. This is an image, we could take for example from a satellite. What we call a frontal parallel image. But images usually look like the images in the picture on the right. They are perspective projections of the road. Let's say that again we have a point A primed at the 4 km sign. A point B-primed at the 2 kilometer sign, and then we have a point C-primed and a point D-primed. And we can click with a mouse on the picture and we can find the coordinates in pixels of all these points, and we can measure also the distances in pixels. For example, this is between A prime to D prime, can be 300 pixels. A prime and C prime, 275 pixels, and B prime and C prime, 50 pixels. The question is, can we find, form this picture, how far is the car from the intersection? Which means how large is the distance, C-primed, D-primed? And the answer is yes, we can write the cross ratio in the picture as A-primed, C-primed by A-primed, D-primed divided by B-primed, C-primed and B-primed, D-primed. And we find this car's ratio is 1.375. Now what happens with the car's ratio in the real world? This is written in terms of kilometers. We know that AC is the 4 kilometers minus the CD. We know that AD is 4 kilometers. We know that BC is the 2 kilometers minus the CD, and we know that BD is 2 kilometers. So the only unknown there is the distance CD, what we're really looking for. So if we write this equation, we have only one unknown CD, and we can solve it and we can find that indeed the car is 857 meters from the crossing. This is a measurement we have done by just clicking on pixels. Without knowing the pose of the camera and without even knowing intrinsic parameters for the camera like the focal length. The only entities venue was the 4 kilometer sign and the 2 kilometer sign. This looks like magic, but it is not, because it is based on the notion of the cross ratios. What happens with the cross ratio, if one of the points is infinite? Let us look at this respectively oblique picture of a ground play. Let's say we have the horizon and we have two lines intersecting at two points at horizon. Let's look at the line A prime, B prime, C prime to D prime. While D prime is a point in the finite plane, a point where we can compute its position in pixels. The D in the original plane because it is in the horizon, it is at infinity. We can compute the cross ratio between A prime, B prime.C prime D prime, the way we have found in the previous slides. But what about the cross-ratio on the ground? It turns out that if the point D is at infinity, the cross-ratio on the ground is equal just to a ratio, AC divided by BC, because the entity is the contain D which is a d by d b. Have a limit equal to 1, because D equals to infinity. So, when we know one vanishing point, then we can infer ratios. We measure the cross ratio in the image. But in the real world we can really compute the ratios the same way as we had a parallel projection. This is very important because it allows us to make distance measurements in the real world with even less knowledge than in the previous picture with a cross. So we will know the vanishing point if we see some parallel lines. For example, the rail tracks in this picture. In this picture we can ask the question how far away is the train from the next station or how far is B from C in the real world? Again, we have here just one measurement in the real world. The sign that says next station is 50 kilometers, which means we know only AC in the real world. The distance between the two stations. But in a picture, and let's say in a photograph where we can measure distances with centimeters, and indeed this is the case here because this picture has been taken from an old geometry book. Then we can measure these distances in centimeters, and we measure that AC is 4 centimeters, CD is 4 centimeters and AB is 2 centimeters. We could have measured this in pixels in a digital picture. Based just on this measurement of the four points in the image plane and the just one distance the 50 kilometers in the real world, we can compute the distance from the train to the next station is 33 kilometer in this case. We can use this effect even vice verse, if in this pattern that we see on the ground plane. We know the distances between the tiles. We know that every tile is 1x1 foot. Then we know the ratio in the real world that AB/BC=, If we know this ratio then we can compute where is D prime in the image plane, without even having parallel lines because this will be the only unknown image plane if we click on the pixels A', B' and C'. So we can use this [COUGH] fact, that if we know a vanishing point, then a cross ratio is equal to the ratio, we can use it in both ways. In further distances, on the ground plane or in further position of a vanishing point on the pixel plane. Let us do some image forensics, or better, painting forensics. In this picture we know that the statue on the left was 180 centimeters. Let us ask the question, based just on this single picture how tall is the man with the brown dress on the right? This is called distance transfer. Let us assume that the horizon is in the middle. This is how you usually paint excel. We see a set of parallel lines which are going towards the horizon, the red lines, and we intersect them, and we know at which height in the horizon is. If the horizon is lower than the middle of the image plane, then we know that probably the viewpoint is looking upwards. Now let us take the line between the feet of the man and the feet of the statue. We connect this line and dissect it with the horizon at point A. This point A is originally at infinity. Let's take now this point A and connect it with the head of the statue. And this will dissect the vertical through the man at point B. These two lines which are intersecting in the image at point A, in reality, they're parallel. So the point B is the point of the height of the man which is exactly the same as the height of the statue, 180 cm. But this is not the point we want. We want the full height of the man, the full height MH. So we need the ratio MH divided by MB. How can we find the ratio? We can find the ratio if we know the vanishing point. What is the vanishing point corresponding to these lines? It is the vertical vanishing point. If the lines are indeed parallel, they might intersect at infinity. But in this case is the horizon is not exactly in the middle, probably we would expect that they intersect at the finite point V. Now if we know this point V and we know H and M and B and we measure their positions in pixels, we can compute this cross ratio, and hence know also the ratio in the real world of MH divided by MB. And since we know MB, we can compute the height MH. So we have shown that if we know a vanishing point, we can compute any ration along this direction. We have also shown that we can transfer distances among parallel lines in the world if we know two vanishing points. All this from a single view, a single picture. And in none of these steps we have used a focal length or any other intrinsic parameters. Which means we can apply this method to paintings. We can apply this method to all pictures where we didn't know what was exactly the setting. The orientation of the camera or the focal length or the image center. So this way we can do something what's forensics or even approve whether a painting was the perspective picture or not.