Created
September 19, 2014 21:43
-
-
Save salimos/c0e566a441ab1ebd168f to your computer and use it in GitHub Desktop.
Simple exemple de vérification de la config d'OoenCV
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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