Skip to content

Instantly share code, notes, and snippets.

@salimos
Created September 19, 2014 21:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save salimos/c0e566a441ab1ebd168f to your computer and use it in GitHub Desktop.
Save salimos/c0e566a441ab1ebd168f to your computer and use it in GitHub Desktop.
Simple exemple de vérification de la config d'OoenCV
//
// main.cpp
// OpenCV
//
// Created by Slim Khan on 19/09/2014.
// Copyright (c) 2014 Slim Khan. All rights reserved.
//
#include <iostream>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/core/core.hpp>
#include <opencv/cxcore.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <math.h>
using namespace std;
int main(int argc, const char * argv[]) {
std::string path = "/Developer/img.png";
// Ouverture de l'image
cv::Mat img = cv::imread (path);
if (img.empty ())
{
std::cerr<< "probleme de lecture: " << path <<std::endl;
return EXIT_FAILURE;
}
// Affichage de l'image dans une fenêtre intitulée "Hello World!"
cv::namedWindow ("tp1!", CV_WINDOW_AUTOSIZE);
cv::imshow ("Hello World!",img);
// Pause
std::cout<< "Appuyez sur une touche pour continuer" <<std::endl;
cv::waitKey ();
return EXIT_SUCCESS;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment