|
|
When we have the camera place at <0,0,-z> looking at <0,0,0> with a simple
object in sight; say a square of length 3 units and centered at <1,1,10>
and we do a simple rotation i.e. around X-axis, the simple rotation matrix
given by [1 0 0;0 cos -sin;0 sin cos] indicates that all x coordinate will
stay the same! But in reality, a parallel vertical lines will converge to a
point far away, thus the x-coordinates are changing as well as the
stay parallel. Is there a way to represent this perspective rotation in a
single matrix?
Take the points at the Upper Left and Lower Left corner in the original
Square with pixel values at <178,115> and <179,268>. After applying the
rotation matrix we get <226,77> and <186,362> which is NOT the same
according to:
New_Point_Coord=Rotation_Matrix * Old_Point_Coord! (am I doing something
wrong?)
since translation is assumed zero, and this is a single rotation?
What I'm trying to do is to be able to predict the new coordinate of the
object given a known rotation of a Camera placed at <0,0,-z>. This will be
used in conjunction of corresponding points between two images of the same
objects taking from 2 different views to derive the camera parameters
(Essential or Fundamental matrix).
I've posted a similar question at the advanced group and thankfully got some
hint from Tor Olav
Here is the simple Code. Pixel values obtained when rotation was set to
zero, and then measured with the mouse and direct reading.
// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7
#version 3.5;
#include "colors.inc"
// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7
box {
-<1, 1, 5>, <1, 1, 5>
pigment { color rgb <1, 1, 1> }
}
// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7
#declare Camera1 =
camera {
location <0, 0, -10> // or location -10*z
look_at <0, 0, 0> // ot look_at 0*y
rotate <40, 0, 0> // or rotate 40*y
}
#declare Angle = radians(-40);
#declare Camera2 =
camera {
location -10*z
look_at 0*y
matrix <
1, 0 , 0,
0, cos(Angle), -sin(Angle),
0, sin(Angle), cos(Angle),
0, 0, 0
>
}
camera { Camera1 }
//camera { Camera2 }
light_source { <1, 2, -3>*100 color rgb <1, 1, 1> }
background { color rgb <0.9, 0.8, 0.7> }
// ===== 1 ======= 2 ======= 3 ======= 4 ======= 5 ======= 6 ======= 7
Post a reply to this message
|
|