[Insight-users] incorrect matrix inverse

Julien Jomier jjomier at cs.unc.edu
Thu Nov 10 11:34:48 EST 2005


Hi Suyash,

I'm sorry but I cannot reproduce the problem you are reporting.
ITK is returning the same inverse matrix as Matlab.

Are you getting the matrix from a previous computation? if that is the 
case, maybe you are passing values in Matlab that are truncated and 
therefore the truncated matrix might be invertible...

Let us know,

Julien

Suyash P. Awate wrote:
> 
> Dear ITK-users,
> 
> I used the itk::matrix<double,3,3> class to compute the matrix inverse 
> (GetInverse()) for a 3x3 matrix and I got a warning followed by an 
> incorrect answer.
> 
> I found the correct inverse in matlab and checked that the condition 
> number of the matrix was 1.
> 
> So I am wondering why vnl would find this difficult. I also did not 
> understand the warnings very well. It would be great if someone shed 
> some light on this. Thank you so much.
> 
> Best regards,
> Suyash.
> 
> 
> matrix
>  0.99925   0.0371382 -0.0109982
> -0.0373772 0.99905   -0.0223916
>  0.0101562 0.0227859  0.999689
> 
> 
> warnings:
> InsightToolkit-2.2.0/Utilities/vxl/core/vnl/algo/vnl_svd.txx: suspicious 
> return value (2) from SVDC
> InsightToolkit-2.2.0/Utilities/vxl/core/vnl/algo/vnl_svd.txx: M is 3x3
> M = [ ...
>  0.9992500000000  0.0371382000000 -0.0109982000000
> -0.0373772000000  0.9990500000000 -0.0223916000000
>  0.0101562000000  0.0227859000000  0.9996890000000  ]
> 
> 
> matrix inverse using vnl in itk (incorrect)
> -0.982557 -0.0644525 -0.174434
> -0.0677511 0.997618   0.0130162
> -0.17318  -0.0246073  0.984583
> 
> 
> matrix inverse in matlab (correct)
>  0.9992   -0.0374    0.0102
>  0.0371    0.9991    0.0228
> -0.0110   -0.0224    0.9997
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users



More information about the Insight-users mailing list