[vtkusers] ICP Error: vtkMath::Jacobi: Error extracting eigenfunctions
David Gobbi
david.gobbi at gmail.com
Tue Jan 31 09:16:24 EST 2012
Thanks, this info should be very useful for sorting out the problem.
- David
2012/1/31 Dženan Zukić <dzenanz at gmail.com>:
> I forgot to mention that this stems from using vtkLandmarkTransform.
>
>
> 2012/1/31 Dženan Zukić <dzenanz at gmail.com>
>>
>> This is the end of the command line (there are a lot of /I and /D options
>> before):
>> /D "_MBCS" /Gm- /EHsc /MD /GS /fp:precise /Zc:wchar_t /Zc:forScope /GR
>> /Fp"Spine.dir\Release\Spine.pch" /Fa"Release" /Fo"Spine.dir\Release\"
>> /Fd"D:/Repo/Spine/Release/Spine.pdb" /Gd /TP /errorReport:queue
>> There are also "Additional options": /Zm1000 /bigobj /bigobj
>>
>> But this alone does not cause the Jacobi warning. It happens with one poly
>> model I use.
>>
>> At the warning point, matrix "a" is usually full of NaNs:
>> -1.#QNAN -1.#QNAN -1.#QNAN -1.#QNAN
>> -1.#QNAN -1.#QNAN -1.#QNAN -1.#QNAN
>> -1.#QNAN -1.#QNAN -1.#QNAN -1.#QNAN
>> -1.#QNAN -1.#QNAN -1.#QNAN -1.#QNAN
>>
>> Here is one offending matrix:
>> -20.432407408240863 -6.916861332864527 4.552990997176626
>> 24.110079331569615
>> -6.916861332864527 -0.14227080645425705 -11.855738368063925
>> -17.76674202740249
>> 4.552990997176626 -11.855738368063925 12.501563019018828
>> 10.426774322765672
>> 24.110079331569615 -17.76674202740249 10.426774322765672
>> 8.0731151956762908
>>
>> Here is another:
>> -20.908967195946744 -7.4695433223552188 4.3289567952431929
>> 24.110079331569615
>> -7.4695433223552188 0.33428898125162654 -11.855738368063925
>> -17.990776229335921
>> 4.3289567952431929 -11.855738368063925 12.978122806724711
>> 10.979456312256364
>> 24.110079331569615 -17.990776229335921 10.979456312256364
>> 7.5965554079704081
>>
>> Also, the numbers are different each time I run my program, with all the
>> conditions being identical.
>>
>>
>> 2012/1/31 David Gobbi <david.gobbi at gmail.com>
>>>
>>> Thanks for the info. Can you post your compiler optimization flags to
>>> the list? There is definitely a problem with JacobiN that needs to be
>>> fixed. The fix should be very easy to do if we can get a matrix that
>>> reliably causes JacobiN to fail when certain optimization flags are
>>> used, so if either of you can print out such a matrix (with all
>>> numbers printed with a precision of 20 digits), it would be a big
>>> help.
>>>
>>> - David
>>>
>>>
>>> 2012/1/31 Dženan Zukić <dzenanz at gmail.com>:
>>> > I also saw this warning recently, from the block that "never gets
>>> > called".
>>> > And it only happened in release version of my program.
>>> >
>>> > On Tue, Jan 31, 2012 at 00:48, Maarten Beek <beekmaarten at yahoo.com>
>>> > wrote:
>>> >>
>>> >> Hi David,
>>> >>
>>> >> Ai, seems these crashes are hard to get rid off....
>>> >>
>>> >> I currently use VTK within Amira modules.
>>> >>
>>> >> I changed the type of vtkPoints from the default VTK_FLOAT to
>>> >> VTK_DOUBLE
>>> >> when I convert an Amira object to a VTK object. This reduces the
>>> >> occurrences
>>> >> of the errors, but doesn't solve the issue.
>>> >> (Ps: why is the default in vtkPoints still float, while everywhere
>>> >> else
>>> >> floats were changed into doubles a long while ago?)
>>> >>
>>> >> I don't really know much about different optimizations, so I just
>>> >> copy-paste what I found in MSVS:
>>> >>
>>> >> I build my VTK with:
>>> >> /O2 /Ob2 /FD /EHsc /MD /Fo"vtkCommon.dir\Release\\"
>>> >> /Fd"G:\vtk-5.6.0\build_vs90_noQt\bin\Release/vtkCommon.pdb" /W4
>>> >> /nologo /c
>>> >> /TP /errorReport:prompt/Zm 1000 and a couple of '/I'-s and '/D'-s
>>> >>
>>> >> I build my Amira modules with:
>>> >> /O2 /Ob1 /Oi /Oy /GF /FD /EHsc /MD /GS- /Gy /fp:fast /openmp
>>> >> /Fo"./../../obj/arch-Win64VC9-Optimize/GraphPackage/"
>>> >> /Fd"./../.././bin/arch-Win64VC9-Optimize/GraphPackage.pdb" /W3 /nologo
>>> >> /c
>>> >> /Zi /wd4068 /wd4305 /wd4018 /wd4244 /wd4800 /wd4275 /wd4251
>>> >> /errorReport:prompt and a couple of '/I'-s and '/D'-s
>>> >>
>>> >> I am working on getting vtkMath::JacobiN to print the matrix in the
>>> >> if-loop that 'gets never called' using vtkGenericWarningMacro to avoid
>>> >> having to include Amira stuff. Having a hard time getting that to
>>> >> work. (
>>> >> char* test = "hello";vtkGenericWarningMacro( test ); won't do the
>>> >> trick).
>>> >> Any suggestions?
>>> >>
>>> >> Maarten
>>> >>
>>> >> ________________________________
>>> >> From: David Gobbi <david.gobbi at gmail.com>
>>> >> To: Maarten Beek <beekmaarten at yahoo.com>
>>> >> Cc: VTK list <vtkusers at vtk.org>
>>> >> Sent: Monday, January 30, 2012 2:31:38 PM
>>> >> Subject: Re: [vtkusers] ICP Error: vtkMath::Jacobi: Error extracting
>>> >> eigenfunctions
>>> >>
>>> >> Hi Maarten,
>>> >>
>>> >> I think there are two issues here, one is that vtkLandmarkTransform
>>> >> should have a check as you have described, but another potentially
>>> >> serious issue is that, as far as I understand it, JacobiN should never
>>> >> fail. I did a google search and found a message from 2002 by the
>>> >> Numerical Recipes authors stating that the NR Jacobi code can become
>>> >> numerically unstable due to certain compiler optimizations. I'm
>>> >> guessing that certain compiler optimizations could similarly make the
>>> >> VTK Jacobi code become unstable.
>>> >> http://www.nr.com/forum/showthread.php?p=4913
>>> >>
>>> >> Can you provide info about your compiler/flags etc? Also, is it
>>> >> possible to get your code to print a matrix that causes JacobiN to
>>> >> fail?
>>> >>
>>> >> - David
>>> >>
>>> >>
>>> >> On Mon, Jan 30, 2012 at 9:44 AM, Maarten Beek <beekmaarten at yahoo.com>
>>> >> wrote:
>>> >> > Hi all,
>>> >> >
>>> >> > I get the following warning when using ICP:
>>> >> >
>>> >> > vtkMath::Jacobi: Error extracting eigenfunctions
>>> >> >
>>> >> > It comes from vtkMath::vtkJacobiN that calculates the eigenvalues,
>>> >> > -vectors
>>> >> > of a matrix.
>>> >> > The function returns 0, when this error occurs (otherwise 1), but
>>> >> > vtkLandmarkTransform doesn't check for the return value and thus
>>> >> > uses
>>> >> > undefined values for the eigenvalues, -vectors.
>>> >> > This means my point set becomes invalid.
>>> >> > I believe the way to avoid this error is to 'giggle' the coordinates
>>> >> > a
>>> >> > little when it happens, but how can I intervene when
>>> >> > vtkLandmarkTransform
>>> >> > stubbornly uses whatever values it gets from vtkMath::vtkJacobiN?
>>> >> > Is there a way to intercept the error message?
>>> >> >
>>> >> > I also noticed that if I apply ICP on A and B1 resulting in the
>>> >> > error
>>> >> > message, applying ICP on A and B2 (loading the same data file that
>>> >> > gives
>>> >> > me
>>> >> > B1) works fine. I don't see vtkMath::vtkJacobiN using a random
>>> >> > number or
>>> >> > doing something similar, which makes me believe the error message I
>>> >> > get
>>> >> > is
>>> >> > due to floating point accuracy? Even more a reason to think that
>>> >> > 'giggling'
>>> >> > might work (if I were able to intervene before the invalid transform
>>> >> > is
>>> >> > applied to my data...)
>>> >> >
>>> >> > Thanks - Maarten
>>
>>
>
More information about the vtkusers
mailing list