仿射矩阵变换

时间:2016-03-16 19:52:08

标签: c# image image-processing affinetransform

我有两个图像,一个是输入图像(enter image description here),另一个是输出图像(enter image description here)。使用仿射变换使用输入图像上的某些函数产生输出图像。我需要在输入图像上使用3个连接点找到该功能,然后在输出图像上找到相应的点。

由于仿射矩阵具有以下等式

 x = v * t11 + w * t21 + t31;

 y = v * t12 + w * t22 + t32;

现在应用了一些计算后,我发现了所有未知变量i,e t11,t21 etc.的值。现在我想在输入图像上应用这些值,使其像输出图像一样。

以下是C#中的代码。

            for(int i=0; i<file1.Width; i++)
            for(int j=0; j<file1.Height; j++)
            {
                x = i * t11 + j * t21 + t31;

                y = i * t12 + j * t22 + t32;

                 file1.SetPixel(i,j , );

            }

但我无法弄清楚如何扭曲图像1上的图像2以获得结果,尽管我拥有我需要的所有值。任何帮助将不胜感激。

0 个答案:

没有答案