Wednesday, September 4, 2013

Setting up a ReconstructMe Project in Visual Studio 2010

*Assumes that ReconstructMe SDK has been downloaded and installed with correct supporting drivers for the camera of your choice (Kinnect, Asus, PrimeSense).  The Graphics Card Compatibility Matrix is helpful if choosing new hardware or troubleshooting problems with existing hardware installations.

The ReconstructMe team has done their development using Microsoft Visual Studio (MS VS) 2010.  To ensure correction functionality, I downloaded the MS VS 2010 Express for C++.  A free registration is required after 30 days of use.

A key is that the the current version of ReconstructMe Qt and ReconstructMe SDK requires 32-bit software for the camera drivers and support software.

Update to Service Pack 1 for Visual Studio.  Otherwise, you can get a linking error ">LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt" and your projects may not link.  Once you do the SP1 update, you won't need to set Incremental Linking option equal to no for compilation.

Once MS VS 2010 Express for C++ is setup, the next part is actually getting a project up and running.

Some notes to help out with the process are as follows:

Steps to create a new project for ReconstuctMe
  1. Open Visual Studio 2010
  2. Create Win32 Console App - give the project a nam
    1. I prefer to uncheck "Create directory for solution" on the Project Wizard
    2. Click on "OK" 
    3. Click on "Next"
    4. Check for "Console application" radio button selected
    5. I also prefer an empty project since.  This is done by checking "Empty Project"
    6. Click on "Finish" - You've now created the Project Solution and are dumped into the SDK
  3. Add / create a C++ file (.h, .cpp, .hpp) to get access to the C++ Project Properties.  One option is to copy the code and test out the One Minute Example.  One methodology is to right click on "Source Files" in the Solution Explorer -> Add -> New Item -> choose to add .cpp or .h and give it a name.
  4. To get into the Project Properties, you can go through the menu options: 
    • Project > ProjName Properties
    • Keyboard shortcut ALT + F7
    • Right click on the project name under the Solution Explorer and Click on Properties at the bottom of the pop-up menu.
      Once there, open the "Configuration Properties" if it is not already open.
  5. Set the include and library directories.  This will only work if the environmental properties in the system path are set.  The REME_ROOT_DIRECTORY must exist in your path (MS XP+ support page) and this setup page from ReconstuctMe SDK.
    1. Under Configuration Properties -> VC++ Directories
          -> Include Directories += $(REME_ROOT_DIRECTORY)\inc
          -> Library Directories += $(REME_ROOT_DIRECTORY)\lib
    2. If using the Boost library, and having $BOOST_ROOT set in your system path, the include directories should be set to this or whatever your Boost directory looks like:
         -> Include Directories += $(REME_ROOT_DIRECTORY)\inc;$(BOOST_ROOT)
          -> Library Directories += $(REME_ROOT_DIRECTORY)\lib;$(BOOST_ROOT)\stage\lib

      Note: Here $(REME_ROOT_DIRECTORY) = C:\Program Files (x86)\Profactor\ReconstructMeSDK\1.5.795 and $(BOOST_ROOT) = C:\Program Files\boost\boost_1_54_0
  6. Update the Library dependency for the LibReconstructMeSDK.lib and if no SP1 is installed, be sure to disable incremental linking.
       -> Configuration Properties
           -> Linker (Input)
              -> Additional Dependencies -> LibReconstructMeSDK.lib
          -> Linker (General)
              -> Enable Incremental Linking -> "No (/INCREMENTAL:NO)"
  7. If you aren't using the One Minute Example, you will need to include the correct and appropriate libraries.  One for reconstruct me will always be  #include <reconstructmesdk/reme.h>, if using boost threads then you will need #include <boost/thread.hpp> and #include <boost/bind.hpp>.
That should be enough to get you started with the One Minute Example from ReconstructMe. If you have your own experiences to share, please add comments.


1 comment: