double t1,M1;
double scale1;
double shift1;
cvMinMaxLoc(ImageDst,&t1,&M1,NULL,NULL);
scale1 = 1.0/(M1 - t1);
shift1 = -t1 * scale1;
cvScale(ImageDst,ImageDst,scale1,shift1);
//ImageDst是运动模糊后的图像
for ( i = 0; i < h; i++)
  {
  for ( j = 0; j < w; j++)
  {
if(i<15&&j==w-1)
{
((double*)(Dest->imageData+i*Dest->widthStep))[j]=0.0667;
}
else
((double*)(Dest->imageData+i*Dest->widthStep))[j]=0.0;

  }
  }//h(-x,-y)

CvMat *mat=cvCreateMat(Dest->height ,Dest->width ,CV_64FC1);
cvConvert(Dest,mat);
cvFilter2D(ImageDst,Dest,mat);
cvCopy(ImageDst,DEST);
CvMat *mat1=cvCreateMat(Mask1_Re->height ,Mask1_Re->width ,CV_64FC1);
cvConvert(Mask1_Re,mat1);
for(int i=0;i<20;i++)
{
cvFilter2D(DEST,DEST,mat1);
cvDiv(Dest,DEST,DEst);
cvMul(DEST,DEST,DEst);
}

double t2,M2;
double scale2;
double shift2; cvMinMaxLoc(DEST,&t2,&M2,NULL,NULL);
scale2 = 255/(M2- t2);
shift2= -t2 * scale2;//将shift2加在DEST各元素按比例缩放的结果上,存储为ImageDEST
cvScale(DEST,ImageDEST,scale2,shift2);这个是我写的L-R算法的程序,其中点扩散函数是我自己确定的,调试总是有两个异常,而且最后显示的图像是全黑色的,有没有大神帮泵忙啊L-R算法:中括号外的*代表点乘