salut tout le monde , j'ai un code avec c++ qui calcule matrice de cooccurrence
mais je n'arrive pas à comprendre le code
voila le code
void texture()
{
ComputeCooc(1,1);
//Label1->Caption=FloatToStr(getF1());
getF1();
getF2();
getF3();
getF4();
getF5();
//getF9();
}
//-------------------------
void ComputeCooc(int dx,int dy)
{
//initialisation
int x0,y0,x1,y1;
int v0,v1;
double sum=0;
size=64;
TPoint p,p2;
//RAZ de la matrice
for (y0=0;y0<size;y0++)
{
for (x0=0;x0<size;x0++)
{
matrix[x0][y0]=0;
}
}
for(y0=0;y0<h+1;y0++)
{
for(x0=0;x0<w+1;x0++)
{
p.x=x0;
p.y=y0;
v0=size*image1[x0][y0]/256.0;
x1=x0+dx;
y1=y0+dy;
p2.x=x1;
p2.y=y1;
v1=size*image1[x1][y1]/256.0;
matrix[v0][v1]++;
matrix[v1][v0]++;
sum=sum+2;
}//fin For
}//Fin For
//Normalisation
for(int y0=0;y0<size;y0++)
{
for(int x0=0;x0<size;x0++)
{
matrix[x0][y0]=matrix[x0][y0]*1.0/sum*1.0;
}
}
}
cette méthode calcule matrice de cooccurrence
merci d'avance