ARToolKit | Mailing List Archive |
![]() |
From: | Manoj S <xpercept@y ........> | Received: | Apr 5, 2005 |
To | artoolkit@h .................. | ||
Subject: | camera position - fluctuating values | ||
--0-1469066129-1112729724=:62823 Content-Type: text/plain; charset=us-ascii Hi All, The ARtoolkit arGetTransMat gives the transformation matrix. arGetTransMat(&marker_info[0], patt_center, patt_width, Matrix); Now, if I use this matrix's last column, I get the translation of the pattern with respect to the camera. Now, in my case the camera moves and the pattern is fixed. So, I would like to get the position of the camera with respect to the pattern. E.g In case there is roll in the camera (but the camera does not move) the values of camera position should be pretty constant. For this, I use ... arUtilMatInv(Matrix, cam_trans); arUtilMat2QuatPos( cam_trans, quat, pos ); The pos returned by this function is wildly fluctuating. So, how can I find the camera position with respect to the marker... My angles seem accurate for pan, tilt and roll... But my translation also changes if I just roll the camera (is there a reason for this)... Thanks a ton. Sasha, --------------------------------- Yahoo! Messenger Show us what our next emoticon should look like. Join the fun. --0-1469066129-1112729724=:62823 Content-Type: text/html; charset=us-ascii <DIV>Hi All,<BR>The ARtoolkit arGetTransMat gives the transformation matrix. <BR><BR>arGetTransMat(&marker_info[0], patt_center, patt_width, Matrix);<BR>Now, if I use this matrix's last column, I get the translation of the pattern with respect to the camera. <BR><BR>Now, in my case the camera moves and the pattern is fixed. So, I would like to get the position of the camera with respect to the pattern. E.g In case there is roll in the camera (but the camera does not move) the values of camera position should be pretty constant. <BR><BR>For this, I use ...<BR>arUtilMatInv(Matrix, cam_trans);<BR>arUtilMat2QuatPos( cam_trans, quat, pos );<BR><BR>The pos returned by this function is wildly fluctuating. So, how can I find the camera position with respect to the marker... My angles seem accurate for pan, tilt and roll... But my translation also changes if I just roll the camera (is there a reason for this)...<BR><BR>Thanks a ton.</DIV> <DIV> </DIV> <DIV>Sasha,</DIV> <DIV></DIV><p> <hr size=1>Yahoo! Messenger<br> Show us what our next emoticon should look like. <a href="http://us.rd.yahoo.com/evt=31855/*http://advision.webevents.yahoo.com/emoticontest">Join the fun.</a> --0-1469066129-1112729724=:62823-- |
From: | Manoj S <xpercept@y ........> | Received: | Apr 5, 2005 |
To | Blair MacIntyre <blair@c ............>, artoolkit@h .................. | ||
Subject: | Re: camera position - fluctuating values | ||
--0-1724337093-1112732187=:68969 Content-Type: text/plain; charset=us-ascii Hi Dr. MacIntyre, Thank you for your prompt reply. Just to shed some more light on the topic... I use the parameters given by OpenCV for camera calibration. In the past I was just doing 3D overlay and so I guess it worked fine since I used the translation of the pattern wrt to the camera. Now, I am trying to track a mobile camera. (The values fluctuate even when there is no movement of the camera)... I guess I need to use the calib_camera2. Is there any place where I can get documentation on the camera calibration (and download the patterns). Thanks again for your help... Regards, Sasha Blair MacIntyre <blair@c ............> wrote: This is a well known problem with marker tracking of this sort. There are a variety of factors: - the feature points are quite close together (although this is actually minor) - the accuracy of the feature points is poor, only within a few pixels of the "real" values (because of the thresholding accuracy) - the camera calibration (I suspect) is not done well, which means the computation of where the camera is relative to the marker is wrong The last issue you can fix by carefully and accurately calculating the calibration. The second issue you can fix by using a secondary pass to refine the estimates of the corners (we use the OpenCV subpixel corner finder, but it has its own problems). The first issue you can solve by using multiple markers so that they cover as much of the video frame as possible. If you fix the last two, you'll get better poses. The first one will also help a lot, and is necessary if the marker is small. On Apr 5, 2005, at 3:35 PM, Manoj S wrote: > Hi All, > The ARtoolkit arGetTransMat gives the transformation matrix. > > arGetTransMat(&marker_info[0], patt_center, patt_width, Matrix); > Now, if I use this matrix's last column, I get the translation of the > pattern with respect to the camera. > > Now, in my case the camera moves and the pattern is fixed. So, I would > like to get the position of the camera with respect to the pattern. > E.g In case there is roll in the camera (but the camera does not move) > the values of camera position should be pretty constant. > > For this, I use ... > arUtilMatInv(Matrix, cam_trans); > arUtilMat2QuatPos( cam_trans, quat, pos ); > > The pos returned by this function is wildly fluctuating. So, how can I > find the camera position with respect to the marker... My angles seem > accurate for pan, tilt and roll... But my translation also changes if > I just roll the camera (is there a reason for this)... > > Thanks a ton. > > Sasha, > > Yahoo! Messenger > Show us what our next emoticon should look like. Join the fun. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com --0-1724337093-1112732187=:68969 Content-Type: text/html; charset=us-ascii <DIV>Hi Dr. MacIntyre,</DIV> <DIV>Thank you for your prompt reply. Just to shed some more light on the topic... I use the parameters given by OpenCV for camera calibration. In the past I was just doing 3D overlay and so I guess it worked fine since I used the translation of the pattern wrt to the camera. Now, I am trying to track a mobile camera. (The values fluctuate even when there is no movement of the camera)... </DIV> <DIV> </DIV> <DIV>I guess I need to use the calib_camera2. Is there any place where I can get documentation on the camera calibration (and download the patterns). Thanks again for your help...</DIV> <DIV> </DIV> <DIV>Regards,</DIV> <DIV>Sasha<BR><B><I></I></B></DIV> <DIV><B><I>Blair MacIntyre <blair@c ............></I></B> wrote:</DIV> <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">This is a well known problem with marker tracking of this sort. There <BR>are a variety of factors:<BR>- the feature points are quite close together (although this is <BR>actually minor)<BR>- the accuracy of the feature points is poor, only within a few pixels <BR>of the "real" values (because of the thresholding accuracy)<BR>- the camera calibration (I suspect) is not done well, which means the <BR>computation of where the camera is relative to the marker is wrong<BR><BR>The last issue you can fix by carefully and accurately calculating the <BR>calibration.<BR><BR>The second issue you can fix by using a secondary pass to refine the <BR>estimates of the corners (we use the OpenCV subpixel corner finder, but <BR>it has its own problems).<BR><BR>The first issue you can solve by using multiple markers so that they <BR>cover as much of the video frame as possible.<BR><BR>If you fix the last two, you'll get better poses. The first one will <BR>also help a lot, and is necessary if the marker is small.<BR><BR>On Apr 5, 2005, at 3:35 PM, Manoj S wrote:<BR><BR>> Hi All,<BR>> The ARtoolkit arGetTransMat gives the transformation matrix.<BR>><BR>> arGetTransMat(&marker_info[0], patt_center, patt_width, Matrix);<BR>> Now, if I use this matrix's last column, I get the translation of the <BR>> pattern with respect to the camera.<BR>><BR>> Now, in my case the camera moves and the pattern is fixed. So, I would <BR>> like to get the position of the camera with respect to the pattern. <BR>> E.g In case there is roll in the camera (but the camera does not move) <BR>> the values of camera position should be pretty constant.<BR>><BR>> For this, I use ...<BR>> arUtilMatInv(Matrix, cam_trans);<BR>> arUtilMat2QuatPos( cam_trans, quat, pos );<BR>><BR>> The pos returned by this function is wildly fluctuating. So, how can I <BR>> find the camera position with respect to the marker... My angles seem <BR>> accurate for pan, tilt and roll... But my translation also changes if <BR>> I just roll the camera (is there a reason for this)...<BR>><BR>> Thanks a ton.<BR>> <BR>> Sasha,<BR>><BR>> Yahoo! Messenger<BR>> Show us what our next emoticon should look like. Join the fun.<BR></BLOCKQUOTE><p>__________________________________________________<br>Do You Yahoo!?<br>Tired of spam? Yahoo! Mail has the best spam protection around <br>http://mail.yahoo.com --0-1724337093-1112732187=:68969-- |
From: | Blair MacIntyre <blair@c ............> | Received: | Apr 5, 2005 |
To | Manoj S <xpercept@y ........> | ||
Subject: | Re: camera position - fluctuating values | ||
This is a well known problem with marker tracking of this sort. There=20= are a variety of factors: - the feature points are quite close together (although this is=20 actually minor) - the accuracy of the feature points is poor, only within a few pixels=20= of the "real" values (because of the thresholding accuracy) - the camera calibration (I suspect) is not done well, which means the=20= computation of where the camera is relative to the marker is wrong The last issue you can fix by carefully and accurately calculating the=20= calibration. The second issue you can fix by using a secondary pass to refine the=20 estimates of the corners (we use the OpenCV subpixel corner finder, but=20= it has its own problems). The first issue you can solve by using multiple markers so that they=20 cover as much of the video frame as possible. If you fix the last two, you'll get better poses. The first one will=20 also help a lot, and is necessary if the marker is small. On Apr 5, 2005, at 3:35 PM, Manoj S wrote: > Hi All, > The ARtoolkit arGetTransMat gives the transformation matrix. > > arGetTransMat(&marker_info[0], patt_center, patt_width, Matrix); > Now, if I use this matrix's last column, I get the translation of the=20= > pattern with respect to the camera. > > Now, in my case the camera moves and the pattern is fixed. So, I would=20= > like to get the position of the camera with respect to the pattern.=20 > E.g In case there is roll in the camera (but the camera does not move)=20= > the values of camera position should be pretty constant. > > For this, I use ... > arUtilMatInv(Matrix, cam_trans); > arUtilMat2QuatPos( cam_trans, quat, pos ); > > The pos returned by this function is wildly fluctuating. So, how can I=20= > find the camera position with respect to the marker... My angles seem=20= > accurate for pan, tilt and roll... But my translation also changes if=20= > I just roll the camera (is there a reason for this)... > > Thanks a ton. > =A0 > Sasha, > > Yahoo! Messenger > Show us what our next emoticon should look like. Join the fun.= |
From: | Blair MacIntyre <blair@c ............> | Received: | Apr 5, 2005 |
To | Manoj S <xpercept@y ........> | ||
Subject: | Re: camera position - fluctuating values | ||
> Thank you for your prompt reply. Just to shed some more light on the=20= > topic... I use the parameters given by OpenCV for camera calibration. There was a discussion here recently on how to convert those into=20 ARToolkit parameters. > In the past I was just doing 3D overlay and so I guess it worked fine=20= > since I used the translation of the pattern wrt to the camera. Right. You don't even need to calibrate the camera for that. That's=20 the beauty of the ARtoolkit (or anything like it) ... everything works=20= out in the projections. > Now,=A0I am trying to track a mobile camera. (The values fluctuate = even=20 > when there is no movement of the camera)... =A0 Yep. We saw that too. > I guess I need to use the calib_camera2. Is there any place where=A0 I=20= > can get documentation on the camera calibration (and download the=20 > patterns). Thanks again for your help... The OpenCV calibration routines are better and more stable (in my=20 experience) so switch to that won't buy you much. The subpixel corner=20= finding was the biggest win for me. > =A0 > Regards, > Sasha > Blair MacIntyre <blair@c ............> wrote: > This is a well known problem with marker tracking of this sort. There > are a variety of factors: > - the feature points are quite close together (although this is > actually minor) > - the accuracy of the feature points is poor, only within a few pixels > of the "real" values (because of the thresholding accuracy) > - the camera calibration (I suspect) is not done well, which means the > computation of where the camera is relative to the marker is wrong > > The last issue you can fix by carefully and accurately calculating the > calibration. > > The second issue you can fix by using a secondary pass to refine the > estimates of the corners (we use the OpenCV subpixel corner finder,=20= > but > it has its own problems). > > The first issue you can solve by using multiple markers so that they > cover as much of the video frame as possible. > > If you f! ix the last two, you'll get better poses. The first one will > also help a lot, and is necessary if the marker is small. > > On Apr 5, 2005, at 3:35 PM, Manoj S wrote: > > > Hi All, > > The ARtoolkit arGetTransMat gives the transformation matrix. > > > > arGetTransMat(&marker_info[0], patt_center, patt_width, Matrix); > > Now, if I use this matrix's last column, I get the translation of = the > > pattern with respect to the camera. > > > > Now, in my case the camera moves and the pattern is fixed. So, I=20 > would > > like to get the position of the camera with respect to the pattern. > > E.g In case there is roll in the camera (but the camera does not=20 > move) > > the values of camera position should be pretty constant. > > > > For this, I use ... > > arUtilMatInv(Matrix, cam_trans); > > arUtilMat2QuatPos( cam_trans, quat, pos ); > > > > The pos returned by this function is wildly fluctuating. So, how can=20= > I ! > > find the camera position with respect to the marker... My angles=20 > seem > > accurate for pan, tilt and roll... But my translation also changes=20= > if > > I just roll the camera (is there a reason for this)... > > > > Thanks a ton. > > =A0 > > Sasha, > > > > Yahoo! Messenger > > Show us what our next emoticon should look like. Join the fun. > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com |
From: | Manoj S <xpercept@y ........> | Received: | Apr 7, 2005 |
To | Blair MacIntyre <blair@c ............>, artoolkit@h .................. | ||
Subject: | Re: camera position - fluctuating values | ||
--0-1857027777-1112886314=:14278 Content-Type: text/plain; charset=us-ascii Hi, I had already seen those discussions. I also tried setting the distortion parameters to dist[0] = Xcenter dist[1] = Ycenter dist[2] = 0; dist[3] = 1; Even then, arUtilMatInv(Matrix, cam_trans); arUtilMat2QuatPos( cam_trans, quat, pos ); returns wildly fluctuating values... The pos is fluctuating even if the camera doesnt move... If I take the value of the matrix's last column (returned by argettransmat) as the translation of the pattern wrt camera, then I can get the camera position by taking a negative... I have also calculated (and displaying) the roll based on the rotation matrix and it gives me perfect angles...but how do I correct the translation matrix...(eg. if there is a roll of 45 the camera position changes as if the pattern as moved when it should be the same... ) The value of the translation should be the same (since the physical location of the camera is the same) but in my case it changes with the roll... Should I use the orientation matrix to correct for this in some way... Please advise... Really sorry to be bothering you but am I missing anything here? Blair MacIntyre <blair@c ............> wrote:> Thank you for your prompt reply. Just to shed some more light on the > topic... I use the parameters given by OpenCV for camera calibration. There was a discussion here recently on how to convert those into ARToolkit parameters. > In the past I was just doing 3D overlay and so I guess it worked fine > since I used the translation of the pattern wrt to the camera. Right. You don't even need to calibrate the camera for that. That's the beauty of the ARtoolkit (or anything like it) ... everything works out in the projections. > Now, I am trying to track a mobile camera. (The values fluctuate even > when there is no movement of the camera)... Yep. We saw that too. > I guess I need to use the calib_camera2. Is there any place where I > can get documentation on the camera calibration (and download the > patterns). Thanks again for your help... The OpenCV calibration routines are better and more stable (in my experience) so switch to that won't buy you much. The subpixel corner finding was the biggest win for me. > > Regards, > Sasha > Blair MacIntyre wrote: > This is a well known problem with marker tracking of this sort. There > are a variety of factors: > - the feature points are quite close together (although this is > actually minor) > - the accuracy of the feature points is poor, only within a few pixels > of the "real" values (because of the thresholding accuracy) > - the camera calibration (I suspect) is not done well, which means the > computation of where the camera is relative to the marker is wrong > > The last issue you can fix by carefully and accurately calculating the > calibration. > > The second issue you can fix by using a secondary pass to refine the > estimates of the corners (we use the OpenCV subpixel corner finder, > but > it has its own problems). > > The first issue you can solve by using multiple markers so that they > cover as much of the video frame as possible. > > If you f! ix the last two, you'll get better poses. The first one will > also help a lot, and is necessary if the marker is small. > > On Apr 5, 2005, at 3:35 PM, Manoj S wrote: > > > Hi All, > > The ARtoolkit arGetTransMat gives the transformation matrix. > > > > arGetTransMat(&marker_info[0], patt_center, patt_width, Matrix); > > Now, if I use this matrix's last column, I get the translation of the > > pattern with respect to the camera. > > > > Now, in my case the camera moves and the pattern is fixed. So, I > would > > like to get the position of the camera with respect to the pattern. > > E.g In case there is roll in the camera (but the camera does not > move) > > the values of camera position should be pretty constant. > > > > For this, I use ... > > arUtilMatInv(Matrix, cam_trans); > > arUtilMat2QuatPos( cam_trans, quat, pos ); > > > > The pos returned by this function is wildly fluctuating. So, how can > I ! > > find the camera position with respect to the marker... My angles > seem > > accurate for pan, tilt and roll... But my translation also changes > if > > I just roll the camera (is there a reason for this)... > > > > Thanks a ton. > > > > Sasha, > > > > Yahoo! Messenger > > Show us what our next emoticon should look like. Join the fun. > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com --0-1857027777-1112886314=:14278 Content-Type: text/html; charset=us-ascii <DIV>Hi,</DIV> <DIV>I had already seen those discussions. I also tried setting the distortion parameters to</DIV> <DIV>dist[0] = Xcenter</DIV> <DIV>dist[1] = Ycenter</DIV> <DIV>dist[2] = 0;</DIV> <DIV>dist[3] = 1;</DIV> <DIV>Even then,</DIV> <DIV> arUtilMatInv(Matrix, cam_trans);<BR> arUtilMat2QuatPos( cam_trans, quat, pos ); </DIV> <DIV>returns wildly fluctuating values...</DIV> <DIV> </DIV> <DIV>The pos is fluctuating even if the camera doesnt move...</DIV> <DIV>If I take the value of the matrix's last column (returned by argettransmat) as the translation of the pattern wrt camera, then I can get the camera position by taking a negative...</DIV> <DIV>I have also calculated (and displaying) the roll based on the rotation matrix and it gives me perfect angles...but how do I correct the translation matrix...(eg. if there is a roll of 45 the camera position changes as if the pattern as moved when it should be the same... )</DIV> <DIV>The value of the translation should be the same (since the physical location of the camera is the same) but in my case it changes with the roll... <BR><BR>Should I use the orientation matrix to correct for this in some way... Please advise...<BR></DIV> <DIV>Really sorry to be bothering you but am I missing anything here?</DIV> <DIV><BR><BR><B><I>Blair MacIntyre <blair@c ............></I></B> wrote: <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">> Thank you for your prompt reply. Just to shed some more light on the <BR>> topic... I use the parameters given by OpenCV for camera calibration.<BR><BR>There was a discussion here recently on how to convert those into <BR>ARToolkit parameters.<BR><BR>> In the past I was just doing 3D overlay and so I guess it worked fine <BR>> since I used the translation of the pattern wrt to the camera.<BR><BR>Right. You don't even need to calibrate the camera for that. That's <BR>the beauty of the ARtoolkit (or anything like it) ... everything works <BR>out in the projections.<BR><BR>> Now, I am trying to track a mobile camera. (The values fluctuate even <BR>> when there is no movement of the camera)... <BR><BR>Yep. We saw that too.<BR><BR>> I guess I need to use the calib_camera2. Is there any place where I <BR>> can get documentation on the camera calibration (and download the <BR>> patterns). Thanks again for your help...<BR><BR>The OpenCV calibration routines are better and more stable (in my <BR>experience) so switch to that won't buy you much. The subpixel corner <BR>finding was the biggest win for me.<BR><BR><BR>> <BR>> Regards,<BR>> Sasha<BR>> Blair MacIntyre <BLAIR@C ............>wrote:<BR>> This is a well known problem with marker tracking of this sort. There<BR>> are a variety of factors:<BR>> - the feature points are quite close together (although this is<BR>> actually minor)<BR>> - the accuracy of the feature points is poor, only within a few pixels<BR>> of the "real" values (because of the thresholding accuracy)<BR>> - the camera calibration (I suspect) is not done well, which means the<BR>> computation of where the camera is relative to the marker is wrong<BR>><BR>> The last issue you can fix by carefully and accurately calculating the<BR>> calibration.<BR>><BR>> The second issue you can fix by using a secondary pass to refine the<BR>> estimates of the corners (we use the OpenCV subpixel corner finder, <BR>> but<BR>> it has its own problems).<BR>><BR>> The first issue you can solve by using multiple markers so that they<BR>> cover as much of the video frame as possible.<BR>><BR>> If you f! ix the last two, you'll get better poses. The first one will<BR>> also help a lot, and is necessary if the marker is small.<BR>><BR>> On Apr 5, 2005, at 3:35 PM, Manoj S wrote:<BR>><BR>> > Hi All,<BR>> > The ARtoolkit arGetTransMat gives the transformation matrix.<BR>> ><BR>> > arGetTransMat(&marker_info[0], patt_center, patt_width, Matrix);<BR>> > Now, if I use this matrix's last column, I get the translation of the<BR>> > pattern with respect to the camera.<BR>> ><BR>> > Now, in my case the camera moves and the pattern is fixed. So, I <BR>> would<BR>> > like to get the position of the camera with respect to the pattern.<BR>> > E.g In case there is roll in the camera (but the camera does not <BR>> move)<BR>> > the values of camera position should be pretty constant.<BR>> ><BR>> > For this, I use ...<BR>> > arUtilMatInv(Matrix, cam_trans);<BR>> > arUtilMat2QuatPos( cam_trans, quat, pos );<BR>> ><BR>> > The pos returned by this function is wildly fluctuating. So, how can <BR>> I !<BR>> > find the camera position with respect to the marker... My angles <BR>> seem<BR>> > accurate for pan, tilt and roll... But my translation also changes <BR>> if<BR>> > I just roll the camera (is there a reason for this)...<BR>> ><BR>> > Thanks a ton.<BR>> > <BR>> > Sasha,<BR>> ><BR>> > Yahoo! Messenger<BR>> > Show us what our next emoticon should look like. Join the fun.<BR>><BR>> __________________________________________________<BR>> Do You Yahoo!?<BR>> Tired of spam? Yahoo! Mail has the best spam protection around<BR>> http://mail.yahoo.com<BR><BR></BLOCKQUOTE></DIV><p>__________________________________________________<br>Do You Yahoo!?<br>Tired of spam? Yahoo! Mail has the best spam protection around <br>http://mail.yahoo.com --0-1857027777-1112886314=:14278-- |
From: | "Jiang Tian" <jiangt@i ..........> | Received: | Apr 7, 2005 |
To | Manoj S <xpercept@y ........>, Blair MacIntyre <blair@c ............>, artoolkit@h .................. | ||
Subject: | Re: camera position - fluctuating values | ||
Hi The reason for the fluctuating is because the trans_matrix is little different at every frame. One method to fix it is combining the previous trans_matrix and the current trans_matrix if the objects are static. For example: trans_matrix = alfa*current_trans_matrix + (1-alfa)*previous_trans_matrix. Probably you can choose an appropriate alfa which will also works for the moving objects (you can think it moves at the opposite direction of the camera). I am not sure this can help your problem. However you can try it. Regards, Jiang ------------------------------------------------------------------------------- Jiang Tian Graduate Student, HCI Program Human and Computer Vision Laboratory Virtual Reality Application Center Iowa State University Ames, IA 50011 Lab Phone: +1-515-294-4922 > Hi, > I had already seen those discussions. I also tried setting the distortion parameters to > dist[0] = Xcenter > dist[1] = Ycenter > dist[2] = 0; > dist[3] = 1; > Even then, > arUtilMatInv(Matrix, cam_trans); > arUtilMat2QuatPos( cam_trans, quat, pos ); > returns wildly fluctuating values... > > The pos is fluctuating even if the camera doesnt move... > If I take the value of the matrix's last column (returned by argettransmat) as the translation of the pattern wrt camera, then I can get the camera position by taking a negative... > I have also calculated (and displaying) the roll based on the rotation matrix and it gives me perfect angles...but how do I correct the translation matrix...(eg. if there is a roll of 45 the camera position changes as if the pattern as moved when it should be the same... ) > The value of the translation should be the same (since the physical location of the camera is the same) but in my case it changes with the roll... > > Should I use the orientation matrix to correct for this in some way... Please advise... > > Really sorry to be bothering you but am I missing anything here? > > |
From: | Blair MacIntyre <blair@c ............> | Received: | Apr 7, 2005 |
To | Manoj S <xpercept@y ........> | ||
Subject: | Re: camera position - fluctuating values | ||
> Hi, > I=A0 had already seen those discussions. I also tried setting the=20 > distortion parameters to > dist[0] =3D Xcenter > dist[1] =3D Ycenter > dist[2]=A0=3D 0; > dist[3] =3D 1; That is a hack, that basically corrects for the fact that many=20 calibration programs are unstable and set the center to a non-centered=20= value, even though most cameras are pretty close to the center. > Even then, > =A0arUtilMatInv(Matrix, cam_trans); > =A0arUtilMat2QuatPos( cam_trans, quat, pos ); > returns wildly fluctuating values... The bottom line is, if the camera calibration is not near-perfect, and=20= the feature (e.g., corners) used for pose estimation are not found very=20= accurately (preferably with sub-pixel accuracy), you will see errors. The position fluctuates wildly because very small mis-calculations of=20 the orientation of the pose (which will happen under the best of=20 circumstances with solutions like the ARToolkit, which compute the pose=20= of individual markers) result in HUGE movement of the camera when you=20 invert the matrix. > The pos is fluctuating even if the camera doesnt move... Right, that's because the orientation of the marker is jiggling. > If I take the value of the matrix's last column (returned by=20 > argettransmat) as the translation of the pattern wrt camera, then I=20 > can get the camera position by taking a negative... You get "a" camera position, not necessarily "the" position. What you=20= don't get is the orientation. > I have also calculated (and displaying) the roll based on the rotation=20= > matrix and it gives me perfect angles...but how do I correct the=20 > translation matrix...(eg. if there is a roll of 45 the camera position=20= > changes as if the pattern as moved when it should be the same... ) > The value of the translation should be the same (since the physical=20 > location of the camera is the same) but in my case it changes with the=20= > roll... > > Should I use the orientation matrix to correct for this in some way...=20= > Please advise... > Really sorry to be bothering you but am I missing anything here? There is no way around this with simple hacks; without really good=20 corner finding and really good calibration, you will NOT get a good=20 estimate of the pose of the marker. Without that, you cannot get a good position/orientation of the camera. By the time you get bad data back, you have ... bad data. You have to=20= fix it at the source or you won't be able to do anything reliably. > Blair MacIntyre <blair@c ............> wrote: > > Thank you for your prompt reply. Just to shed some more light on = the > > topic... I use the parameters given by OpenCV for camera=20 > calibration. > > There was a discussion here recently on how to convert those into > ARToolkit parameters. > > > In the past I was just doing 3D overlay and so I guess it worked = fine > > since I used the translation of the pattern wrt to the camera. > > Right. You don't even need to calibrate the camera for that. That's > the beauty of the ARtoolkit (or anything like it) ... everything = works > out in the projections. > > > Now,=A0I am trying to track a mobile camera. (The values fluctuate = even > > when there is no movement of the camera)... =A0 > > Yep. We saw that too. > > > I guess I need to use the calib_camera2. Is there any place where=A0 = I > > can get documentation on the camer a calibration (and download the > > patterns). Thanks again for your help... > > The OpenCV calibration routines are better and more stable (in my > experience) so switch to that won't buy you much. The subpixel corner > finding was the biggest win for me. > > > > =A0 > > Regards, > > Sasha > > Blair MacIntyre wrote: > > This is a well known problem with marker tracking of this sort. = There > > are a variety of factors: > > - the feature points are quite close together (although this is > > actually minor) > > - the accuracy of the feature points is poor, only within a few=20 > pixels > > of the "real" values (because of the thresholding accuracy) > > - the camera calibration (I suspect) is not done well, which means=20= > the > > computation of where the camera is relative to the marker is wrong > > > > The last issue you can fix by carefully and accurately calculating=20= > the > > calibration. > > > > The second issue you can fix by using a secondary pass to refine the > > estimates of the corners (we use the OpenCV subpixel corner finder, > > but > > it has its own problems). > > > > The first issue you can solve by using multiple markers so that they > > cover as much of the video frame as possible. > > > > If you f! ix the last two, you'll get better poses. The first one=20 > will > > also help a lot, and is necessary if the marker is small. > > > > On Apr 5, 2005, at 3:35 PM, Manoj S wrote: > > > > > Hi All, > > > The ARtoolkit arGetTransMat gives the transformation matrix. > > > > > > arGetTransMat(&marker_info[0], patt_center, patt_width, Matrix); > > > Now, if I use this matrix's last column, I get the translation of=20= > the > > > pattern with respect to the camera. > > > > > > Now, in my case the camera moves and the pattern is fixed. So , I > > would > > > like to get the position of the camera with respect to the = pattern. > > > E.g In case there is roll in the camera (but the camera does not > > move) > > > the values of camera position should be pretty constant. > > > > > > For this, I use ... > > > arUtilMatInv(Matrix, cam_trans); > > > arUtilMat2QuatPos( cam_trans, quat, pos ); > > > > > > The pos returned by this function is wildly fluctuating. So, how=20= > can > > I ! > > > find the camera position with respect to the marker... My angles > > seem > > > accurate for pan, tilt and roll... But my translation also changes > > if > > > I just roll the camera (is there a reason for this)... > > > > > > Thanks a ton. > > > =A0 > > > Sasha, > > > > > > Yahoo! Messenger > > > Show us what our next emoticon should look like. Join the fun. > > > > __________________________________________________ > > Do You Yahoo!? > > Tired of spam? Yahoo! Mail has the best spam protection around > > http://mail.yahoo.com > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com |