Bonjour,
J'ai un problème et je n'arrive pas à comprendre pourquoi mon programme ne s'éxecute pas sur mon PC alors que sur l'ordinateur de l'école ça marche très bien !
voilà le code :
ce que me retourne le terminal après exécution:Code:
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47 #include <cv.h> #include <highgui.h> int main (int argc, char *argv[]) { double a[9]={1,0,-1,2,0,-2,1,0,-1}; double b[9]={1,2,1,0,0,0,-1,-2,-1}; IplImage* img=cvLoadImage(argv[1], 0); if(!img){ printf("could not load image file: %s\n",argv[1]); exit(0); } IplImage* dst=cvCreateImage(cvGetSize(img),IPL_DEPTH_64F,1); IplImage* dst1=cvCreateImage(cvGetSize(img),IPL_DEPTH_64F,1); IplImage* dst2=cvCreateImage(cvGetSize(img),IPL_DEPTH_64F,1); IplImage* dst_f=cvCreateImage(cvGetSize(img),IPL_DEPTH_8U,1); CvMat k1 = cvMat(3,3,CV_32FC1,a); CvMat k2 = cvMat(3,3,CV_32FC1,b); cvFilter2D( img ,dst1, &k1,cvPoint(-1,-1)); cvFilter2D( img ,dst2, &k2,cvPoint(-1,-1)); cvPow(dst1,dst1,2.0); cvPow(dst2,dst2,2.0); cvAdd(dst1,dst2,dst,NULL); cvPow(dst,dst,0.5); cvConvert(dst,dst_f); cvThreshold(dst_f,dst_f,127,255,CV_THRESH_BINARY); cvNamedWindow("mainWin", CV_WINDOW_AUTOSIZE); cvMoveWindow("mainWin", 100, 100); cvShowImage("mainWin",img); cvNamedWindow("result", CV_WINDOW_AUTOSIZE); cvMoveWindow("result", 100, 100); cvShowImage("result",dst_f); cvWaitKey(0); cvReleaseImage(&img); cvReleaseImage(&dst_f); return 0; }
merci de bien vouloir m'aider parce que je vois pas vraiment où est le problème là :(Citation:
OpenCV ERROR: Formats of input arguments do not match ()
in function cvFilter2D, cvfilter.cpp(2617)
Terminating the application...
called from cvUnregisterType, cxpersistence.cpp(4933)
Terminating the application...
called from cvUnregisterType, cxpersistence.cpp(4933)
Terminating the application...
called from cvUnregisterType, cxpersistence.cpp(4933)
Terminating the application...
called from cvUnregisterType, cxpersistence.cpp(4933)
Terminating the application...
called from cvUnregisterType, cxpersistence.cpp(4933)
Terminating the application...
called from cvUnregisterType, cxpersistence.cpp(4933)
Terminating the application...
called from cvUnregisterType, cxpersistence.cpp(4933)
Terminating the application...
called from cvUnregisterType, cxpersistence.cpp(4933)
Terminating the application...
called from cvUnregisterType, cxpersistence.cpp(4933)
Terminating the application...