Apr 6, 2016

3D Hough Transform based plane detection

 PRE-REQUISITE INSTALLATION:
-------------------------------------------------------
The only libraries required to be installed for
this program is vtk(visualization toolkit).
1. download the vtk
2. unzip
3. cd ROOT_VTK_DIR
   mkdir build
   cd build
   cmake ..
   sudo make
   sudo make install



COMPILE:
-----------------
compile the program 'VTKHoughPlanes-master'

1. mkdir build
2. cd build
3. cmake ..
4. make

=========================================================================This version is fixed to work on ubuntu-12.04. however on the way to build
and compile the program, several issues were raised.
1. globals.icc file inside the include/slam6d complaining about the 'sqr()'
function. it was fixed by copy pasting the following template at the top
of the file body

template
static inline T sqr(const T &x)
{
  return x*x;
}

2. if cmake .. does not work in your compiler then try
cmake .. -DCMAKE_CXX_FLAGS="-std=c++0x"


3. when the code was downloaded from another repository and installation gave me

$ cannot find -lvtkHybrid
solution:

you need to show the CMakeLists.txt file the path where the vktHybrid.so is compiled.

i) FIND_PACKAGE(VTK REQUIRED)
    INCLUDE(${VTK_USE_FILE})

ii) if(VTK_LIBRARIES) # should be defined for later versions of VTK 5.x/above
        target_link_libraries(scan_io_vtp ${VTK_LIBRARIES})
    else()
        target_link_libraries(scan_io_vtp vtkHybrid vtklibxml2 vtkIO)
    endif()

 =========================================================================


COMPUTE PLANES:
----------------------------------
1. cd build/src/
2. ./HoughPlanes ../../data/counter_input.vtp ../../data/counter_out.vtp

this will create color coded planes in the 'counter_out.vtp' file.


VISUALIZE THE PLANES:
--------------------------------------------
utilize the Visualize program to visualize the detected planes

1. cd VisualizeVTP
2. cmake -DVTK_DIR:PATH=/home/me/vtk_build ..
(NB: if vtk is not installed but compiled in the computer at location
/home/me/vtk_build)
3. make
4. visualize the detected planes 'counter_out.vtp'
./VisualizeVTP ../counter_out.vtp


Reference code

No comments:

Carlo Cipolla's Laws of Stupidity

    "By creating a graph of Cipolla's two factors, we obtain four groups of people. Helpless people contribute to society but are...