- Clion的安装此处省略
- Toolchains 配置
点击左上角 "File" ->>> "Settings" ->>> "Toolchains" 如下图所示,这里我的cmake的版本是3.5
- CMakeLists.txt 配置
cmake_minimum_required(VERSION 3.5) project(SIFT) set(CMAKE_CXX_STANDARD 11) add_executable(SIFT main.cpp) find_package(OpenCV REQUIRED) target_link_libraries(SIFT ${OpenCV_LIBS})
-
源码
// main.cpp #include <opencv2/opencv.hpp> #include <opencv2/xfeatures2d.hpp> using namespace std; using namespace cv; using namespace cv::xfeatures2d; int main(int argc, char **argv) { Mat objImage = imread("/home