I solved some of the problems, but there are still some questions left...
If I take the matrix from argConvGLcpara (still transposed, sorry)
15.306278 0.000000 0.000000 0.000000
0.000000 22.197155 0.000000 0.000000
-0.106250 0.072917 1.000100 1.000000
0.000000 0.000000 -0.200010 0.000000
and do the following, I get quite what I need:
- set m[2][2] and m[2][3] (1.0001, 1.0) to the negative values so that
the z direction is the one I need
- devide m[0][0] and m[1][1] by 5.0
I read somewhere that artoolkit has this scaling factor, hasn't it? Why?
And does it only influence these two matrix elements?
- multiply m[0][0] with imagewidth/imageheight
As far as I know, this matrix element is normally devided by this aspect
ration, it seems I have to undo this. Otherwise I get a projection that
is too much stretched. I'm not sure, but it could be that the problem is
related to the following:
- divide m[0][0] by windowwidth/windowheight
I think the main problem is that the application doesn't have the fixed
window size and viewport equal to the image size that you normally would
use. If it would use this, the above matrix correction and this one
would result in no change.
Does any of this make sense?
Because of the quite strange behaviour when resizing the application
window and the possibility to set the eyepoint away from the camera
position I would prefer to draw the image on a plane perpendicular to
the camera view axis instead of drawing it filling the background of the
window. In which distance do I have to draw it? The focal length? How do
I get it?
Simon
Simon Notheis wrote:
> Hello everybody,
>
> I've got a quite big 3d application and am trying to integrate some
> artoolkit functions.
> The idea is to have a 3d model of a real scene shown by the application
> and a camera that is taking pictures of the same scene.
> The camera is calibrated via artoolkit and the distortion parameters are
> used to correct the image of the camera.
> When I try to superimpose the corrected image and the scene (the
> eyepoint is set to the camera position in the real world) I have to get
> the perspective projection right.
> With a FOV of 30° (which seems a bit low for me) I get a quite good
> match using gluPerspective. But of course the goal is not to try out the
> parameters but use the matrix that artoolkit can give me.
> Problem is that if I use them, I don't see anything of my scene.
> Here are the different projection matrices (transposed):
>
> gluPerspective
> 3.422423 0.000000 0.000000 0.000000
> 0.000000 3.866713 0.000000 0.000000
> 0.000000 0.000000 -1.000436 -1.000000
> 0.000000 0.000000 -0.400087 0.000000
>
> argConvGLcpara (v2.65)
> 15.306278 0.000000 0.000000 0.000000
> 0.000000 22.197155 0.000000 0.000000
> -0.106250 0.072917 1.000100 1.000000
> 0.000000 0.000000 -0.200010 0.000000
>
> arglCameraFrustum (v2.7)
> 15.306278 0.000000 0.000000 0.000000
> 0.000000 -22.197155 0.000000 0.000000
> -0.106250 -0.077083 1.000100 1.000000
> 0.000000 0.000000 -0.200010 0.000000
>
> Shouldn't the 1's in the third row be negative? And why is the second
> coloumn in the frustum-version negative? near and far clipping distance
> are set to the same values in the two artoolkit functions (0.1 2000).
>
> BTW: How to get the focal length and the pixel size out of the
> calibration parameters?
>
> Regards,
> Simon N.
>
>
|