Hello,
j'ai installé OpenCV sous ubuntu 9.0.4. Puis Codeblocks. J'essaye le wizard pour créer un projet openCV.

Code cpp : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Il faut indiquer    usr/local/include/openCV4 comme répertoire pour les librairies HPP
#include <opencv2/opencv.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/core/core.hpp>
 
#include <iostream>
 
using namespace cv;
using namespace std;
 
int main(int argc, char *argv[])
{
    Mat img = imread("arnold_schwarzenegger.jpg", CV_LOAD_IMAGE_COLOR);
    if(img.empty())
        return -1;
    namedWindow("arnold_schwarzenegger", CV_WINDOW_AUTOSIZE );
    imshow("arnold_schwarzenegger", img);
    waitKey(0);
    return 0;
}

Mais j'ai une erreur de comilation. error: ‘CV_LOAD_IMAGE_COLOR’ was not declared in this scope|.
Je pense que le problème vient des options de compilation mais ça fait des heures que je tourne en rond.
Merci de votre aide.