i have a code but with error
void LBPFeatures::computeuniformlbp(Mat image,Mat &dst)
{
uchar *ptr=image.data;
image.copyTo(dst);
uchar *optr=dst.data;
int width=image.cols;
int height=image.rows;
for(int i=1;i<height-1;i++)
{
for(int j=1;j<width-1;j++)
{
int center=(int)ptr[j+i*width];
unsigned char code=0;
//for(int k=7;k>=0;k++)
code|=((int)ptr[(j-1)+(i-1)*width] >=center)<<7;
code|=((int)ptr[j+(i-1)*width] >=center)<<6 ;
code|=((int)ptr[(j+1)+(i-1)*width] >=center)<<5 ;
code|=((int)ptr[(j+1)+(i)*width] >=center)<<4 ;
code|=((int)ptr[(j+1)+(i+1)*width] >=center)<<3 ;
code|=((int)ptr[j+(i+1)*width] >=center)<<2 ;
code|=((int)ptr[j-1+(i+1)*width] >=center)<<1 ;
code|=((int)ptr[j-1+(i)*width] >=center)<<0 ;
// int check=0;
//check=code;
//heck if the code is uniform code
//encode only if it is a uniform code else
//assign it a number 255
optr[j+i*width]=lookup[code];
}
}
initUniform();
}
can you find my error