Ask Your Question
0

Brisk - undefined reference

asked 2013-02-18 05:37:48 -0500

Hello all, I'm new here and this area (CV).

I'm learning and testing the extractors (mainly BRISK) but when I try compile the code I'm getting an error.

I'm using the instructions of authors (in Readme) and following their code to declare Brisk Detector like it:

cv::Ptr<cv::FeatureDetector> detector;
detector = new cv::BriskFeatureDetector(60, 4);

and I receive this error:

Scanning dependencies of target main [100%] Building CXX object CMakeFiles/main.dir/main.cpp.o Linking CXX executable main CMakeFiles/main.dir/main.cpp.o: In function main': main.cpp:(.text+0x178): undefined reference tocv::BriskFeatureDetector::BriskFeatureDetector(int, int)' collect2: ld returned 1 exit status make[2]: * [main] Erro 1 make[1]: * [CMakeFiles/main.dir/all] Erro 2 make: ** [all] Erro 2

I'm using CMAKE to create a Makefile, and make to compile it.

  • I've tested OpenCV, Brisk, Agast and it works (but not on my code)
  • I solved all problems with includes, the QT creator recognized all files and functios.

  • I have no idea what is happened.

The code that I'm following works perfectly on windows with Visual Studio + CMake (gui)

I'm using Ubuntu 12.04.01 LTS 64 bits

If someone can help... pls =D

Thank you guys!!!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-02-18 06:38:56 -0500

Guanta gravatar image

I can only guess that you are not linking correctly. But without knowing your Cmake-file it's kind hard. An example cmake-file (maybe the last line is missing?):

project(Test)
cmake_minimum_required(VERSION 2.8)

set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")

include_directories(${CMAKE_CURRENT_SOURCE_DIR})

find_package(Qt4 REQUIRED)
if(QT_FOUND)
include(${QT_USE_FILE})
add_definitions(${QT_DEFINITIONS})
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${QT_INCLUDE_DIR})
endif(QT_FOUND)

find_package( OpenCV REQUIRED )
if( OpenCV_FOUND )
list( APPEND ThirdParty_LIBS ${OpenCV_LIBS} )
    include_directories( ${OpenCV_INCLUDE_DIRS} )
endif( OpenCV_FOUND )

# c++11 support
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

set(${PROJECT_NAME}_SRC test.cpp mainwindow.cpp)
set(${PROJECT_NAME}_HDR test.h mainwindow.h)
set(${PROJECT_NAME}_FORMS mainwindow.ui)

QT4_WRAP_CPP(${PROJECT_NAME}_HDR_MOC ${${PROJECT_NAME}_HDR})
QT4_WRAP_UI(${PROJECT_NAME}_FORMS_HDR ${${PROJECT_NAME}_FORMS})

add_executable(${PROJECT_NAME} ${${PROJECT_NAME}_SRC} ${${PROJECT_NAME}_HDR_MOC} ${${PROJECT_NAME}_FORMS_HDR} )
target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBS})

Btw. shouldn't it be:

detector = cv::Ptr(new cv::BriskFeatureDetector(60,4))
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

Stats

Asked: 2013-02-18 05:37:48 -0500

Seen: 342 times

Last updated: Feb 18 '13