/************************************************************************* 
  * 
  *   函数名称: 
  *       RobertDIB() 
  * 
  *   参数: 
  *       LPSTR   lpDIBBits         -   指向源DIB图像指针 
  *       LONG     lWidth               -   源图像宽度(象素数,必须是4的倍数) 
  *       LONG     lHeight             -   源图像高度(象素数) 
  *   返回值: 
  *       BOOL                               -   边缘检测成功返回TRUE,否则返回FALSE。 
  * 
  *   说明: 
  *   该函数用Robert边缘检测算子对图像进行边缘检测运算。 
  *   
  *   要求目标图像为灰度图像。 
  ************************************************************************/ BOOL   WINAPI   RobertDIB(LPSTR   lpDIBBits,   LONG   lWidth,   LONG   lHeight) 
{ //   指向源图像的指针 
LPSTR lpSrc; //   指向缓存图像的指针 
LPSTR lpDst; //   指向缓存DIB图像的指针 
LPSTR lpNewDIBBits; 
HLOCAL hNewDIBBits; //循环变量 
long   i; 
long   j; //像素值 
double   result; 
unsigned   char   pixel[4]; //   暂时分配内存,以保存新图像 
hNewDIBBits   =   LocalAlloc(LHND,   lWidth   *   lHeight); if   (hNewDIBBits   ==   NULL) 

//   分配内存失败 
return   FALSE; 
} //   锁定内存 
lpNewDIBBits   =   (char   *   )LocalLock(hNewDIBBits); //   初始化新分配的内存,设定初始值为255 
lpDst   =   (char   *)lpNewDIBBits; 
memset(lpDst,   (BYTE)255,   lWidth   *   lHeight); 
//使用水平方向的结构元素进行腐蚀 
for(j   =   lHeight-1;   j   >   0;   j--) 

for(i   =   0;i   <lWidth-1;   i++) 

//由于使用2×2的模板,为防止越界,所以不处理最下边和最右边的两列像素 //   指向源图像第j行,第i个象素的指针 
lpSrc   =   (char   *)lpDIBBits   +   lWidth   *   j   +   i; //   指向目标图像第j行,第i个象素的指针 
lpDst   =   (char   *)lpNewDIBBits   +   lWidth   *   j   +   i; //取得当前指针处2*2区域的像素值,注意要转换为unsigned   char型 
pixel[0]   =   (unsigned   char)*lpSrc; 
pixel[1]   =   (unsigned   char)*(lpSrc   +   1); 
pixel[2]   =   (unsigned   char)*(lpSrc   -   lWidth); 
pixel[3]   =   (unsigned   char)*(lpSrc   -   lWidth   +   1); 
[/color][/color]//计算目标图像中的当前点 
  result   =   sqrt((   pixel[0]   -   pixel[3]   )*(   pixel[0]   -   pixel[3]   )   +   \ 
    (   pixel[1]   -   pixel[2]   )*(   pixel[1]   -   pixel[2]   )); 
*lpDst   =   (unsigned   char)result; } 
} //   复制腐蚀后的图像 
memcpy(lpDIBBits,   lpNewDIBBits,   lWidth   *   lHeight); //   释放内存 
LocalUnlock(hNewDIBBits); 
LocalFree(hNewDIBBits); //   返回 
return   TRUE; 

中的
 pixel[0]   =   (unsigned   char)*lpSrc; 
pixel[1]   =   (unsigned   char)*(lpSrc   +   1); 
pixel[2]   =   (unsigned   char)*(lpSrc   -   lWidth); 
pixel[3]   =   (unsigned   char)*(lpSrc   -   lWidth   +   1);
这几句话,看不明白,pixel[0],pixel[1]我明白,但是下面的两个pixel[2],pixel[3]怎么解释啊?