diff --git a/.gitignore b/.gitignore index 4aa3219..d00d606 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ cmake_install.cmake SVMTest SVMTest.png + +DisplayImage diff --git a/CMakeLists.txt b/CMakeLists.txt index 070d883..0a0395e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,3 +4,6 @@ find_package( OpenCV REQUIRED ) add_executable( SVMTest SVMTest.cpp ) target_link_libraries( SVMTest ${OpenCV_LIBS} ) + +add_executable( DisplayImage DisplayImage.cpp ) +target_link_libraries( DisplayImage ${OpenCV_LIBS} ) diff --git a/DisplayImage.cpp b/DisplayImage.cpp new file mode 100644 index 0000000..dfcd201 --- /dev/null +++ b/DisplayImage.cpp @@ -0,0 +1,27 @@ +#include +#include + +using namespace cv; + +int main(int argc, char **argv) +{ + if (argc != 2) { + printf("Usage: DisplayImage image.jpg\n"); + return -1; + } + + Mat image; + image = imread(argv[1], 1); + + if (argc != 2 || !image.data) { + printf("No image data\n"); + return -1; + } + + namedWindow("Display Image", CV_WINDOW_AUTOSIZE); + imshow("Display Image", image); + + waitKey(0); + + return 0; +} diff --git a/lena.jpg b/lena.jpg new file mode 100644 index 0000000..410861a Binary files /dev/null and b/lena.jpg differ diff --git a/lena.tif b/lena.tif new file mode 100644 index 0000000..ffe5c83 Binary files /dev/null and b/lena.tif differ