I have problem with VS2008 debugger showing junk when osg::Vec3 is passed to a function by value. The code sees the proper value, just the debugger shows junk (usually some very small denormalized numbers). I am not sure whether this is helpful, but it might be related.<br>
<br>Regards,<br>Dženan<br><br><div class="gmail_quote">On Tue, Aug 31, 2010 at 01:42, John D <span dir="ltr"><<a href="mailto:john.dz.eis@gmail.com">john.dz.eis@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi all,<br> <br> I am using some vnl calls and the results when I use the Visual Studio 2008 Debugger is different from the results if I run the program at the command prompt. The iresults I get from the debugger seem to be the correct one.<br>
<br>I am trying to decompose an affine matrix into its components and here is the code:<br><br> //Compute the rotation angle and scaling from SVD of the matrix.<br> vnl_matrix<double> p(2, 2);<br> p[0][0] = (double) vOutputParameters[0];<br>
p[0][1] = (double) vOutputParameters[1];<br> p[1][0] = (double) vOutputParameters[2];<br> p[1][1] = (double) vOutputParameters[3];<br> vnl_svd<double> svd(p);<br> vnl_matrix<double> r(2, 2);<br>
<br> vnl_matrix<double> scalingDiag(2, 2);<br> scalingDiag[0][0] = svd.W(0);<br> scalingDiag[1][1] = svd.W(1);<br><br> vnl_matrix<double> scalingMat(2, 2);<br> scalingMat = svd.V()*scalingDiag*vnl_transpose(svd.V());<br>
<br> vnl_matrix<double> rotationMat(2,2);<br> rotationMat = svd.U()*vnl_transpose(svd.V());<br> double angle = -atan(rotationMat[0][1]/rotationMat[0][0]);<br> double sinAngle = sin(angle);<br>
<br> std::cout << " Lambda1 : = " << svd.W(0)<< std::endl;<br> std::cout << " Lambda2 : = " << svd.W(1)<< std::endl;<br> std::cout << " V : = " << svd.V()<< std::endl;<br>
std::cout << " U : = " << svd.U()<< std::endl;<br> <br> std::cout << " Scale 1 = " << scalingMat[0][0] << std::endl;<br>
std::cout << " Scale 2 = " << scalingMat[1][1] << std::endl;<br> std::cout << " Angle (degrees) = " << angle * 45.0 / atan(1.0) << std::endl;<br>
std::cout << " Skew X = " << scalingMat[0][1] << std::endl;<br> std::cout << " Skew Y = " << scalingMat[1][0] << std::endl;<br>
<br>scalingMat should be symmetric..which is the result I get from the debugger (The code is compiled as release and the debugger is running from the same directory which I use<br>to run from the commandline also)<br><br>
For ex:<br>[ 0.99307 0.00623954;<br> 0.00623954 0.996727];<br><br>However from the command prompt, I get the following:<br>[0.992893 0.810226;<br> -0.798249 0.996677];<br><br>Has anybody had problems like this before ? How can it be fixed?<br>
Thanks,<br><font color="#888888">John<br><br><br><br><br>
</font><br>_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br>