Hello,
Recently I've been looking into an error characterization of the
ARToolKit, using OpenGL to render images of markers into a framebuffer,
which is then fed back into ARToolKit as if the framebuffer had come from
an ideal camera.
If I understand the meanings of the camera parameters correctly, a
rectangular viewport with dimensions (w,h) subtending theta degrees
horizontally, e.g., the viewpoint given by
double w, h, theta;
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(theta, w / h, 1.0, 100.0);
should have a corresponding intrinsic camera matrix as follows:
{{ a, 0.0, w / 2.0},
{ 0.0, a, h / 2.0},
{ 0.0, 0.0, 1.0 }}
where a = (w / 2.0) * tan((M_PI * theta / 180.0) / 2.0). Distortion
parameters are {0.0, 0.0, 1.0, 1.0}. (I've arbitrarily chosen a focal
distance of 1.0.)
Now, if my windows are square (w = h), this is great: the outputs more or
less match the inputs, up to a linear scale and offset. When w != h,
though, I start to see nonlinearities in the output from ARToolKit.
Before I dig any further, could one of you kind souls tell me if I am
somehow confused about these ideal camera parameters, or am missing
something obvious?
Thanks,
Konrad Schroder
perseant@h .......
