Ask Your Question
0

Help with Feature Detection tutorials [closed]

asked 2020-03-05 11:40:09 -0600

Aquas gravatar image

Hello! I have a project in which I need to use Ubuntu 14 with ROS Indigo. ROS Indigo includes OpenCV 2.4 so I'm using that version in order to avoid possible compatibility problems when connecting them. As I need to implement Feature Detection functions, I read that I could use OpenCV. The problem is that as I'm new in this field, I don't know what libraries/packages I need to add in order to compile code with, for example, these functions; https://docs.opencv.org/2.4/modules/f...

I've also seen the tutorial: https://docs.opencv.org/master/d9/d97... But I also have the problem: not knowing how to make de CMakeLists.txt file to compile it.

Thank you very much for your help!

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Aquas
close date 2020-04-02 01:16:30.875423

1 answer

Sort by ยป oldest newest most voted
0

answered 2020-03-11 10:42:44 -0600

Aquas gravatar image

I have finally found a solution for compiling with a CMakeLists.txt file while using opencv2.4 installed through ROS. You just have to write: (Text that is not bold are just comments )

cmake needs this line cmake_minimum_required(VERSION 2.8)

Define project name
project(Pruebas_alg)

Find OpenCV, you may need to set OpenCV_DIR variable to the absolute path to the directory containing OpenCVConfig.cmake file via the command line or GUI find_package(OpenCV REQUIRED)

If the package has been found, several variables will be set, you can find the full list with descriptions in the OpenCVConfig.cmake file. Print some message showing some of them
message(STATUS "OpenCV library status:") message(STATUS " config: ${OpenCV_DIR}") message(STATUS " version: ${OpenCV_VERSION}") message(STATUS " libraries: ${OpenCV_LIBS}") message(STATUS " include path: ${OpenCV_INCLUDE_DIRS}")

include_directories(${OpenCV_INCLUDE_DIRS})

Declare the executable target built from your sources
add_executable(FAST_implementation Fast_alg.cpp) add_executable(ORB_implementation orb_alg.cpp) add_executable(BRISK_implementation brisk_alg.cpp) add_executable(BRISK_Match Matcher_BRISK.cpp) add_executable(ORB_Match Matcher_ORB.cpp) add_executable(Executable_name script.cpp)

Link your application with OpenCV libraries
target_link_libraries(FAST_implementation PRIVATE ${OpenCV_LIBS}) target_link_libraries(ORB_implementation PRIVATE ${OpenCV_LIBS}) target_link_libraries(BRISK_implementation PRIVATE ${OpenCV_LIBS}) target_link_libraries(BRISK_Match PRIVATE ${OpenCV_LIBS}) target_link_libraries(ORB_Match PRIVATE ${OpenCV_LIBS}) target_link_libraries(Executable_name PRIVATE ${OpenCV_LIBS})

I have not been able to add SURF program, so I have opted for installing OpenCV 3.4 (no need to upgrade CMake) and so it looks like it works. No trouble (at least yet) with ROS or Gazebo.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-03-05 11:40:09 -0600

Seen: 309 times

Last updated: Mar 11 '20