Homogeneous coordinates provide an alternative mathematical framework for representing geometric objects where multiplying all coordinates by a non-zero scalar yields the same geometric entity, enabling explicit representation of points at infinity with finite coordinates and simplifying complex geometric transformations (translation, rotation, scaling, shearing, and projective transformations) through matrix operations, thereby making computations more straightforward compared to traditional Euclidean geometry.
Homogeneous Coordinates in Photogrammetry | Lecture Explanation
Added:so what we're going to do today is to look a little bit into projective geometry or especially homogeneous coordinates I know that most of you or should have attended that already or have attended one lecture on that um last year with wgang fer but as the homogeneous coordinates are kind of central for the remaining part of the course I thought of giving kind of whatever a 60 Minute something around 60 Minutes um wrap or introduce them again wrap up and present you the most important component that you need to know for understanding the remaining part of the course so this is just kind of see a little bit as a summary of the most relevant things that we are going to use here so the first thing is why are we considering um homogeneous coordinates and why is this something which is important and especially simplifies our life so we all started or most of the activities that we do especially from now on um assume a camera which we use in order to take pictures and we want to analyze those images and then do inference about what we see what the geometry of the scene looks like maybe where the camera is and other things and in order to do that we need a model for our camera and the standard model is the pinhole camera model so just as a reminder that was kind of this quite simplified model so okay should be green um you have a box here which is your camera camera there's a small pin hole something like this and you have an object in front of your camera let's say this tree and then all Rays from that tree pass through that pin hole and generate an image here in the back of the camera so this Ray go somewhere over here this one down here the one in the middle here so that we get the tree which is then standing upside down something like this and the important thing is that here all Rays pass through that Center through this point so the single point and all Rays from an object to my image PA through this point and this concept that every Ray go through this pinhole is something which is very important and that will actually exploit um in photogrametry in the photogrametry course for until photogrametry 2 actually and um what we now want to look into this kind of what we what we get here in our image is actually a projection of the 3D World onto this 2D plane we need to understand the mapping to this plane in order to appropriately describe what we see so for example if we have a certain interest interest Point somewhere in our image what do we know about where these points lie in the 3D World and if you can look to to an image just a standard image taken from the house and we want to look into certain Properties or geometric properties that hold in the real world and the question is do they hold in this image so for example if there's a line in the 3D world is this line actually mapped to a line in this image what do you think so if we have a line in the 3D world is this line mapped onto a line in this image so you can just let's say randomly pick a line let's say whatever this line over here this should in reality is very likely to be aligned with something then you can say due to your background knowledge how the roofs are constructed or that this is probably one line over here or the bottom line of the house and this seems that this seems to be more or less a line also this is probably a straight line in reality in map to a straight line in this image so at least for this image we can say this is a straight line this straight line preserving mapping so straight lines in the real world are preserved in our image there are other things what about angles in the real world are angles in the real world mapped to corresponding angles in our image when you at theill right of the gate at the upper take this I think those are all rectangular angles but they not on the that is true because see that there's piles over here so that these are all 90° angles and they're not M to 90° angles in this image so we are not preserving the angles that we have in the real world what about size of objects so the size of the object differs depending how far they are away from the camera this basically determines how large the object is in the image so two objects of the same size being at different distances to the camera are of course met at different sizes in my image so we don't preserve the the lengths this exactly just a summary of what we have actually discussed here so we at least this image was straight line preserving so straight line is mapped to a straight line but the two other properties we said length preserving or angle preserving this does not hold for this mapping does the straight line preservation of straight lines is always true for say standard cameras or typical cameras yes please for such that but if you use special objectives um you might get round lines where you have straight lines and the other way around so if you use wide angle lenses especially or fishee lenses you see very strong Distortion you can perfectly see that on the horizon line that the horizon line is typically not a straight line anymore or any other straight line that you see or picture through for example fisheye lens or wide angle lens but for kind of normal lenses or for the pinhole model we can assume that they are or they're very close to straight line preserving okay so if we preserve straight lines what happens about parall lines parallel lines lines which are parallel so have two lines um so if I go back to my house if you identify a few lines which are parallel are they still parallel it depends on that direction they are going from the left to the right and going left to the right probably stay parall they stay parall but if they are an extension going the distance then they are not anymore so if the plane which the lines lie is the same or has the same orientation that my image plane that's true if you map somewhere else there this is not the case so parallel lines May intersect they may not stay parallel so I just indicated that by two things which are parallel so here with the roof starts and the bottom of the house for both sides you can see those parall lines intersect they don't intersect inside the image but if a kind of extent that they inter somewhere outside the image okay so parallel lines in the real world don't necessarily stay parallel okay okay what we can do however we can actually Rectify images so we can do a rectification of those images so for example if I want to measure certain elements on the facade I can actually rectify the image as if the image plane would be has the same orientation than the plane for for example this wall I can do that for this wall and I can even do it for the for the ground floor and then I actually can do measurements at least relative measurements in those images so for example here seeing the tiles so those images are generated from this image knowing something about the geometry of the scene and where the camera is I can actually generate those rectified images but I can do the measurement then in the plane so here on the ground plane on this side of the wall or the on the side of the of the building um but I can't do this in any part of the image but I can do certain rectifications with respect to certain planes that I have in my image so I can do that and then this allows me to derive some information about the geometry of that scene for example or do measurements in there so Central questions that we are typically addressing and this all is kind of the motivation of why we using homogeneous coordinates later on or introduce them today and use them so central question that we interested in is the having a relationship or geometric relationship between the objects that we see in the scene and the objects we have in our image so if you see something in an image what can we infer about the geometry of the scene or what kind of images will we generate if we know something about the world um also kind of often we can't or depending on kind of What observations I have I may infer some parts of the geometry I may not infer some um other quantities for example if just a single image um inferring something about the depth stability require some background information some background knowledge so maybe I'm also fine with the relationship between the points in the image and the Rays to the object the ray going from the uh image here to the object and just know that the object basically lies along this Ray I may also be interested in estimating where the camera is so given I know something about the scene let's say given I know the geometry of that tree and where that tree is I take the picture can actually derive from that picture the position of the camera and that's actually something that we will do in the remaining part of the photogrametry one course so starting with that in kind of next week um how we can actually estimate where the camera is if I know the geometry of that tree just from the picture that I have okay that's what we want to do is but the problem that we have is that the camera generates a 2D image from the 3D World so projects the 3D information on to my 2D image plane and this causes what we call in the beginning a loss of information so we lose some information we can restore some of this information or estimate some of the Lost quantities under certain circumstances so for example if I have multiple images multiple images of the same object I can infer something about the depth information up to a scale typically um or depending on how much other information I have if I know some of the locations of the cameras from where they have been taken in the in an external coordinate frame I can even resolve some of those ambiguities um I typically need to know some details about the camera if I know the size of certain objects I can also infer something about the geometry of other things that I see in the world um so if I have more than a single image I can actually do more and that's something which we will see directly in the beginning of the photogrametry 2 course when we look into using stereo cameras or two cameras or two images taken from different locations potentially from the same camera maybe from a real stereo setup so if I take one image of you from this location and the second image of the same scene from this location and I can actually infer something and I can estimate for example what is the movement of the camera it's one thing I can actually estimate or I can estimate what is the geometry of the scene or I can actually do both things at the same time and that's something we will look into how we can actually recover this information but the most important thing what we are going to exploit is basically what I've drawn here or just Illustrated and by this effect so this is my image I have the Rays going from the image to my pinhole into the real world and I can just measure those Rays so one of the pixels one of the points in my image basically represents the information along this array and I don't know where along this aray this information is only if I have um multiple images taken from different locations like in this example over here if this is um cam location of camera one and Camera 2 and by triangulation if I know the corresponding points between both images I can actually estimate the depth information and what we are want to look into today is how can we actually describe this projection or this fact that I have a point which somewhere lies along this line in a very nice way so was kind of trying to set the focus and if we now go back and to the previous example that we had we said straight lines remain straight and but parallel lines may not remain parallel and one of the examples where you can actually also very nicely see is this classical images of train tracks so those train tracks are actually parallel but they intersect somewhere was soal the vanishing point so somewhere along the horizon there I have a vanishing point where those two parallel lines intersect and if I have two different parallel lines let's say two parall lines which move in this direction they have a different vanishing point which may Li somewhere over there and this vanishing point results from the fact that these parallel lines in the real world don't stay parallel due to the projection onto my image plane this basically everything yeah is set so all parallel lines which are mapped intersect at the vanishing point and the vanishing point can also be something described as at a point at Infinity so it's infinitively far away and there my parallel lines actually intersect and um every direction in the sense of if I have two or multiple parallel lines if they have a different orientation and look into a different direction then they have a different vanishing point for One Direction I exactly get one vanishing point and the key thing is kind of these points at infinity and as soon as we have that we may also think how can we actually describe points at Infinity of course if we are in the ukian space you want to describe a point at Infinity Infinity we could actually set the whatever XY that coordinates to infinity and then it's a point which is infinitively far away but what I lose if I do that is actually directional information so if I have a point and say okay the XY Z coordinates is or the X Y coordinates is for example Infinity I know this point is infinitively far away but I basically lose completely track in which direction this point is so I can't describe the fact like in this direction over there the point is in definitively far away this is one of the limitations that we have and this is one of the motivations why uh the ukian geometry may not be the best framework to use if we deal with cameras and if we deal with projections and this is a reason or motivation for projective geometry um where we say okay there's a different formulation for that for describing the world and um which is well suited or better Ed to describe some of the relationships we we have in we want to model and one of the things actually points an Infinity at a certain direction so it's important to note that um the projective geometri is just let's say an alternative framework to describe um our objects and transformations in the real world and it's not that we can do better things with this technique compared the Ean VA the only thing is that things typically gets easier so in thean Geometry the mass can get pretty difficult if I want to do all those computations and this is not the case for the projective geometry if we use projective um um geometry and one of those ways to actually exploit that is homogeneous coordinates the mass gets typically simpler and the simplification of the mass leads to better insights that we get about the relationships that we have here the important thing is there's nothing which is fundamentally different in the sense that it's more expressive so we can still say we can give a direction vector and then um have whatever a parameter which runs towards infinity and represent that point in the ukian vault but it's simply a much more complicated way of describing that and this led to the introduction of the homogeneous homogeneous coordinates um toally abbreviated s HC on the slides because the word simply that long um this is one way for improving the situation and which allows us to Simply to end up with having simpar equations as if we would formulate them in the ukian world or the ukian um kind of framework and two other the things which are very nice and which is very useful for us are those two points down here first thing is that we can actually describe points in Infinity with finite coordinates so we don't need these Infinity values somewhere we can use finite coordinates and still represent points at Infinity and this makes a lot of the computations much easier this one point and much easier to grasp that we can actually represent the fact that there's something along these lines potentially at infinity and the second thing which is actually pretty useful if you work with Transformations is that using these homogeneous coordinates we can um represent different types of Transformations like rigid body Transformations um fine Transformations or projective Transformations using a single Matrix and this simplifies a lot of the activities that we do because we can simply chain those matrices and just multiply those matrices and this way chain the Transformations which simplifies most a lot of the computations that we do substantially this are kind of one of the two reasons why life gets easier if we do the computations in this space and this allows us to get better insights about what we are doing so it's a framewor kind of roughly set so is everyone clear why we are going to do that using homogeneous coordinates so the our goal is to simplify our life we can do the things in the ukan world but it's more complicated okay if given that we now have different things or things geometric objects like points uh lines or points and they can be expressed inan coordinates or homogeneous coordinates I want to introduce a a slight notation that I will use through throughout the whole course which goes back to W first and also the book that he wrote so he uses exactly the same notation so one of the things that we have if we talk about a point a line or a plane we can actually use these calog graphic letters over here and this represents kind of the object itself so the entity so the line or the plane itself and we can talk about these guys those letters over here if we say that we have a point expressed in homogeneous coordinates we use kind of this type of font so non santed font non- italic and if we go for ukan coordinates you have that in an italic way and this at least also for me it really simplifies life if you stick with so you will find this notation through the whole remaining particle slides of the photog gometry one and two course I'm I'm not changing that um that whenever you see something in this font we're in the ukan world whenever we something in this one we're in the homogeneous coordinates whenever something is lower okay it means we're in the 2D World whenever something is uppercase or capitalized characters we're in the 3D World also the use to actually simplify to should simplify the understanding of those equations okay it's kind of clear also the difference between whatever the different types of coordinates and the point itself so we can talk about a point in the space and the point can be represented in homogeneous coordinates or in ukian coordinates and therefore this distinction of giving the point a different font we just describe the the quantity of the uh uh of the of the object so the point and not its spe special configuration expressed in a certain coordinate system is that kind of clear okay so then we go directly to homogeneous coordinates and look to the definition what homogeneous actually means so what homogeneous means so representation of X of a geometric object is homogeneous if x and x multiplied by a scalar represent exactly the same thing if the scalar is une equal to zero so we have this relationship over here x equals a scalar which should not be zero and x and this represents exactly the same thing this is something which is homogeneous in the Ean world this does not hold this factor in the Ean world this is this equality doesn't hold can make whatever can make a very simple stupid example you're in the Edan world and you have a vector whatever 2 three and then you can actually say is this the same thing than whatever 4 six which we can express as 2 * 2 3 and in the ukian world this is not the case obviously because 23 is different than 42 so so this is in the ukian world ukian this is not true this does not hold okay so this the homogeneous property does not hold okay how are we these kind of this thing you feel it for the first time it's to be somewhat counterintuitive so howse should such an object actually look like which has this property homogeneous coordinates of an n-dimensional object looks like is typically that we say okay we simply use one dimension more so we add one dimension more we go move from an nend dimensional space to an N plus one dimensional Space by simply adding one new dimension so if we have our point in the 2D world so it's small it's 2D and this font so we in the Ean world it's give just given by XY so this is what I have in the ukian world when I express this in homogeneous coordinates I add a new dimension over here I copy the first n dimensions and add a one over here that's kind of the transition from the ukian world to the homogeneous coordinates what it does how do we actually interpret this thing in homogeneous coordinates so to have this kind of equality if I multiply that by two for example with 2x 2 Y 2 why should that be the same so all those vectors in homogeneous coordinates represent exactly the same point in ukian coordinates if I take the last component over here and divide all other components by the last component so x / 1 y divided by one if this gives X and Y we're talking about the same the same point so in this case it's clear it's x divided X ided by 1 y ided by one will give me a vector XY which is exactly this Vector so it's the same object if I now would multiply this vector by two so if I would have 2 um * X y1 is 2x 2 Y 2 but now want to map back to the ukian B I kind of take the last component and divide all n components by this component so this is 2x / 2 2 y / 2 and maybe yeah and this is XY so this is the same object as xy1 which would be in the ukan Ro again XY okay so just adding this multiplication of two so this is a scalar Factor doesn't change the object itself so you can do the same thing if I have inhomogeneous coordinates something U VW say it's the same thing is moving W out of the vector so it's U / w v / W and 1 and the homogeneous property I can simply skip that I obtain this Vector so I have one here or something which sometimes called normalized and then u ided w and V ID W corresponds to X and Y what we basically do is we add if we go from the ukian ball to the homogeneous coordinates we add one additional Dimension and by default we set it to one if you want to represent the same object that the first n dimensions would represent in thean world and if I then I can do all my computations with my in my homogeneous coordinates and I want to move back to ukan coordinates I simply have to divide all n components by the last component so again this another example exactly which was shown pretty similar to what was shown before so this is my element in homogeneous coordinates this is a corresponding element in the ukan world okay so next thing is which kind of numbers are allowed in here in in the homogeneous coordinates are all numbers allowed can I do all combination of numbers in here and this is not the case so what in the homogeneous coordinates we require that not all elements are zero at least one element must be larger than zero so that is one requirement so we can express this if we are here uh in the two-dimensional world so in homogeneous coordinates we have our third dimension then a constraint is that um none of those element not all of the elements are zero at the same time okay and if I want to directly move back to the ukian coordinates as I have to divide U divided by my third component I can only map that directly back into the ukian world if W is unequal to zero otherwi I would divide by zero right here so in the ukan coordinates it's perfectly fine to have a zero down here but if there's if this last component is zero I cannot directly map back to the ukian VA at least with finite coordinates because I would divide by zero and that would be kind of infinity here this is exactly the way as we will see later on how we can actually represent points at Infinity if this value is zero we can still represent a Direction with those two components but represent that the point is actually infinitively at Infinity infinitively far away and at that point there's kind of not the direct relation between the point in homogeneous coordinates and in ukian coordinates because in ukian coordinates due to this U division those values would approach infinity and therefore we won't have finite coordinates in here so we can represent points at Infinity in the ukan world but only not with finite coordinates so just this example if I have um points on the projective plane which is kind of the space corresponding to the the projective space corresponding to the R2 so it means All Points which are expressed in uclean coordinates is XY then what belongs to the projective space these are all three Val valued vectors like x y and one just as an example just add the component all points at Infinity is x y and zero get this zero over here but what is not in there doesn't belong to that space is a zero Vector 0 0 0 because our constraint would be violated is that clear so the the only Vector which is not part of that space actually the vector where all components are zero so the first n and the last one at least one of the components needs to be unequal to zero and again this is the reason that not everything can be or if W is zero then I have the problem of mapping back to the original space in homogeneous coordinates I can still live with a zero here and those two elements give me the direction in which direction the point is in Infinity but if all of them would be zero I would have no direction and no point I could set to Infinity so you can also maybe this becomes clear in this kind of illustration so what we have here this plane so the gray plane is kind of R2 regular R2 world so so far we were living in this R2 world and now if you go to these homogeneous coordinates we have one additional Dimension so we can actually see this as a three-dimensional space we just have we just add this new W Dimension which is my third in this example my third dimension and a point in the ukian B with X and Y so here is an e for ukian because the figure used a slightly different notation but um what I wanted to say is that this point in the 2D World corresponds to this line in the 3D World line starts at the origin and passes through this plane and we can also have a point which s somewhere over here if I do the normalization so that the last component is one which basically means I divide all the components through the last component what happens actually is that I move this point here back to exactly this point so every there for this reason every point which lies on that line corresponds to the same point in the 2D world so if I kind of do this divide by W well this actually means that somewhere along this line I kind of move the point back over here okay is this figure does this figure support sing yes please NE so just having this point in here is not explicitly part of the thing so the thing is I can extend this by another dimension then go to the to the next Dimension then I use this 03 so it's still part of the figure but so this point is not part of the space because what I'm doing I'm basically representing line starting at this origin and if I if the point lies at the origin I can't I have the line and both points are in the same line I could have any arbitrary line therefore this one is not part of the of the projective space so if I kind of if I visualize this the whole thing as R3 then of course I would have this point in there but the projective space explicitly excludes this point any further questions okay what we can do in 2D we can of course do exactly the same way also for uh for 3D the only difference is we have don't have three we have actually four components and then we can move from the four components in homogeneous coordinates back to our three dimensions in our ukian world the rest works exactly in the same way now these are capitalized characters because they represent an object in belonging to the 3D World I can also Define the origins of the ukian coordinate system and they are given by 001 this exactly this example over here or I've been the 3D World 00001 this would be always that point which lies within this gray plane so here so just added this figure to that slide it's a bit suboptimal having the same points over here so the best thing we actually would to would be to remove that to not cause any confusion because these are the centers of the ukian coordin frame expressed in homogeneous coordinates and they have to have a one in here because this is the center of this plane okay so you feel comfortable with points in this world in this kind of representation you all find with points and homogeneous coordinates yes no as long don't to so far the difference no the difference is just the only thing we say it's we just have points along this along this line every point along this line corresponds to exactly the same point here in homogeneous coordinates in ukian coordinates how we transform those points something we will discuss later on if we use our transformations in order to do that okay so if you if you're happy with points we can move to lines and see how can we actually represent lines and if you look back how we can represent lines in our ukan world there are typically three ways and how we do that there's something which is called the H normal form or in the H form where you B basically um specify an angle five and then a distance and then with those parameters X and Y you can vary as long as this equation holds the point XY is on the line it's one way for representing a line the other things the intercept form or a and upet form where you have your X and Y over here and you have two parameters x0 uh x0 and y0 um equals to 1 or - 1 equals to Z you can which you can use or it's called the standard form or implicit form is you have this expression over here so ax plus b y Plus C must be equal to zero so um the kind of important thing in here is that we have always a system now we have always an equation and we have always an equation which something is equal to zero so I have a component with X I have a component with Y I have a constant component and I have zero over here same thing over here I have X Su coefficient y Su coefficient constant part equals zero and the same exactly we do we have in here so the key thing the key Insight in here if you look how the lines are represented or in the in the ukian world is that they all form linear equations which are equal to zero okay so this is clear because we will expl that in a second so whatever representation I use in order to represent a line can be written as an equation which equals to zero and we have linear components in the X and in the Y okay all fine everyone accepts this this okay now let's see how we can exploit that in order to represent lines in um homogeneous coordinates so this was a point in genous coordinates x y and one if you actually go back you can see that we have an x a y and a constant component okay so that's our Point here and then we can actually represent provide three different vectors L ones represent in Hess of form ones with the intercept form and ones with the standard form where the first second and third dimension takes those parameter values just basically took those equations the part which corresponds to X the part which corresponds to Y and the constant part and actually placed them in here the part corresponds to X to y in the constant part what I now can do is I can simply take this point and compute the dot product with one of those representations so I say x do L I would compute it that would give me x * cosine 5 + y * sin 5us D that looks like pretty similar like this one the only thing I'm missing is actually equal to zero so what I can do is if I have this kind of representation I can now use this to formulate condition under which the point lies on that line which is X do product with L equals z if this holds then the point x actually lies on the line which is represented in this way and they can do this exactly the same way for the two other forms so the key inside here is x * l or X transposed l l transposed x equals z is the key condition for formulating that a point lies on that line with a point in homogeneous coordinates this is a representation of a line in homogeneous coordinates and by multiplying the point with the line equals zero I'm expressing that the point lies on that line so all points for which this equation holds are actually points which lie on that line so they Define the line L so this is kind of clear what we have done okay we start with a point homogeneous coordinates we take the equation that we know from our ukian geometry on how we can represent lines we just pick one out of them and then we say okay we have to combine the point and the line in a way so that we can have an equation which is equal to zero because then we have the correspondence to the ukian world we obtain that by saying X transpose L equals z all the other way around okay okay so what we can derive from that is in our our in our homogene in the homogeneous coordinates we can define a line in the 2 Vol as a threedimensional vector L1 L2 and L3 and again I have the same constraint that not all of them can be the null Vector because then it would hold obviously for every X Y I put in there and this corresponds to the representation of the ukian world which is the standard form over here okay now what we can do is we can actually very easily test if a point lies on a line by just taking my representation of a point my representation of a line I simply do the test if if x transposed l equals z then the points the point lies on that line so if I have a point in homogeneous coordinates I have a line in homogeneous coordinates just by Computing the dot product and testing if the result is zero I know if the point lies on that line which is nice everyone happy with this test everyone has everyone understood why we ended up doing this test so we look to the equations we know from thean World said how does a point look like in homogeneous coordinates how do I need to build up a line homogeneous coordinates so I just need to multiply them and if the result equals zero I exactly have the equation I know from my ukian VA okay so next thing we can do so far what we did we checked if a point lies on a line next thing we can do is we can simply take two lines and would be interesting do they actually intersect so I now have a line L and a line M I want to intersect those lines and they should intersect at some point x this what this means so L um intersected with M will give me the point x the question is now how do I find such a point how do I find the intersection of two lines and I want to exploit what we just learned so we learned before if I want to test if a point is on a line I can do it in this way the question is how can I now specify that two lines intersect because they should intersect in one point what can we do in order to formulate that equation with two of these each side ofation y exactly it's as easy as that so we say our our point where they intersect transposed L should be zero and X transposed M should be zero this give me a very simple system of linear equations which I could solve we can do exactly that say l * X and M * X should both be zero so this boils down to actually solving this system of linear equations so how can I solve such a system of linear equations actually one of the things how you can do this is actually the cras rule which is very easy to use for um small system like 2 by two systems which actually says if I have a so does everyone knows grammar rule or should I explain that again theoretically yes every everyone knows that okay at least a few people say know okay just explain easily how that works I have a system ax equals B and I can say then the first component of X of my solution X is given by the determinant of a matrix AI play that in a second divided by the determinant of the Matrix a so a is this a and a i is the Matrix a where I replace the I column by the vector B so can actually even do a small example on the black but should I do an example on the Blackboard how to how apply that okay so what I basically have I have L1 L2 um M1 M2 * X1 X2 equals - L3 - M3 so this is what this is what I want to solve now let's go to a concrete example let's say L equal 1 2 3 sorry I have to continue with no white chalk anymore um and M is 20.53 for example so what then need to do is X or the CR rule says me X1 is that determinant of A1 divided by determinant of a which is the determinant of A1 I take the First Column replace it with those elements so it's - L3 - M3 L2 M2 divided by determinant of L1 L2 M1 M2 and now I can fill that with numbers so this is a determinant of -3 2 -3 0.5 divided by determinant 1 2 2 0.5 and if I now compute that I get the result of - 1.28 Six in this example it can do exactly the same thing for X2 except that I compute the determinant of A2 that a over here so get exactly the same result except that I don't replace the First Column but the second column over here and then in this example you should get for X2 - 0 whatever 857 if you if you compute that now okay that's the way how we can actually use how we can actually solve that system so this system can be solved through the kma rule by x x which corresponds to my X1 over here is D1 / D2 so this is determinant of A1 this is determinant of a and same for y with determinant of A2 determinant of a and the determinant can simply be computed using these equations that's say this guy time this guy plus this guy minus this guy time this guy and then it's giv me exactly those equations and you can actually compute that so the interesting part comes now when I say what I've written in here so X and Y the solution can be expressed if I write this as a vector all right XY is 1 / D3 D2 no D1 D2 I actually write it in this way right this one actually got this result I can also Sor yeah what I now can do is why not simply extending that a little bit adding D3 over here and one over here right okay now my one over here in my homogeneous coordinates what I can do is in homogeneous coordinates I can drop any factor that I have before that equation can throw that away so came up Point XY corresponds to those elements D1 D2 D3 and they're computed exactly in this way and this is by coincident exactly the way how you compute the cross product you comp determining the 2D World gives you exactly the cross product over here so the interesting thing is now if I want to compute the intersection of two lines M1 and M2 that basically boils down to Computing the cross product of the two lines and this gives me directly the intersecting point just by applying the kras rule not on the numbers but just with the variables in here I can actually make this transformation say I create my new Vector which consists of x Y and one I put the numbers in here get 1 / D3 out drop that because of the homogenous property and then these are the compon the remaining components of my vector and this so This solving this equation L cross product M gives me directly my intersecting point x so instead of requiring me to solve this system of linear equation just can execute the cross product and I have my solution so it's great that's that actually that's pretty simple so if a point x is defined as the intersection of two lines I can actually compute this in this way so it's a very very simple way for computing the intersection of two lines using homogeneous coordinates okay what else could we do with lines and points can take two points and fit the line through those two points so next action activity we can do which we may often need and happily we also have an easy way for doing that so consider we have two point point x and the point Y so this X1 X2 is the coordinates of the of the first point and y1 Y2 are the coordinates of um the second point and I want to compute the line L consisting of L1 now 2 or L3 in the homogeneous coordinates then um that actually connects both of them how can I do that so I want one line which intersects with two points well after now we just did a subtraction between the two points by coordinates but that's nothing ECT that's not what I want to do so consider the solution just derived so far for the uh for computing the intersection of two lines what we had with very similar situation we said we want to have two lines and they should intersect in one point we formulated system of linear equations to solve that problem now we have the situation we want to have we have one line and two points what we can do is we can actually do exactly the same thing we can simply say my line should intersect with the point x and my line should intersect with a point point Y and again formulate exactly the same system of linear equations solve that we're happy can do basically exactly the same thing so what we do is we say Okay X transposed L should be zero and Y transposed L should be zero because these are my two points through which I want to fit l so I can set up my system with the CR Rule now have my L1 and L2 here the things I want to deter I also L3 sitting in here but I ignore that for a moment so I can simply just as we did it before apply gramar rule saying L1 is D1 / D3 L2 is D2 / D3 exactly applying comma rule as we did that before the only difference compared to what we did before is kind of we have the L sitting in here as our Factor but that's not bad that doesn't hurt us at all we can B Bally exactly the same trick as we did before we say okay we have L1 and L2 so we add in a third dimensional L3 which is the third dimension is L3 * 1 which is D3 / D3 so I set up my Vector L saying D1 / D3 D2 / D3 and L3 D3 / D3 the first thing I can do is as in D1 and D2 I have my L3 in here as well right so I can actually move that out move L3 / D3 out of the vector I have that here and then does the remaining parts form this Vector over here and again this vector looks pretty much like a cross product and if I inspect that we say actually realize that this is given by the cross product of the ve of the points of the three coordinates of the points X and Y this basically more exactly the same on what we what we did what we did over here this oneid by D out the only difference is we move L3 / D3 out and then through the homogeneous property I can actually drop that factor because it's just my scalar Lambda and then the only thing remains N1 N2 N3 which are three components resulting from the cross product so you can use the cross product of two points in homogeneous coordinates in order to obtain the line which connect those two points also something which is very easy so kind of to summarize what we have seen so far we can very easily sorry test if a point lies on a line and this holds if this condition is satisfied we can also say if we have two lines when to comp the intersection of two lines we can do that very easily and if we want to have two points and connect those points through a line we can also do this EX in the same easy way so it seems to be a framework which allows me to do some of these geometric operations quite easily in a quite easy and intuitive way which is nice also one of the reasons why using homogeneous coordinates is popular but one of the things which is very important for us as we work with cameras are actually points and lines in Infinity so we said before that we want to be able to represent points which are infinitively far away but in a certain direction and just I just told you that homogeneous coordinates offer us the possibility to do that by setting the last coordinate to zero so we are still maintaining the direction the first n dimensions and putting the last one to zero move this point infinitively far away so if this thing which is called points at infinity or X sometimes written x infinity which is the point with two coordinates here and they should not be zero both of them cannot be zero only one can be zero and last component is zero and it allows us to represent a point at Infinity by not using by only using finite coordinates so we don't have any Infinity sitting in there this is kind of one of the big Advantage because at the same point in time we can say we have a point which is infinitively far in this direction I can maintain this direction information and this is a very very useful thing for cameras because because what the camera basically does every pixel corresponds to a Direction but I have no idea where along the line this point actually is and I can represent points which are infinitively far away and of course if I want to map back to ukan coordinates if this last component is zero I will I will get nonfinite or infinite coordinates in the ukian wall because I cannot explicitly explicit represent that with finite coordinates in the ukian world okay so let's have a look to those points at Infinity we said we have these parallel lines which intersect in Infinity let's look how intersections at Infinity could look like so all lines L for which this equation holds so L do product Oh that's actually not written in a nice way so this should actually be written in um in a different font because these are the objects and don't have the dot product between the objects so this should be um in homogeneous coordinates equals zero that means that all lines for which this equation holds they actually path through the point in Infinity as the last component of this point x is zero I can ignore the last component of L because Anyway said to zero so I have my u and v with the do prob is cosine and S of the direction of the line if I use has a form should be zero so independently for the equation of L what the last component is all of them meet at that point in Infinity so any line with coine f sin F and here an arbitrary value is a line which intersects at this point Infinity if you now look to this equation over here and look to the interpretation of the hesap form the F specifies the the direction so the the direction of the line and this just specify what specifying the distance so distance doesn't matter the only thing which matters is Direction and every line where the first two components look like this that means all lines which look into the same direction meet at the same point at Infinity this exactly what this picture of the vanishing point was actually showing us that all parallel lines meet at one point in Infinity you can also see that by saying okay let's simply intersect two parallel lines with the framework of intersecting lines on what we learned by cross product so we can say okay let's simply say l m over here we said okay we have two general lines but these lines should be parallel so the first two components should be the same so of a a BB and then C and D down here and what this gives me is gives me the intersecting point so you can do a little bit of math like this and the important thing is this expression known here A minus a gives me zero so I obtain this expression where have some value over here and some value over here and this only depends or this depends on the directional components and but also on the the distance between those points this gives me the direction but the point is at Infinity because it has a zero in the last component so all parallel lines meet at infinity and this is something what you can kind of Illustrated see here if all parallel lines would have another parallel track here another parallel track here they would actually meet at the same point at Infinity as long as they are parallel if it would have different parallel lines like those bars over here they simply meet at a different point at Infinity they meet somewhere over there they all meet at one point and infinity so this this kind of clear we say inter parallel lines intersect at Infinity so we have no intersection between parallel lines in this framework because we have an explicit representation for points at Infinity it's nothing which I can arbitrarily introduced is something which naturally comes out from the equations of how to compute the intersection between two lines or parallel lines okay okay infinitively distant objects Al something if I say I said I have my infinitive distant point which has this form over here and I can also have an infinitely distant line show in the second it looks like this called the idal line this idal line is a line which has a zero components over here and one down here and what this line is this is the line where all points all infinitively dist points lie on so how to compute the if a point lies on a line just by the dot product so we take this point independent of u and v with this Vector over here the first component will always be zero the second component will always be zero the third component will always be zero so and therefore it is zero and therefore all all infinitively distant points lie on that line so all points at Infinity independent of that direction lie on this line so the only interpretation now you can see that actually this going of be your horizon line at Infinity call All Points at Infinity lie on this ideal line it's exactly how you can see that the ideal line is given through this equation so independently on which where the point is at Infinity it will always lie on that ideal line you can actually see on interpret that as the horizon line the infinitively far Horizon we can actually do the same thing also for 3D objects let's say okay we have a 3D point which now has four components over here and we can instead of a line we have our plane which just has one component more again something we can do in exactly the same way how we did that before can do exactly the same thing a point lies on the plane 3D if a product x equals z so all the the derivations work exactly in the same way as we have done that here very s analogous way and then we can also follow points at Infinity we have also kind of have this ideal plane we can actually illustrate that so this is the person we're sitting here in the center of our coordinate frame we have our lines in here all the different lines all the things at Infinity so this is kind of your horizon line this was the ideal line going around here and this is kind of then the plane like whatever the sky you can actually see that as this ideal plane um so this is kind of the the analogy to uh the the things at Infinity but what we are main using here actually the points that we have in Infinity so being able to represent points in Infinity though one of the big advantages that we have the second big Advantage is Transformations was the second point I had in the kind of positive list for the homogeneous coordinates that was that we can very very easily deal with Transformations so projective transformation so transformation in the our space that we have is an invertible linear mapping which Maps this H the mapping which Maps X to some other X Prime and one of the key of what is called the fundamental theorem of projective geometry tells me that every one: one so one to one is an injective function um straight line preserving mapping is a projective space PN on itself is in homography for any n larger or equal to two what it basically implies or the the important thing is that all one to one straight line preserving mappings and those were the mappings I'm actually interested in for my pinhole camera model um are linear is a linear function so sus can be expressed with a single Matrix if we use homogeneous coordinates that's the reason why can I actually describe then in this simple form because everything can be put into this Matrix h so the general projective mapping has exactly this form and what I now want to do is I want to look into this different instances of age which are possible and see how we can describe different types of Transformations so the most easy form is a translation let's Express a trans simple translation through this Matrix H and this is also one of the big advantages um compared to the cing space where I can perfectly express my rotation with a matrix but not a translation I always have this plus a vector if I move to This n plus one dimensional space I can do this much easier by setting up our Matrix H where so it's an arbitrary scaling factor which I don't care because this is part of the homogeneous property and I have a matrix so this is now for the 3D World a 4x4 Matrix where this is an 3x3 identity Matrix this is a three Vector um this is a three Vector transpose and one over here so exactly as it is written over here then this means this is this is a rotation which is expressed typically here but it's an identity so there's no rotation involved I have a vector which translates along x y and that I build up this Matrix H identity here zero here one here and here we just have a vector of how much I want to translate in X how much do I want to translate in y and how much do I want to translate in Z and this mapping actually performs a translation of the point in by TX Ty Y and T Z in the corresponding um Dimensions so this point is translated through this transformation gives me the new point so X Prime is a translated variant of the point x nice thing is this is just a matrix product so I can actually add a second Matrix over here let's say I apply H twice h H HX would be simply two translations by exactly the same distance TX t y t z other things which are important rotations I want to express a pure rotation I put here a zero Vector of Dimension three because this will I want don't have one any translation and I replace my identity Matrix which was sitting over here by our standard rotation Matrix so standard rotation matrices as you know them Express 2D or in 3D rotation mod the xaxis Y AIS and Z axis I don't want to go into the details you've seen that already you just take your standard rotation Matrix and actually plug it in here that's it and then you have kind of this type of transform which is has three parameters and these are the rotations around the x-axis the Y AIS and the Z AIS now we can actually combine both can look into the trans ation and rotation this something which we typically call the rigid body transformation which has six parameters which involves translation and three degrees of freedom for the rotation and I have my rotational part over here and my translational part over here and then I can step by step add additional parameters and make um new transformation which have different expressiveness powers of expressive so what I can do is I can now add a similarity transform which is a rigid body transform plus a scaling with one degree of freedom in terms of scaling I can do that by simply adding a scalar M over here so basically scaling my whole system make it larger and smaller rotation and a translation the important thing in here is the scaler is not supposed to sit in front of this Matrix because then it would be eliminated through the homogeneous property I'm only allowed to scale the first three dimensions the key trick is to not scale the one down here because if this would be scaled um this would simply go away through the normalization so the similar transform is an angle preserving transformation we can also look to aine Transformations where we have in addition to the similarity transform we actually have three scale parameters not only one in the different directions and we have a sheer three sheer parameters for shearing the system through the shear we don't have an angle preserving mapping anymore so but we are still um um have the the fact that parallel lines remain parallel so with the aine transformation we have an angle it's not angle preserving anymore but things which are parallel before are parallel afterwards so this Matrix a here is a three 3 Matrix which takes n takes 9° of Freedom this takes 3° of Freedom which gives me 12° of Freedom so this Matrix a is a general Matrix no constraints on that Matrix and the only thing which is left now here where I have some three degrees of freedom left is are those zeros over here and the next step in terms of General uh generality from A Fine transformation is then the projective transformation the projective transformation eliminates those zeros over here so here we have a general Vector a which are three additional degrees of freedom so it's a fine transformation plus the three parameters and this is these three parameters are those parameters are part of the projective transform which are the reason that parall lines may not stay parallel this is what happens in the projection this is what we have seen in the in the image I showed in the beginning of the house where you have your parallel lines and they're not parallel anymore because through the projection um of the pinol model we have elements in here which are non zero okay there's also a small list for 2D what kind of different um uh type of Transformations we have how the original figure looks like how the transformed figure may look like and what the a how the AG Matrix looks like at individual parts and written in this compact way then you can see here the most General one which in 3D has 15° of freedom in 2D has 80° of Freedom that those parallel lines here are not parallel anymore through through the projection you can do the same thing for 3D and what we basically have we have this type of hierarchy we have translation and rotation which is one or so rotation one parameter in in the 2D world three parameters in the three 3D World or translation by XY or XY Z if I combine both I get the rigid body transformation with 6 degrees of freedom in the 3D World and three degrees of freedom in the 2D world we have the similarity transform which is the rigid body transform plus the scaling one scale factor then we have the aine transformation which has different scalings and the shear and then we have the projective transformation which is all the degrees of freedom so 15 for the um 3D world we have a 4x4 Matrix and the only degree of Freedom which is missing is due to the one in the lower right corner which is the um homogeneous property therefore I have only um 15 degrees of freedom although I have 16 elements but one element is forced to be one or depending on the scal of factor can always be normalized to one so all these different types of transformation I express can express with linear mapping in this projective space which is really nice and since this a linear transform and I can use the Matrix to actually encode that I have the very easy way for chaining and inverting Transformations so if I have this transformation I want to get the inverse transformation I just need to invert my Matrix H by Computing the inverse of my Matrix h i directly invert this transformation so just need to stupidly invert my 3x3 or 4x4 Matrix and have have the inverse of my transform and I can also easily chain them up so I have transformation A2 and A1 can execute them one after the other of the vector X and get my new result remember them matrix multiplication is not commutative so if you swap them you may end up with a different Transformer so this doesn't have to be equal but the ability to change those matrices really will simplify our life if we have a large set of different number of Transformations I want to execute one after the other it's just a of matrices which I can very very easily write down and compute even can combine all of them into one Matrix and then one Matrix encodes all the transformations of the individual matrices and also being able to invert them the transformation just by inverting a matrix simplifies life substantially and this brings me to the end of my whatever tour through um projective geometry and homogeneous coordinates and the kind of key things as a take-home message is that the homogeneous coordinates are just an alternative way for representing geometry and they have a few advantages the advantages are that they can stly simplify mathematical Expressions we can explicitly represent points at Infinity with finite coordinates and we can very easily Define the Transformations that we have seen here so the projective transformations in Matrix form so we can invert them easily chain them chain them in a very very easy manner in this substantially simplifies the mathematical equations that we typically face and have to have to deal with um we can represent points at Infinity yeah that's what I said and how homogeneous coordinates actually realize that is that they add an additional Dimension and this additional Dimension is used for normalization for normalizing the other components if I map back to the ukle inv VA and by setting this normalization to zero I have the chance of representing um elements or geometric elements at infinity and the only and what homogeneity uh or homogeneity is actually defined through this equivalent so an object is homogeneous if x equals a scalar time x if the scal is unequal to zero so I'm somewhere along in this space I can see this I add a new dimension and somewhere along this line in this n plus one dimensional space where this space intersect with the N dimensional space where the last Dimension is one this is actually the corresponding point the homogeneous coordinates so being familiar with using homogeneous coordinates in those transformation something that you will need to do through the remaining part of the course and through the photogrametry to course for at least 50 to 80% of the course material so make sure you are familiar with that there will be an exercise about homogeneous coordinates as well so that you're kind of familiar with using them if this is not already already the case um there's also W first script gives you a very good summary um about what has happened here I'm used exactly the same notation as in the script so um I can strongly recommend it that's it from my side there are no questions thank you very much for attending and from day after tomorrow we will start with looking more deeper into cameras into intrinsic parameters extrinsic parameters of cameras and how we can actually describe the mapping from point of the 3D World to my image thank you very much
Up Next

Proving Sylvester's Problem: Melchior's Three Ordinary Lines Proof
@peymanafshani9304
106 views•2015-01-22

JEE Maths | Circles: Pole & Polar Explained with Equations
@TargetPublications
14.4K views•2019-02-23

Homogeneous Coordinates: A Lecture by Cyrill Stachniss (2020)
@CyrillStachniss
32.2K views•2020-08-20

The Mathematical Impossibility of Accurate World Maps
@Vox
23.3M views•2016-12-02
Related Study Plans & Knowledge Roadmaps
Structured learning paths in Mathematics
















![3D Programming Fundamentals [3D Perspective Projection] Tutorial 4](https://i.ytimg.com/vi_webp/UgM6mIQfGDA/maxresdefault.webp)




















