diff --git a/ccv/sheet1/CMakeLists.txt b/ccv/sheet1/CMakeLists.txt index fa2d69a..7fcbb45 100644 --- a/ccv/sheet1/CMakeLists.txt +++ b/ccv/sheet1/CMakeLists.txt @@ -1,7 +1,5 @@ -cmake_minimum_required(VERSION 2.8) -add_library(Rectangle Rectangle.cpp) +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) project(sheet1) -add_executable(main main.cpp) -target_link_libraries(main Rectangle) -add_executable(hello hello.cpp) -add_executable(AskInteger AskInteger.cpp) + +add_subdirectory(basics) +add_subdirectory(opencv) diff --git a/ccv/sheet1/AskInteger.cpp b/ccv/sheet1/basics/AskInteger.cpp similarity index 100% rename from ccv/sheet1/AskInteger.cpp rename to ccv/sheet1/basics/AskInteger.cpp diff --git a/ccv/sheet1/basics/CMakeLists.txt b/ccv/sheet1/basics/CMakeLists.txt new file mode 100644 index 0000000..7f23cc2 --- /dev/null +++ b/ccv/sheet1/basics/CMakeLists.txt @@ -0,0 +1,5 @@ +add_library(Rectangle Rectangle.cpp) +add_executable(main main.cpp) +target_link_libraries(main Rectangle) +add_executable(hello hello.cpp) +add_executable(AskInteger AskInteger.cpp) diff --git a/ccv/sheet1/Rectangle.cpp b/ccv/sheet1/basics/Rectangle.cpp similarity index 100% rename from ccv/sheet1/Rectangle.cpp rename to ccv/sheet1/basics/Rectangle.cpp diff --git a/ccv/sheet1/Rectangle.h b/ccv/sheet1/basics/Rectangle.h similarity index 100% rename from ccv/sheet1/Rectangle.h rename to ccv/sheet1/basics/Rectangle.h diff --git a/ccv/sheet1/hello.cpp b/ccv/sheet1/basics/hello.cpp similarity index 100% rename from ccv/sheet1/hello.cpp rename to ccv/sheet1/basics/hello.cpp diff --git a/ccv/sheet1/main.cpp b/ccv/sheet1/basics/main.cpp similarity index 100% rename from ccv/sheet1/main.cpp rename to ccv/sheet1/basics/main.cpp diff --git a/ccv/sheet1/opencv/CMakeLists.txt b/ccv/sheet1/opencv/CMakeLists.txt new file mode 100644 index 0000000..74680c4 --- /dev/null +++ b/ccv/sheet1/opencv/CMakeLists.txt @@ -0,0 +1 @@ +add_executable(opencv opencv.cpp) diff --git a/ccv/sheet1/opencv/opencv.cpp b/ccv/sheet1/opencv/opencv.cpp new file mode 100644 index 0000000..4bca26d --- /dev/null +++ b/ccv/sheet1/opencv/opencv.cpp @@ -0,0 +1,31 @@ +// +// Created by jim on 4/4/17. +// +#include +#include + +using namespace cv; + +int main(int argc, char** argv ) +{ + if ( argc != 2 ) + { + printf("usage: DisplayImage.out \n"); + return -1; + } + + Mat image; + image = imread( argv[1], 1 ); + + if ( !image.data ) + { + printf("No image data \n"); + return -1; + } + namedWindow("Display Image", WINDOW_AUTOSIZE ); + imshow("Display Image", image); + + waitKey(0); + + return 0; +}