void sharpen(IplImage *in,IplImage *out)
{
int r=in->height;
int c=in->width;
int st=in->widthStep;
int i,j;
for(i=1;i<r-1;i++)
{
uchar *cur=(uchar *)(in->imageData+i*st);
uchar *pre=(uchar *)(in->imageData+(i-1)*st);
uchar *next=(uchar *)(in->imageData+(i+1)*st);
uchar *output=(uchar *)(out->imageData+i*st);
for(j=3;j<c*3-3;j++)
{
*output=uchar(5*cur[j]-cur[j-3]-cur[j+3]-pre[j]-next[j]);
*output++;
}
}
}
使用拉普拉斯算子进行 OpenCV 图像锐化...您介意帮我找出错误吗?