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; 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 ; optr[j+i*width]=lookup[code]; } } initUniform(); }
optr[j+i*width]=lookup[code];
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)