Opencv SURF

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Opencv SURF

daniels
This post was updated on .
Hello Matlabbe,

first thanks for all you works, i appreciate it.

Although this is a subject that has responded previously, still can not run properly this problem. I mean the use of opencv in find_object and rtabmap. (nonfree)

I followed the instructions of your page, as well as other sources.
- http://docs.opencv.org/2.4/doc/tutorials/introduction/linux_install/linux_install.html#building-opencv-from-source-using-cmake-using-the-command-line

what I did was
- unzip 2.4.11 in opencv folder previously created with nothing in it.
-cd ~/opencv
-mkdir release
-cd release
-cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..

-make (in release folder: cd ~/opencv/release)
-sudo make install (in release folder: cd ~/opencv/release)
 (x5 installation attempts)

extra step, from other source.
- sudo gedit /etc/ld.so.conf.d/opencv.conf
  - /usr/local/lib
- sudo ldconfig -v
- sudo gedit /etc/bash.bashrc
  - add PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
           export PKG_CONFIG_PATH

and i saw the post created related to this problem:
https://github.com/introlab/find-object/issues/22
http://official-rtab-map-forum.206.s1.nabble.com/Opencv-on-RTABMAP-td1369.html#a1372
http://official-rtab-map-forum.206.s1.nabble.com/compiler-error-about-opencv-td781.html

I am relatively new to ROS and Linux. I have seen other sites where to install opencv from source and yet I can not run properly this part. ireally did not want to make a new topic about this but no longer know what else to do or what I'm doing wrong. if you could  guided me in a way more explicit would be really grateful

rtab and find_object are installed from source, both in the same folder with catkin according to the steps of your page. They work perfectly except when I run simultaneously, but this is another topic

should modify some cpp file in find_object and rtabmap ??

sorry for the repeat topic, really.
thank for all
I am using a traductor, soo... xd
Daniel-
Reply | Threaded
Open this post in threaded view
|

Re: Opencv SURF

matlabbe
Administrator
Hi Daniel,

I usually install OpenCV from source using these commands:
Extract opencv somewhere (~/opencv)
$ cd ~/opencv
$ mkdir build
$ cd build
$ cmake -DCMAKE_BUILD_TYPE=Release ..
$ make
After 100% successfully built:
$ sudo make install
By default OpenCV is installed in ~/usr/local

Then go back to rtabmap source, erase everything in build then re-cmake/make/install again. Erasing everything in build make sure that previous build cache (where the previously OpenCV info is kept) is removed. When you do "cmake .." in rtabmap library, you would see at the status if OpenCV is built with nonfree or not. At this point, if opencv in /usr/local is correctly detected, you should see that it will build with nonfree support.

If OpenCV in /usr/local is still not detected. Remove the CMakeCache.txt of the build directory, then use this command (point out the folder in where OpenCVConfig.cmake is installed):
$ cd rtabmap/build
$ cmake -DOpenCV_DIR=/usr/local/share/OpenCV ..
$ make
$ sudo make install

For catkin packages (rtabmap_ros and find_object), do the same thing: erase ~/catkin_ws/build directory, then catkin_make again.

cheers
Reply | Threaded
Open this post in threaded view
|

Re: Opencv SURF

daniels
This post was updated on .
Thanks Mat,

i reinstall again opencv, with the steps for rtabslam standalone. think dont work well and I'm trying again. But nonfree version is being recognized, without being able to select the SURF choice in the GUI.



The find_object finally works whit SURF and SIFT doing catkin_make whit both, but do not know if the rtabslam_ros version works. adding the following commands to rgbd_mapping.launch attempt to calibrate this option.

       param name="Kp/DetectorStrategy" type="string" value="0"
       param name = "SURF / HessianThreshold" type = "string" value = "600"
       param name = "Vis / MaxDepth" type = "string" value = "12"
       param name = "Vis / MinInliers" type = "string" value = "10"
       param name = "Vis / InlierDistance" type = "string" value = "0.05"

the "Vis" line sends an error.

there any way to ensure that the ros_version is using SURF??. according to what I read from you on another thread, without setting ros_version works with ORB as find_object and standalone.

thanks, I really appreciate your help.

new attempt:  

[ WARN] (2016-07-16 23:01:18.227) Features2d.cpp:425::create() SURF/SIFT features cannot be used because OpenCV was not built with nonfree module. ORB is used instead.

manually remove the build folder in both cases (ros and standalone), as the file CMakeCache.txt whit the extra step
$ cd rtabmap/build
$ cmake ..  [<---double dots included]
$ make -j4
$ sudo make install
I assume that as find_objects is recognizing the function, the problem must be in the standalone version.

Reply | Threaded
Open this post in threaded view
|

Re: Opencv SURF

matlabbe
Administrator
Hi,

Where rtabmap is installed ($make install)? If CMake tells that rtabmap is built with nonfree, the option should be available in the GUI after the build. You can start rtabmap ("./rtabmap") from the "rtabmap/bin" directory to make sure you are testing the right one. Don't forget to "$make install" to overwrite the previously installed rtabmap libraries (which could be in /usr/local/lib/x86_64-linux-gnu or ~/catkin_ws/devel/lib/x86_64-linux-gnu depending where you installed them).

The parameters should be defined without spaces:
Do:
<param name="Vis/MaxDepth" type="string" value="12"/> 
instead of:
<param name = "Vis / MaxDepth" type = "string" value = "12"/> 

cheers
Reply | Threaded
Open this post in threaded view
|

Re: Opencv SURF

daniels
hello,

i install whit this step, the first time. (if that's what you mean(?))
$ cd ~
$ git clone https://github.com/introlab/rtabmap.git rtabmap
$ cd rtabmap/build
$ cmake ..
$ make -j4
$ sudo make install

-----

the vis "problem" It was for skip the first line calling the surf command

thanks,saludos
Reply | Threaded
Open this post in threaded view
|

Re: Opencv SURF

matlabbe
Administrator
Is in rtabmap standalone the SURF option still gray out?
$ rtabmap

Make sure you don't have the rtabmap binaries installed at the same time too:
$ sudo apt-get remove ros-indigo-rtabmap
Reply | Threaded
Open this post in threaded view
|

Re: Opencv SURF

daniels
yes, is still gray; SURF and SIFT.

the rtabmap/build folder is remove manually?? or i need to doit whit some command??.

if I'm not mistaken rtabmap files in ~ / usr / .. rtabmap. must be updated with cmake. Perhaps the problem comes from there and need a complete installation again??

thanks mat.
Reply | Threaded
Open this post in threaded view
|

Re: Opencv SURF

matlabbe
Administrator
Hi,

You can do "$ which rtabmap" to know which rtabmap you are starting. Make sure that when doing "$ make install", the copied app is overwritting the one of "$ which rtabmap".
Reply | Threaded
Open this post in threaded view
|

Re: Opencv SURF

daniels
This post was updated on .
the command give:

/home/pablo/rtabslam_ws/devel/bin/rtabmap

rtabslam_ws is the catkin workspace whit find_object too

sadly not recognize me GTSAM neither..
Reply | Threaded
Open this post in threaded view
|

Re: Opencv SURF

daniels
whenever a complement is installed as gtsam or g20 . should do the above steps whit build in order to function correctly ??
sorry if is a noob question.
thanks.
Reply | Threaded
Open this post in threaded view
|

Re: Opencv SURF

daniels
In reply to this post by daniels
whenever a complement is installed as gtsam or g20 . should do the above steps whit build in order to function correctly ??
sorry if is a noob question.
thanks.