Tuesday, September 24, 2013

Trouble Running ReconstructMeQt on Laptops and Multiple GPU Machines


When ReconstructMeQT just hangs or won't start, this info may save you a few days of trouble.

ReconstructMeQT may not choose the correct computation device if left to “AUTO: Autoselect best calculation device”  for multi-graphic card machines (such as laptops).

The Alienware laptop I used with a PrimeSense or Asus Xtion Pro Live sensor plugged in during startup of ReconstructMeQT would cause the system to hang and ReconstructMe would have to be manually closed (i.e. through Task Manager).  The system was auto-selecting the low-end built-in graphics card that is useful for power savings, but was insufficient to run ReconstructMeQT. 

Discovering that that was the problem took time with multiple diagnostics.  The NVIDIA drivers were up-to-date, the 32-bit OpenNI drivers installed, the 32-bit camera drivers were there, and basic camera tests worked, and ReconstructMe were all installed.   

To work around this problem:
  1. Unplug any sensors you have for ReconstructMe.  
  2. Close and re-open up ReconstructMeQT (without sensors).  It should start up.  If not, then there's another issue non-related to this post.
  3. Go to the settings: File->Settings
  4. Choose the best “Computation Device” (GPU) listed there.  "Best" can be determined using the Reconstruct Me System Requirements and the GPU Compatibility Matrix 
  5. Before clicking “OK,” plug in the sensor.
  6. Choose “OK” and the re-initialization process is completed.  You will know immediately if your sensor is working under the Computation Device you chose.  Possible total re-start of ReconstructMe may be desired
  • Alienware Laptop M14XR2
  • Processors : Intel i7-3630QM @ 2.40 GHz
  • Installed RAM: 8GB Dual Channel DDR3 SDRAM at 1600MHz
  • 64-bit Windows 7 Professional, SP1
  • Graphics Card: 1 GB GDDR5 NVIDIA GeForce GT 650M with Optimus

Monday, September 23, 2013

Occipital's Structure Sensor Kickstarter Campaign

Occipital's Structure Sensor looks really amazing and makes me want to get an iPad to support it!
Check out Occipital's website, and from there you can link to their Kickstarter video that is really impressive.  Even PrimeSense has a news release about Occipital's campaign.



10/22: Only 9 days left on this Kickstarter:

Thursday, September 12, 2013

ReconstructMe 2.0 - Sept. 16 Release Date

Good news - while I didn't see the Beta Tester registration until after it was closed, ReconstructMe 2.0 should be releasing releasing on Monday the 16th of September to the public.

Looking forward to working with this and hoping it gets translated into the SDK as soon as possible!

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.


Tuesday, September 3, 2013

Int to String Conversions in C++

Working within the ReconstructMe C++ domain, there is a lot of C-style string usage.  This is frustrating to mix with C++ strings for easier search and concatenation style for filename outputs such as a series of filenames

file1.obj
file2.obj
...
fileN.obj

Since there is a mix of C-style and C++ strings, I wanted to share this since the conversion from int to string isn't as straight-forward as I became used to under Python. It's based on another posting: http://forums.codeguru.com/showthread.php?359716-convert-integer-to-string-in-c.

The gist of the post is that the stringstream class is needed.  Using the "<<" operator, the disparate types can be concatenated neatly into a string stream, into a string, and then when needed to be passed to a char* function (here puts as an example)

       int filenum = 1;
       ss << fname << filenum++;
       std::string tempFname = ss.str();
       puts("Saving File to");
       puts(tempFname.c_str());


Due to the nature of the input, we ended up extending it into a function that parses for the first dot "." character to separate extension from base file name.
 
Since the file name will be coming in via the command line input, the outputFileName function uses argc and argv.  While it's a bit of extra work since it's re-processing the full file name each time it is called, it's used a small number of times and a quick function with reasonable file name sizes.

std::string outputFileName(int argc, char* argv[], int &fnum)
{   
    std::string fname;
    std::string name = fname= "test.obj";
   
    if(argc > 1)
        fname = argv[1];

    std::string extension = "";
    std::string basename = "";
    bool reachedDot = false;
    for(unsigned int i = 0; i < fname.length(); i++)
    {
        if(reachedDot)
            extension += fname[i];

        if(fname[i] == '.')
            reachedDot = true;

        if(!reachedDot) // do it this way to avoid "." inclusion
            basename += fname[i];
    }

    std::stringstream ss;   
    ss<< basename << fnum++ << "." << extension;
    name = ss.str();
    return name;

}


ReconstructMe SDK - color textures from the RGB camera on the horizon

I have been working with the ReconstructMe SDK and QT application for a few months now.  I can see some very powerful applications and usages.  ReconstructMe is available for download at http://reconstructme.net/.

There is a powerful new extension on the horizon for ReconstructMe - the addition of color mapping.  This would be a great and needed addition for extending the usability and application domain. I'm looking forward to working and using this addition as soon as I can get my hands on it.

ReconstructMe SDK - Colorize Example.ply (click to view in 3D)


ReconstructMe SDK - Colorize Example.ply