thanks friend, i have done already what you said, but some of images were distorted, i blurred image using Gaussian function. the code is as follows: for (int i=0;i { for (int j=0;j { int iIndex=i+j*width; if (j==0) { ucGauImgVArray[iIndex]=ucGauHImg[i+j*iWidth1]*mask[1]+ucGauHImg[i+(j+1)*Width]*mask[2]; } else if (j==(Height-1)) { ucGauImgVArray[iIndex]=ucGauHImg[i+(j-1)*Width]*mask[0]+ucGauHImg[i+j*Width]*mask[1]; } else { ucGauImgVArray[iIndex]=ucGauHImg[i+(j-1)*Width]*mask[0]+ucGauHImg[i+j*Width1]*mask[1]+ucGauHImg[i+(j+1)*Width1]*mask[2]; } } } //Declare a memory for vertical convolution allocimage(&m_vicGauVImg,Width,Height,8); unsigned char *ucGauVImg=m_vicGauVImg.ibuff; int Widthbyte=m_vicGauVImg.buffwidth; for (int y3=0;y3 { for (int x3=0;x3 { int iIndex=x3+y3*iWidth1; ucGauVImg[x3]=ucGauImgVArray[iIndex]; } ucGauVImg+=iWidthbyte; } i am very sorry, why i couldn't put width,height behind the i,j.very sad..
gentleguy