In the exercise we did in the previous lecture, we actually moved the origin. Maybe it's part of the reason why perspective projection is not a linear map ?
motoole2
Why is perspective projection not a linear map? According to this slide, linear maps take lines to lines. And perspective projection does map straight lines in the scene to straight lines in the image. So we need to be a bit careful about our definition of what is and is not a linear map.
According to the following slide, linear maps need to follow two properties:
f(u + v) = f(u) + f(v)
and
f(a u) = a f(u)
Suppose we have a function f((x,y,z)) = (x/z,y/z) that maps the 3D point (x,y,z) to a 2D pixel (x/z,y/z). Do these two properties hold for our perspective projection function f? The answer is no: neither property holds true in this case. To prove that perspective projection is not a linear map, we just need to find a case where one of these properties fail, e.g., f(a(x,y,z)) = f((ax,ay,az)) = (ax/az, ay/az) = (x/z,y/z) != a(x/z,y/z) for all a != 1.
motoole2
On the other hand, there are projections that are linear maps. For example, an orthographic projection takes a 3D point (x,y,z) and maps it to a 2D pixel (x,y), i.e., it is completely independent of z. It turns out that this particular projection function satisfies both properties and is a linear map.
motoole2
One last point (promise)!
When drawing our cube last class, we first translated the origin of our pinhole by first computing g((x,y,z)) = (x,y,z) - (2,3,5), and then performed a perspective projection. The mere operation of translation is also not a linear map. Why? We can, again, show one of the properties listed above fails:
This is because the origin changed in this case. Rotation and scaling transformations are linear maps. Translation is actually an affine map; however, there is a way to express a translation operation in terms of a linear map with the help of homogeneous coordinates (we will cover this soon).
In the exercise we did in the previous lecture, we actually moved the origin. Maybe it's part of the reason why perspective projection is not a linear map ?
Why is perspective projection not a linear map? According to this slide, linear maps take lines to lines. And perspective projection does map straight lines in the scene to straight lines in the image. So we need to be a bit careful about our definition of what is and is not a linear map.
According to the following slide, linear maps need to follow two properties:
f(u + v) = f(u) + f(v)
and
f(a u) = a f(u)
Suppose we have a function
f((x,y,z)) = (x/z,y/z)
that maps the 3D point(x,y,z)
to a 2D pixel(x/z,y/z)
. Do these two properties hold for our perspective projection functionf
? The answer is no: neither property holds true in this case. To prove that perspective projection is not a linear map, we just need to find a case where one of these properties fail, e.g.,f(a(x,y,z)) = f((ax,ay,az)) = (ax/az, ay/az) = (x/z,y/z) != a(x/z,y/z)
for alla != 1
.On the other hand, there are projections that are linear maps. For example, an orthographic projection takes a 3D point
(x,y,z)
and maps it to a 2D pixel(x,y)
, i.e., it is completely independent of z. It turns out that this particular projection function satisfies both properties and is a linear map.One last point (promise)!
When drawing our cube last class, we first translated the origin of our pinhole by first computing
g((x,y,z)) = (x,y,z) - (2,3,5)
, and then performed a perspective projection. The mere operation of translation is also not a linear map. Why? We can, again, show one of the properties listed above fails:g(a(x,y,z)) = a(x,y,z) - (2,3,5) != a(x,y,z) - a(2,3,5) = a g((x,y,z))
This is because the origin changed in this case. Rotation and scaling transformations are linear maps. Translation is actually an affine map; however, there is a way to express a translation operation in terms of a linear map with the help of homogeneous coordinates (we will cover this soon).