如何对图像中的像素点进行二维插补
怎么对图像中的像素点进行二维插补?
用这个方法
对这个图像进行插补
具体要怎么实现?怎么知道要插补的点的坐标?
------解决方案--------------------
int Interpolation(CvMat *mat,int ty,int my,double rc,double thc)//ty为行 深度 半径,my为列 角度
{
int d;
d = (CV_MAT_ELEM(*mat,char,ty,my) * (1-rc) * (1-thc)) + (CV_MAT_ELEM(*mat,char,ty,my+1) * rc * (1-thc)) + (CV_MAT_ELEM(*mat,char,ty+1,my) * (1-rc) * thc) + (CV_MAT_ELEM(*mat,char,ty+1,my+1) * rc * thc);
return d;
}
用这个方法
对这个图像进行插补
具体要怎么实现?怎么知道要插补的点的坐标?
------解决方案--------------------
int Interpolation(CvMat *mat,int ty,int my,double rc,double thc)//ty为行 深度 半径,my为列 角度
{
int d;
d = (CV_MAT_ELEM(*mat,char,ty,my) * (1-rc) * (1-thc)) + (CV_MAT_ELEM(*mat,char,ty,my+1) * rc * (1-thc)) + (CV_MAT_ELEM(*mat,char,ty+1,my) * (1-rc) * thc) + (CV_MAT_ELEM(*mat,char,ty+1,my+1) * rc * thc);
return d;
}