在图像旋转上映射像素 [英] mapping pixels on image rotation

查看:116
本文介绍了在图像旋转上映射像素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个C#代码,我正在使用AForge.NET成像库中提供的RotateBilinear(双角度)滤镜。

我想要一个旧像素坐标的映射(x0, y0)在旋转之前旋转到新像素坐标(x1,y1)之前。有没有办法找到这样的映射?



提前谢谢。

I am writing a C# code where I am using the RotateBilinear(double angle) filter available in the AForge.NET imaging library.
I want a mapping from old pixel co-ordinates (x0,y0) before rotation to the new pixel co-ordinates (x1,y1) after rotation. Is there a way to do find such a mapping ?

Thanks in advance.

推荐答案

有没有一对一的映射,因为双线性旋转具有以下效果:所得图像中的任何一个像素将取决于来自原始图像的2×2像素矩阵。快速浏览一下AForge API,我没有看到任何方法,可以让你找出结果图像中的哪个像素受到原始图像中哪些像素的影响。

你会必须自己实现双线性旋转,并在结果图像中更新生成的图像中原始每个像素的影响像素列表。

根据图像的大小,可能会消耗很多记忆,所以要注意你不要遇到内存不足的例外。



问候,

- 曼弗雷德
There is no one to one mapping since the bilinear rotation has the effect that any one pixel in the resulting image will depend on a 2 x 2 matrix of pixels from the original image. Having a quick look at the AForge API I didn't see any method, that would allow you to find out which pixel in the resulting image was influenced by which pixels from the original image.
You'd have to implement a bilinear rotation yourself and update a list of influencing pixels from the original per pixel in the resulting image as you go.
Depending on the size of your image that may very well consume quite a bit of memory, so beware you don't run into a out of memory exception.

Regards,
— Manfred


我找到了一个很好的链接,Vincent解释了我们如何手动完成双线性旋转



http://polymathprogrammer.com/2008/10/06/image-rotation-with-bilinear-interpolation / [ ^ ]



这解决了我的问题!!!
I have found an excellent link where Vincent explains how we can do this bilinear rotation manually

http://polymathprogrammer.com/2008/10/06/image-rotation-with-bilinear-interpolation/[^]

this solved my problem !!!


这篇关于在图像旋转上映射像素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆