Skip to content

Instantly share code, notes, and snippets.

@KeitetsuWorks
Last active May 29, 2018 14:56
Show Gist options
  • Select an option

  • Save KeitetsuWorks/792ca6d0d05a3d3c80d3f48baa880752 to your computer and use it in GitHub Desktop.

Select an option

Save KeitetsuWorks/792ca6d0d05a3d3c80d3f48baa880752 to your computer and use it in GitHub Desktop.
/**
* @file opencv_sample.cpp
* @brief OpenCV Sample Program
* @author Keitetsu
* @date 2018/02/24
* @copyright Copyright (c) 2018 Keitetsu
* @par License
* This software is released under the MIT License.
*/
#include <opencv2/core.hpp>
#include <opencv2/highgui.hpp>
#include <iostream>
int main(int argc, const char* argv[])
{
cv::Mat src = cv::imread("/home/nvidia/NVIDIA_CUDA-9.0_Samples/common/data/Lena.pgm", cv::IMREAD_COLOR);
if (src.empty()) {
std::cerr << "Failed to open image file." << std::endl;
return -1;
}
cv::namedWindow("image", cv::WINDOW_AUTOSIZE);
cv::imshow("image", src);
cv::waitKey(0);
cv::destroyAllWindows();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment