Bonsoir!
Pour être bref je veux afficher une image aprés le traitement dans un picturebox

voilà mon 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
int F_Sobel(IplImage *i,IplImage *ii)
{
	//IplImage *i=NULL;
	i=cvLoadImage("C:/Users/Dell/Desktop/t.jpg",0);
	//cvNamedWindow("Original",1);
 
	/*pictureBox1->ImageLocation=(i);*/
 
 
}
	//cvShowImage("Original",i);
	uchar* a;
	a=(uchar*) i->imageData;
	//IplImage* ii=NULL;
	ii=cvCloneImage(i);
	uchar* aa;
	aa=(uchar*) ii->imageData;
	int step ;
	step=i->widthStep;
	long H,W;
	H=i->height;
	W=i->width;
	cout<<H<<endl;
	cout<<W<<endl;
	int sx[3][3]={{-1,0,1},{-2,0,2},{-1,0,1}};//Sobel X
	int sy[3][3]={{-1,-2,-1},{0,0,0},{1,2,1}};//Sobel Y
 
int q,j,m,n;//Compteurs 
	double gsx,gsy;//gradien 
	for(q=0;q<=W+1;q++)
	{
		a[ 0 * step + q ]=0;
		a[ (H+1) * step + q ]=0;
	}
	for(j=0;j<=H+1;j++)
	{
		a[ j * step + 0 ] = 0;
		a[ j * step + (W+1) ] = 0;
	}
	for( m=1 ; m <= H ; m++ )
	{
		for( n=1 ; n <= W ; n++ )
			{//début du traitement Sobel
			gsx=a[(m-1)*step+(n-1)]*sx[0][0]+a[(m-1)*step+n]*sx[1][0]+a[(m-1)*step+(n+1)]*sx[2][0]+a[m*step+(n-1)]*sx[0][1]+a[m*step+n]*sx[1][1]+a[m*step+(n+1)]*sx[2][1]+a[(m+1)*step+(n-1)]*sx[0][2]+a[(m+1)*step+n]*sx[1][2]+a[(m+1)*step+(n+1)]*sx[2][2];
			gsy=a[(m-1)*step+(n-1)]*sy[0][0]+a[(m-1)*step+n]*sy[1][0]+a[(m-1)*step+(n+1)]*sy[2][0]+a[m*step+(n-1)]*sy[0][1]+a[m*step+n]*sy[1][1]+a[m*step+(n+1)]*sy[2][1]+a[(m+1)*step+(n-1)]*sy[0][2]+a[(m+1)*step+n]*sy[1][2]+a[(m+1)*step+(n+1)]*sy[2][2];
 
			aa[(m-1)*step+(n-1)]= ((abs(gsx) + abs(gsy))/4);
			//fin du traitement Sobel
		}
	}
	IplImage* isobel;
	isobel=cvCloneImage(i);
	cvSobel(i,isobel,0,1);
	// cvNamedWindow("S_OpenCv",1);
	PictureBox2->ImageLocation=();
	//cvShowImage("S_OpenCv", isobel);
	//cvNamedWindow("Sobel",1);
	pictureBox3->ImageLocation=(ii);
	//cvShowImage("Sobel",ii);
	cvWaitKey(0);
return 0;
}
void main()
{IplImage *i;//=NULL;
IplImage *ii;//=NULL;
i=cvLoadImage("C:/Users/Dell/Desktop/t.jpg",0);
ii=cvCloneImage(i);
F_Sobel(i,ii);
 
}
Ma question :
Où se trouve les images i et ii
pour affécter leur adresse aux pictureBox

Merci!