krm104 / SPAAM_BaseCode

Base code for performing the basic mathematical operations of a Single Point Active Alignment Method (SPAAM) calibration.
8 stars 2 forks source link

Compile Code #2

Open AnnMii opened 7 years ago

AnnMii commented 7 years ago

Hi,

I downloaded your code, downloaded the BOOST library (version 1.63.0, http://www.boost.org/users/history/version_1_63_0.html, Windows zip file), extract it to C:\BOOST and included it into Visual Studio, as you described in your “Project Setup” section. Now I got the error message, that the “ublas_matrix.hpp” and “gesvd.hpp” files can’t be found. I searched for them in my BOOST folder and they are not there. With witch version of the boost library do you compile?

include <boost/numeric/bindings/traits/ublas_matrix.hpp>

include <boost/numeric/bindings/lapack/gesvd.hpp>

Thanks!

krm104 commented 7 years ago

Hello,

Thank you for your interest in the SPAAM Base Code. I apologize for the late reply. The files you're missing will be in the LAPACK (Linear Algebra Package) add-on library , for boost that you will need to acquire in addition to Boost. The SVD and DLT operations in the source code use the LAPACK implementations. Fell free, though, to replace those dependencies/implementations with another version (like Eigen perhaps), if you want to.

Kenneth Moser (PhD) Core Engineering Marxent Labs LLC http://www.marxentlabs.com krm104@gmail.com

On Fri, Feb 17, 2017 at 5:48 AM, AnnMii notifications@github.com wrote:

Hi,

I downloaded your code, downloaded the BOOST library (version 1.63.0, http://www.boost.org/users/history/version_1_63_0.html, Windows zip file), extract it to C:\BOOST and included it into Visual Studio, as you described in your “Project Setup” section. Now I got the error message, that the “ublas_matrix.hpp” and “gesvd.hpp” files can’t be found. I searched for them in my BOOST folder and they are not there. With witch version of the boost library do you compile?

include <boost/numeric/bindings/traits/ublas_matrix.hpp>

include <boost/numeric/bindings/lapack/gesvd.hpp>

Thanks!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/krm104/SPAAM_BaseCode/issues/2, or mute the thread https://github.com/notifications/unsubscribe-auth/ALQVPFmHEl37ByiY7Nikzpb8PDc-SBGnks5rdXr5gaJpZM4MEIEh .

AnnMii commented 7 years ago

Thanks for your reply.

I managed already the include problem but I still can't compile because there is some linker problem with the gesvd() function. If I command it out it compiles (and runs ... without gesvd) but if it isn’t command out I got the error “error lnk2001 unresolved external symbol "dgesvd". Is there something special with it? In addition, I have some further questions regarding your code. Could you please help with that? While comparing your code to the “SPAAM” paper (http://cs.iupui.edu/~tuceryan/research/AR/ISAR2000_SPAAM.pdf) I discovered some differences:

In the SPAAM paper they are using world coordinates (3D), camera coordinates (3D), image coordinates (2D) as well as screen coordinates (2D). If I understand the paper correctly, their goal is to calculate the rigid transformation between camera coordinates (3D) and screen coordinates (2D) as that is the only transformation that is missing. In order to do so they are displaying a cross in the screen and are aligning it with the known point in the world (at least 6 times). Now they measure the known world point in the camera image and transform the point from the world to the camera coordinate system (3D). In your code, you are using 3D world coordinates and 2D screen coordinates to calculate the transformation.

• Could you please explain why you are using world and screen coordinates instead of camera and image coordinates? • What can be transformed with your matrix? Points from which to which coordinate system are you transferring? I am very much looking forward to receive your reply!

krm104 commented 7 years ago

If you're getting a linking error, unresolved external symbol, then you need to make sure you're linking against the .lib and that the library paths in your project contains the path to the .lib. The libs included with the git repository are: libblas.lib and liblapack.lib

These need to be linked against to compile. If you downloaded a newer/different version of the LAPACK libraries you'll need to make sure those new/different .lib's are being linked against in your project.

In reference to your other inquiries:

1) You're absolutely correct that SPAAM is intended to find the transformation relation between a set of 2D image points and 3D "Head Relative" points. I say head relative, since tracking doesn't have to actually be done with a camera. In our lab, at the time, we were using an ART optical tracker for tracking. I believe I just used poorly worded comments in the code. When I say 3D world point, I mean a 3D point whose x, y, z, location is relative to the screen's coordinate system, not the actual x, y, z coordinate from the global world system.

2) The resulting matrix you want from SPAAM is the perspective projection matrix (3x4 or 4x4 if you converted it for use with openGL). This matrix is used to transform 3D points, from the head relative coordinate frame, into 2D points on the screen. This is the projection matrix used by the rendering pipeline.

So, for both answers, you did indeed correctly understand the paper. The 3D points are relative to the HMD screen/camera coordinate system, not the global world coordinate system, and the projection matrix transforms 3D points in that same relative coordinate system to 2D points on the rendered image.

I hope this clarifies things a bit more,

Kenneth Moser (PhD) Core Engineering Marxent Labs LLC http://www.marxentlabs.com krm104@gmail.com

On Tue, Feb 21, 2017 at 12:32 PM, AnnMii notifications@github.com wrote:

Thanks for your reply.

I managed already the include problem but I still can't compile because there is some linker problem with the gesvd() function. If I command it out it compiles (and runs ... without gesvd) but if it isn’t command out I got the error “error lnk2001 unresolved external symbol "dgesvd". Is there something special with it? In addition, I have some further questions regarding your code. Could you please help with that? While comparing your code to the “SPAAM” paper (http://cs.iupui.edu/~ tuceryan/research/AR/ISAR2000_SPAAM.pdf) I discovered some differences:

In the SPAAM paper they are using world coordinates (3D), camera coordinates (3D), image coordinates (2D) as well as screen coordinates (2D). If I understand the paper correctly, their goal is to calculate the rigid transformation between camera coordinates (3D) and screen coordinates (2D) as that is the only transformation that is missing. In order to do so they are displaying a cross in the screen and are aligning it with the known point in the world (at least 6 times). Now they measure the known world point in the camera image and transform the point from the world to the camera coordinate system (3D). In your code, you are using 3D world coordinates and 2D screen coordinates to calculate the transformation.

• Could you please explain why you are using world and screen coordinates instead of camera and image coordinates? • What can be transformed with your matrix? Points from which to which coordinate system are you transferring? I am very much looking forward to receive your reply!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/krm104/SPAAM_BaseCode/issues/2#issuecomment-281416538, or mute the thread https://github.com/notifications/unsubscribe-auth/ALQVPHRHP-utLPp32RdF2tEdhAad3e3Uks5rex-jgaJpZM4MEIEh .