正向图像扭曲
我正在使用控制点进行前向图像扭曲,但正如任何前向扭曲所预期的那样,目标坐标不是整数,因此它会在目标图像上创建孔。由于源图像中每个像素的扭曲变换都不同,因此我无法找到如何计算目标图像中每个像素的逆变换,以将其作为向后扭曲并使用双线性插值。
简而言之,我的问题是:
1 - 是否可以计算每个目标像素的逆变换以将其作为向后扭曲?
2 - 如果我被迫将其作为向前扭曲,我如何处理目标图像中的孔。简单地使用最近的整数会产生漏洞,将相同的颜色分配给相邻像素可以解决问题,但会出现严重的混叠,所以我相信有更好的方法来做到这一点。
任何帮助表示赞赏。谢谢。
I'm doing a forward image warping with control points but as expected from any forward warping, target coordinates are non integers so it creates holes on the target image. Since the transform in warping is different for every pixel in the source image, i couldn't find how can I calculate inverse transform for every pixel in the destination image to do this as a backward warping and use bilinear interpolation.
So in short my questions are:
1 - Is this possible to calculate inverse transform for each destination pixel to do this as a backward warping?
2 - If I am forced to do it as a forward warping how I can take care of the holes in target image. Simply using nearest integers creates holes, distributing the same color to neighboring pixels take care of the problem but with heavy aliasing so i believe there is a better way to do this.
Any help is appreciated. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要进行两次双线性过滤。当向前扭曲期间的目标坐标为非整数时,第一个将变换分配到目标像素周围的像素。然后使用这些分布式变换作为逆,您将进行向后扭曲,并在从源采样像素时再次使用双线性插值
You need to do bilinear filtering two times. First one to distribute the transform to pixels around the target pixel when the the target coordinate during forward warping is non integer. Then using these distributed transforms as inverse you'll do a backward warping and use bilinear interpolation again when sampling the pixels from the source