Add OpenCV test2

This commit is contained in:
daleclack 2022-07-14 20:29:28 +08:00
parent 270d43226b
commit 97282680c9
3 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,3 @@
{
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools"
}

View File

@ -0,0 +1,18 @@
cmake_minimum_required(VERSION 3.0.0)
project(OpenCV_test2 VERSION 1.0.0)
#Find the opencv package
find_package(OpenCV REQUIRED)
#include directories for opencv
include_directories(${OpenCV_INCLUDE_DIRS})
add_executable(${PROJECT_NAME} main.cpp)
#Add command to generate .gitignore
add_custom_command(TARGET ${PROJECT_NAME}
COMMAND echo \"*\" > ${CMAKE_BINARY_DIR}/.gitignore
COMMAND echo \"**/*\" > ${CMAKE_BINARY_DIR}/.hgignore)
#Add OpenCV Libraries
target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBS})

View File

@ -0,0 +1,10 @@
#include <opencv2/opencv.hpp>
#include <iostream>
#include <fstream>
using namespace cv;
int main(int argc, char ** argv){
std::fstream infile;
Mat image;
}