pixels.c

来自「NIST Handwriting OCR Testbed」· C语言 代码 · 共 28 行

C
28
字号
/*# proc: black_pixel_count - returns the total number of pixels in a binary# proc:                     image with value equal to one.*/#include <bitcount.h>int black_pixel_count(bimage, width, height)unsigned char *bimage;int width, height;{   int b, i;   static int ow = -1, oh = -1, n;   if((ow != width) || (oh != height)){      n = width * height;      if ( n % 8 )         fatalerr("black_pixel_count", "number of pixels", "not divisible by 8");      ow = width;      oh = height;   }   for ( b = 0, i = n >> 3 ; i ; i-- )       b += Bit_Count[*bimage++];   return(b);}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?