Red de conocimiento informático - Problemas con los teléfonos móviles - Código fuente de la curva Vc

Código fuente de la curva Vc

void calcular(unsigned char* buf)

{

int Ex, Ey, Et;

int gris1, gris2

int u

int i, j;

memset(flujo óptico, 0, ancho * alto * tamaño de (int)); );

for(I = 2;i<height-2;i++){

for(j=2;j<width-2;j++){

gris 1 = int((int)(buf[(I * ancho+j)* 3])

+(int)(buf[(I * ancho+j)* 3+1])

+(int)(buf[(I * ancho+j)* 3+2])* 1.0/3);

gris 2 = int( (int)(cuadro anterior[ (I * ancho+j)* 3])

+(int)(cuadro anterior[(I * ancho+j)* 3+1])

+(int) (cuadro anterior[(I * ancho+j)* 3+2])* 1.0/3);

et = gris 1–gris 2;

gris 2 = int( (int)(buf[(I * ancho+j+1)* 3])

+(int)(buf[(I * ancho+j+1)* 3+1])

+(int)(buf[(I * ancho+j+1)* 3+2])* 1.0/3);

ex = gris 2–gris 1;

gris 2 = int((int)(buf[((I+1)* ancho+j)* 3])

+(int)( buf[((I+1 )* ancho+j)* 3+1])

+(int)(buf[((I+1)* ancho+j)* 3+2]) * 1.0/3);

ey = gris 2–gris 1;

Ex =((int)(Ex/10))* 10;

Ey =((int)( Ey/10))* 10;

Et =((int)(Et/10))* 10;

u =(int)( (Et * 10.0)/( sqrt((Ex * Ex+Ey * Ey)* 1.0))+0.1);

flujo óptico[I * ancho+j]= u;

if(abs(u )>10){

salida[(I * ancho+j)* 3]= 0;

salida[(I * ancho+j) * 3+1]= 0 ;

Salida [(I * ancho+j)* 3+2]= 0;

}

}

}

memcpy(prevframe, buf, tamaño);

}