Re: [eigen] Geometry module - Quaternion fitting alternative |

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]

*To*: eigen@xxxxxxxxxxxxxxxxxxx*Subject*: Re: [eigen] Geometry module - Quaternion fitting alternative*From*: Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>*Date*: Tue, 26 May 2009 09:07:44 +0200*Dkim-signature*: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=/NqMnOHcM1iE6XGbLz9UrYk1uMfGTi8Ffbh2LVC0k+0=; b=bBqibNcmE0XdkLqWvPnrYoR7QuKp9owcxaGsjilhTzDgMNf+RUAf5felyho+wqRYUj w7FZ6CvUp8g6ziNK0Ue4xb3GiTYk+VIMAC22cwO8fGxDfn2EjXHir41bbaxIXF7fE0Kr kj/c7/dCzsyg2bC7S9o4zSmQcaoV7WuXQ/nb4=*Domainkey-signature*: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=rgCqyDHolwmROi0KBzJXg8KRZzd3Aja/o/hvDI0JoL8NqNXF1IM6o8i6zGsUH1iOMd uiS4Ys//OmnLcGhW4l6EIrc+YWcomlXa3ZCPk0zHxJnNhkgCkF+dG7LX2XneqtJjjbse h8aLyZ0SVuS+j3U3bh5aBRWebm4XKWIuBfunA=

Thank you for the detailed review. The points covered by your review: - KDE comment is gone - RealScalar has been introduced for the statistics normalization - Code is bound to identical floating point types, i.e. all casts are gone - Introduced squaredNorm instead of dot() - Introduced ei_isMuchSmallerThan for the rank computation - Introduced coef instead of operator() Additional changes: - Added missing preproc guard against multiple includes - Changed the expression/template helper names to be Eigen conform ei_... - Added a specialized version for complex numbers that does nothing but issue a compile time error when using it - Added doxygen guard for the template helpers in the anonymous namespace - Added doxygen guard for the complex specialization - Improved the return type deduction - it should now return minimal sized transformations - Improved to docs (added ingroup stuff) - Modified doc/Doxyfile.in to support the amsmath package - Added fixed size tests to the unit test The modified doxygen stuff allows to use latex environments like 'align' and adds support for matrix, bmatrix, etc. environments. The attached screenshot shows the docs. > + for (int i=0; i<n; ++i) > + { > + src_mean += src.col(i).cast<Scalar>(); > + dst_mean += dst.col(i).cast<Scalar>(); > + } > > OK, this is a rowwise().sum() but you didn't want to #include Array > just for that, right? makes sense. Here it would be interesting to know, just performance wise, whether looping twice over the data yields better performance than doing it just once. It probably depends if the vectorization can process four scalars at once or just two. > + for (int i=0; i<n; ++i) > + { > + src_demean.col(i) = src.col(i).cast<Scalar>() - src_mean; > + dst_demean.col(i) = dst.col(i).cast<Scalar>() - dst_mean; > + } > again i understand that you prefer to avoid including Array. You can really do this with colwise? This is a vector valued operation not scalar valued - I thought colwise only supports scalar valued operations. By the way, did you realize that I did not add the file to the unsupported directory but dared to put it right into the Geometry module? Is that ok as is? Also, just out of curiosity, is dot() slower than squaredNorm(). My assumption was that it should vectorize as well as squaredNorm() does. Regarding the complex support I tried to make the two helper methods from the unit test generic in the sense that they can now create random matrices belonging to U(n) and SU(n) but the actual algorithm has a few lines left for which I am unsure on how to handle the complex case. Also, since I do not fully understand what this type of transformation means in the complex domain I think I am not the right person to adapt the code. Currently, the usage of complex matrices will result in a compile time assert. In case you or anybody else wants to check the code once more from an existing repository you need to do: hg qpop -a // unapply all patches cd .hg/patches hg pull // retrieve the new patches cd ../.. hg qpush -a // reapply the updated patches In case it is a fresh checkout just do: hg qclone https://hauke@xxxxxxxxxxxxx/hauke/umeyama-integration/ eigen_umeyama cd eigen_umeyama hg qpush -a Cheers, Hauke

**Attachment:
umeyama_docs.jpg**

**Follow-Ups**:**Re: [eigen] Geometry module - Quaternion fitting alternative***From:*Benoit Jacob

**References**:**Re: [eigen] Geometry module - Quaternion fitting alternative***From:*Hauke Heibel

**Re: [eigen] Geometry module - Quaternion fitting alternative***From:*Benoit Jacob

**Messages sorted by:**[ date | thread ]- Prev by Date:
**Re: [eigen] Migration to mercurial done** - Next by Date:
**Re: [eigen] Geometry module - Quaternion fitting alternative** - Previous by thread:
**Re: [eigen] Geometry module - Quaternion fitting alternative** - Next by thread:
**Re: [eigen] Geometry module - Quaternion fitting alternative**

Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |