Skip to content

Commit

Permalink
Add 'OpenCV-drishti' example
Browse files Browse the repository at this point in the history
  • Loading branch information
ruslo committed Oct 15, 2017
1 parent c9f393a commit 9d3cc2e
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
22 changes: 22 additions & 0 deletions examples/OpenCV-drishti/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright (c) 2015, Ruslan Baratov
# All rights reserved.

cmake_minimum_required(VERSION 3.0)

set(TESTING_CONFIG_OPT FILEPATH "${CMAKE_CURRENT_LIST_DIR}/config.cmake")

# Emulate HunterGate:
# * https://github.com/hunter-packages/gate
include("../common.cmake")

project(download-opencv)

hunter_add_package(OpenCV)
find_package(OpenCV REQUIRED)

message("OpenCV_DIR: ${OpenCV_DIR}")
message("OpenCV_CONFIG: ${OpenCV_CONFIG}")
message("OpenCV_LIBS: ${OpenCV_LIBS}")

add_executable(foo foo.cpp)
target_link_libraries(foo PRIVATE ${OpenCV_LIBS})
10 changes: 10 additions & 0 deletions examples/OpenCV-drishti/config.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# https://ci.appveyor.com/project/ingenue/hunter/build/1.0.2532/job/idmsw2829ry1ltj6
hunter_config(
OpenCV
VERSION
3.0.0-p11
CMAKE_ARGS
WITH_IPP=OFF
BUILD_EIGEN=OFF
WITH_EIGEN=OFF
)
25 changes: 25 additions & 0 deletions examples/OpenCV-drishti/foo.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// http://docs.opencv.org/doc/tutorials/introduction/linux_gcc_cmake/linux_gcc_cmake.html

#include <stdio.h>
#include <opencv2/opencv.hpp>

int main(int argc, char** argv) {
if (argc != 2) {
printf("usage: DisplayImage.out <Image_Path>\n");
return -1;
}

cv::Mat image;
image = cv::imread(argv[1], 1);

if (!image.data) {
printf("No image data \n");
return EXIT_FAILURE;
}
cv::namedWindow("Display Image", cv::WINDOW_AUTOSIZE);
cv::imshow("Display Image", image);

cv::waitKey(0);

return EXIT_SUCCESS;
}

0 comments on commit 9d3cc2e

Please sign in to comment.