Hello and welcome back. I just want to spend a few minutes explaining some of the concepts that we learn about curves on the plane, but now surfaces in 3D. so its going to be a much shorter video than the previous one, and we're going to be discussing Surfaces instead of curves. Just a couple of concepts. Surfaces are really beautiful, and we could spend years, some people spend all their life, studying surfaces, but once again, we only have time for a few key concepts that will help us to understand, for example, active surfaces, how to do segmentation of volumes in three dimensional images. again, just a few concepts. We have a surface us on a surface. Basically, we are only going to be talking about, talking about surfaces in three dimensions, and basically on the surface we can draw curves. Here we have curves. Now basically, each one of these curves is in 3D now, so you have to have X, Y and Z. But we basically have the surface. Imagine that the surface is basically floating on a plane. So the way we parameterize the surface is now with two parameters, U and V. Remember, for curves, we have only one P, for surfaces we have two. So we basically are on the plane. So we have U and V. On the plane, for each U and each V, we have a X coordinate, Y coordinate and Z coordinate, and that's how we represent a surface. Two parameters, three coordinates in curves we have one parameters, two coordinates, because we were on the plane we can have curves in 3D that would be one parameter, three coordinates, for example this one. So that's a surface. Now let's define normal area, and things like that on the surface. But if we have curves, we can take derivatives, as we were doing on the plane. So we can take a derivative, according to the U parameter and according to the V parameter. So we can basically be on a curve and basically say, let's just take a derivative of that curve, according to U and according to V. If we do the cross product of these two vectors, we get the third vector perpendicular to these two. Once again, basic algebra. So the normal is the cross product of the two. So, the derivative of S according to U is tangent. The derivative S according to V is tangent. They will define a plane which is tangent to the surface at this point. If we do the cross product between them, we get a normal to the surface. And again, we are going to normalize that because we're interested in unit length normals. So we have derivatives which means time change and then the normal if we have derivatives we can for example define the element of area we know that then once we have two vectors. The determinant of the matrix composed by those vectors, basically defines the area of the parallegram that we see here. So if that is infinitesimal, we have elements of area. If that's integrated across multiple, across long regions, then we have the total area. So, same type of concepts. We have length on the plane, we have areas here. We also have length, because the surface, it's just a lot of curves, nothing else than that, nicely organized. So once again, here is the parameterization, and here is the normal. Let's see the example of something that you are familiar with, which is basically graphs. The same way that we saw graphs on the plane, we can see graphs in three dimensional space. So we have a coordinate system, X, Y, and Z, and basically we define a graph that's again floating on space. So our parametrization is XU, equal to U. Basically X is one of the parameters, YV equal to V, and then Z basically the height of the surface, or in this case the graph or the function, is just a function of these two, a particular case. Think about an image, for example. An image is a particular surface, it's a function. So, the plane of the image is X and Y, or U and V. The grey values of the image is the height means Z. So you can think about images as surfaces, in a particular case, as functions or graphs. And that's a very interesting interpretation. We can basically compute things. We can compute the normal of an image, as we saw in the previous slide. Basically we treat the image as a surface. We take derivatives, we compute the normal of an image. So we bring a lot of concepts of differential geometry into image processing. Now what about curvatures? So the basic idea is very simple. Once again we have curves. If you have a curve, you can take first derivative according to our link. This is a curve in 3D, basic same concept and second derivative. Second derivative would basically view the curvature of that particular curve that you do. For example, this one. No sometimes you want to project that curvature, remember first derivative is tangent, second derivative is perpendicular to the curve, not necessarily to the plane. You have a curve there's a lot of things that can be perpendicular to that, so you can take it and project it to the normal or the perpendicular of the plane if you wish. And that's basically something that's called the normal curvature. So you take the curve, you take second derivative, that gives you a vector and you project that vector into the perpendicular to the surface. But that's about basically maybe you are thinking about a curve but if I have a point. Let me just make that here. If I have a point on the surface, they're are multiple curves. On the surface that go through that point so look at all the curve. There are multiple of them. So what exactly defines the curvature at that point? It turns out that there is one of these curves, that when we treat it at a curve and we compute the curvature, it's the smallest possible. And there is another curve that is the largest possible. So we basically define the principal curvatures of a surface in the following way. You're in a point, and you basically try all the possible curves on the surface that go around that point, and you basic compute the curvature. Now we are talking about curves. This curve has a curvature. This curve has a curvature. You compute all of them. There's one, which is the minimal, and one which is the maximal. Sometimes there's more than one. For example a sphere might have, basically have more than one, all directions are the same. But you have, for regular surfaces, you have at least one which is the max and there which is the min, and those are called the principal curvatures of the surface and I just tell you a bit of extra information. The curve that gives you the max and the curve that gives you the min are perpendicular to each other. Now, and there's way of computing this. You don't really have to try all the curves. There's way of computing. I'm just taking about concepts here. So, there's one direction which is max. The other is min. Think about the cylinder. When you cut a cylinder, perpendicular to its axis, there is one direction that you basically get a circle. What's a curvature there? One over the radius, we know that. There's another direction in the direction of the cylinder that you get a straight line. What's a curvature there, we know, it's zero. So in one direction we get one over the radius. That's a maximum the other you get zero. That's a very nice thing. it's a surface that in one of the directions, THE curvature is actually zero. So, on a curve, there is only one curvature. You're turning, and there's only one direction to go on the curve. On the surface, you can go in multiple directions. And there will be one which is the maximum direction that will curve the most, one is the minimal, where will curve would curves the least. And actually, that basically completes which is called the min curvature, which is the average of both of them, and the Gaussian curvature which is the product of them. So what's a Gaussian curvature of a cylinder? Zero. At every point in one direction, basically it's a straight line. So it's zero, and there is a lot of beautiful differential geometry on surfaces, a lot of it due to Gauss. Really beautiful, but these are the basic concepts. So you have the same as on the plane, curving, the curving of the surface, but we have curving in multiple directions. We have the max, the min, and normally people say, instead of taking the max and the min, let's take the average and the product. From this you can of course, from the average and the product of course you can go back to the max and min, or vice versa. So these are basic concepts of surface differential geometry. Again, we have normals, curvatures, the same kind of concepts that we had for planar curves. So now after these two videos, one relatively longer than the other. Your an expert in differential geometry. And at least you have the tools to understand what is coming next. Which is deformation of curves, meaning deformation of shapes, and their relationship of that with active contours, active surfaces, and even with image denoising and image enhancement as we are going to see it. Remember, images are surfaces, so we can treat them with the tools that we, we just learned. They have curvatures, they have normals, they have the same concepts of differential geometry. I'll see you in the next video. This is getting real, really, really exciting. I hope you're having fun. See you very soon. Thank you.