bonjour tout le monde,

J'ai installé opencv-1.0.0 sur fedora 8 et j'ai voulu le tester avec un simple exemple: creation d'une image"

voila le code:

Code : 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
22
23
24
25
26
27
28
29
//
// opencv0.c - creating and displaying an image using Intel OpenCV
//
#include "cv.h" // includes OpenCV definitions
#include "highgui.h" // includes highGUI definitions
#include <stdio.h>// includes C standard input/output definitions
int main()
{
IplImage *cvImg; // image used for visualisation
CvSize imgSize; // size of visualisation image
int i = 0, j = 0;
imgSize.width = 640; // visualisation image is
imgSize.height = 480; // 640x480 pixels
// creation of a 8 bits depth gray image
cvImg = cvCreateImage( imgSize, 8, 1 );
// image is filled with gray values
// corresponding to the 256 modulus
// of their position in the image
for ( i = 0; i < imgSize.width; i++ )
for ( j = 0; j < imgSize.height; j++ )
((uchar*)(cvImg->imageData + cvImg->widthStep*j))[i] =
( char ) ( ( i * j ) % 256 );
cvNamedWindow( "Testing OpenCV...", 1 ); // creation of a visualisation window
cvShowImage( "Testing OpenCV...", cvImg ); // image visualisation
cvWaitKey( 0 ); // wait for key
cvDestroyWindow( "image" ); // close window
cvReleaseImage( &cvImg ); // memory release before exiting the application
return( 0 ); // stopping our first program
}

j'ai compilé avec la commande suivante et ça marche très bien:

gcc -I/home/intel/opencv/include/opencv -L/home/intel/opencv/lib -lcv -lhighgui -lcxcore -lcvaux opencv0.c -o opencv0

mais quand j'ai tapé ./opencv0 pour l'exécution j'ai eu le message d'erreur suivant:

./opencv0: error while loading shared libraries: libcv.so.1: cannot open shared object file: No such file or directory


Pouvez vous m'aider?

Je vous attends.

Merci d'avance.