如何使用正态分布的线性变换变换进行配准

傅里叶级数(4)
数字图像基础(29)
1.图像的几何学变换
& & & &之前的博文里,我简单的介绍了图像的放大与缩小。放大与缩小也算是图像的几何学变换,本文介绍了其他的几何学变换,包括旋转、水平倾斜和垂直倾斜(当然,还有水平移动与垂直移动。这些变换很简单,不需要插值,所以这里就不着重介绍了)。
& & & &假设输入图像为G(u,v),其变换后的图像为F(x,y)。其变化的方法,如下所示。
& & & &图像的几何学变换,主要有两种向前映射与向后映射。
& & & &1.1向前映射
& & & &所谓向前映射,就是从输入图像为g(u,v)的(0,0)点开始,将g(u,v)遍历一遍,依次计算g(u,v)变换后的坐标。当然,计算出来的坐标不会是整数(很大程度上不会是整数),就像下图所示那样。
& & & 借由上图,我们重新理解一些向前映射。假设图像的一部分这5个点,经过变换,我们得到了右边的5个点。其实,这个5个点经过变换之后,计算出来的坐标并不是整数。假设现在遍历到这个点(图中以蓝色表示),通过计算得到的点是。我们将的坐标进行四舍五入,将的值赋值给(这种处理相当于选择最近的点,属于最初级的插值方法)。
& & & &使用上述的向前映射的思想,将图像旋转,我们能得到如下效果。
& & & &可以看出来,所得到的结果非常“斑驳”。其原因是,我们将g(u,v)进行变换,计算之后,所得到的坐标四舍五入之后,有的点没有被赋值,而有点被赋值了多次。这就产生了“空穴”,所以让变换后的图像非常斑驳。
& & & &我看了一些文章,基本到这里都会说,“由于向前映射会产生空穴,所以向前映射一般不使用”。诸如此类的话,其实这样理解不太对,产生空穴的根本原因是由于插值法的不恰当所产生的。使用向前映射,也可以不产生“空穴”,所使用的方法如下所示。
& & & &我们可以通过最接近的四个点,去确定的值。这样的话,就可以不产生空穴。但是,这个方法实现起来很困难,所以,向前映射才一般不被使用。
& & & &1.2 向后映射
& & & &向后映射,就是将输出图像f(x,y)遍历一遍,然后计算输出(x,y)的时候,所需要g(x,y)的坐标。当然,这个数不一定是整数。为了方便理解,还是看下图。
& & & &假设,我们遍历到,通过计算,我们得到这样一个点。也就意味着,如果需要确定的灰度值,那么,我们需要点处的灰度值。这样,几何变换的问题又归结到了插值问题。最方便的办法就是选择最近的点,入上图的例子,的灰度值等于的灰度值。当然,还有更加“高级”点的方法,精度也还算可以。的灰度值的确定方法如下所示。
& & & &如上图,我们使用四个点(),去确定的值。首先与之间使用线性插值,确定出的值。同样的方法,确定出的值。与之间,进行线性插值,就可以得到的值了。(图画的非常清楚了)
& & & &使用向后映射,将图像旋转,我们可以得到如下结果。
& & & &1.3 上述两部分的Matlab代码
&a target=_blank id=&L1& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L1& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L2& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L2& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L3& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L3& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L4& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L4& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L5& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L5& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L6& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L6& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L7& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L7& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L8& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L8& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L9& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L9& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L10& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L10& style=&color: rgb(102, 102, 102); text-decoration:&& 10&/a&
&a target=_blank id=&L11& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L11& style=&color: rgb(102, 102, 102); text-decoration:&& 11&/a&
&a target=_blank id=&L12& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L12& style=&color: rgb(102, 102, 102); text-decoration:&& 12&/a&
&a target=_blank id=&L13& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L13& style=&color: rgb(102, 102, 102); text-decoration:&& 13&/a&
&a target=_blank id=&L14& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L14& style=&color: rgb(102, 102, 102); text-decoration:&& 14&/a&
&a target=_blank id=&L15& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L15& style=&color: rgb(102, 102, 102); text-decoration:&& 15&/a&
&a target=_blank id=&L16& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L16& style=&color: rgb(102, 102, 102); text-decoration:&& 16&/a&
&a target=_blank id=&L17& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L17& style=&color: rgb(102, 102, 102); text-decoration:&& 17&/a&
&a target=_blank id=&L18& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L18& style=&color: rgb(102, 102, 102); text-decoration:&& 18&/a&
&a target=_blank id=&L19& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L19& style=&color: rgb(102, 102, 102); text-decoration:&& 19&/a&
&a target=_blank id=&L20& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L20& style=&color: rgb(102, 102, 102); text-decoration:&& 20&/a&
&a target=_blank id=&L21& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L21& style=&color: rgb(102, 102, 102); text-decoration:&& 21&/a&
&a target=_blank id=&L22& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L22& style=&color: rgb(102, 102, 102); text-decoration:&& 22&/a&
&a target=_blank id=&L23& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L23& style=&color: rgb(102, 102, 102); text-decoration:&& 23&/a&
&a target=_blank id=&L24& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L24& style=&color: rgb(102, 102, 102); text-decoration:&& 24&/a&
&a target=_blank id=&L25& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L25& style=&color: rgb(102, 102, 102); text-decoration:&& 25&/a&
&a target=_blank id=&L26& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L26& style=&color: rgb(102, 102, 102); text-decoration:&& 26&/a&
&a target=_blank id=&L27& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L27& style=&color: rgb(102, 102, 102); text-decoration:&& 27&/a&
&a target=_blank id=&L28& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L28& style=&color: rgb(102, 102, 102); text-decoration:&& 28&/a&
&a target=_blank id=&L29& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L29& style=&color: rgb(102, 102, 102); text-decoration:&& 29&/a&
&a target=_blank id=&L30& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L30& style=&color: rgb(102, 102, 102); text-decoration:&& 30&/a&
&a target=_blank id=&L31& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L31& style=&color: rgb(102, 102, 102); text-decoration:&& 31&/a&
&a target=_blank id=&L32& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L32& style=&color: rgb(102, 102, 102); text-decoration:&& 32&/a&
&a target=_blank id=&L33& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L33& style=&color: rgb(102, 102, 102); text-decoration:&& 33&/a&
&a target=_blank id=&L34& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L34& style=&color: rgb(102, 102, 102); text-decoration:&& 34&/a&
&a target=_blank id=&L35& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L35& style=&color: rgb(102, 102, 102); text-decoration:&& 35&/a&
&a target=_blank id=&L36& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L36& style=&color: rgb(102, 102, 102); text-decoration:&& 36&/a&
&a target=_blank id=&L37& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L37& style=&color: rgb(102, 102, 102); text-decoration:&& 37&/a&
&a target=_blank id=&L38& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L38& style=&color: rgb(102, 102, 102); text-decoration:&& 38&/a&
&a target=_blank id=&L39& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L39& style=&color: rgb(102, 102, 102); text-decoration:&& 39&/a&
&a target=_blank id=&L40& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L40& style=&color: rgb(102, 102, 102); text-decoration:&& 40&/a&
&a target=_blank id=&L41& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L41& style=&color: rgb(102, 102, 102); text-decoration:&& 41&/a&
&a target=_blank id=&L42& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L42& style=&color: rgb(102, 102, 102); text-decoration:&& 42&/a&
&a target=_blank id=&L43& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L43& style=&color: rgb(102, 102, 102); text-decoration:&& 43&/a&
&a target=_blank id=&L44& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L44& style=&color: rgb(102, 102, 102); text-decoration:&& 44&/a&
&a target=_blank id=&L45& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L45& style=&color: rgb(102, 102, 102); text-decoration:&& 45&/a&
&a target=_blank id=&L46& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L46& style=&color: rgb(102, 102, 102); text-decoration:&& 46&/a&
&a target=_blank id=&L47& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L47& style=&color: rgb(102, 102, 102); text-decoration:&& 47&/a&
&a target=_blank id=&L48& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L48& style=&color: rgb(102, 102, 102); text-decoration:&& 48&/a&
&a target=_blank id=&L49& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L49& style=&color: rgb(102, 102, 102); text-decoration:&& 49&/a&
&a target=_blank id=&L50& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L50& style=&color: rgb(102, 102, 102); text-decoration:&& 50&/a&
&a target=_blank id=&L51& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L51& style=&color: rgb(102, 102, 102); text-decoration:&& 51&/a&
&a target=_blank id=&L52& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L52& style=&color: rgb(102, 102, 102); text-decoration:&& 52&/a&
&a target=_blank id=&L53& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L53& style=&color: rgb(102, 102, 102); text-decoration:&& 53&/a&
&a target=_blank id=&L54& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L54& style=&color: rgb(102, 102, 102); text-decoration:&& 54&/a&
&a target=_blank id=&L55& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L55& style=&color: rgb(102, 102, 102); text-decoration:&& 55&/a&
&a target=_blank id=&L56& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L56& style=&color: rgb(102, 102, 102); text-decoration:&& 56&/a&
&a target=_blank id=&L57& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L57& style=&color: rgb(102, 102, 102); text-decoration:&& 57&/a&
&a target=_blank id=&L58& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L58& style=&color: rgb(102, 102, 102); text-decoration:&& 58&/a&
&a target=_blank id=&L59& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L59& style=&color: rgb(102, 102, 102); text-decoration:&& 59&/a&
&a target=_blank id=&L60& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L60& style=&color: rgb(102, 102, 102); text-decoration:&& 60&/a&
&a target=_blank id=&L61& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L61& style=&color: rgb(102, 102, 102); text-decoration:&& 61&/a&
&a target=_blank id=&L62& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L62& style=&color: rgb(102, 102, 102); text-decoration:&& 62&/a&
&a target=_blank id=&L63& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L63& style=&color: rgb(102, 102, 102); text-decoration:&& 63&/a&
&a target=_blank id=&L64& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L64& style=&color: rgb(102, 102, 102); text-decoration:&& 64&/a&
close all;clear all;clc;
%% -----------Geometric_spatial_transform------------------f = imread('./letter_T.tif');f = mat2gray(f,[0 255]);
[M,N] = size(f);
%-----by forward mapping-----%g_fm = zeros(M,N);seta = -pi/8;
for v = (-M/2):1:(M/2)-1
for w = (-N/2):1:(N/2)-1
x = round(v*cos(seta) - w*sin(seta));
y = round(v*sin(seta) + w*cos(seta));
if (((y&=(-N/2))&&(y&=(N/2)))&&((x&=(-M/2))&&(x&=(M/2))))
g_fm(x+(M/2)+1,y+(N/2)+1) = f(v+(M/2)+1,w+(N/2)+1);
figure();subplot(1,2,1);imshow(f,[0 1]);xlabel('a).Original Image');
subplot(1,2,2);imshow(g_fm,[0 1]);xlabel('b).Ruselt of Geometric spatial transform');
%-----by inverse mapping----g_im = zeros(M,N);seta = -pi/8;
for x = (-M/2):1:(M/2)-1
for y = (-N/2):1:(N/2)-1
v = x*cos(-seta) - y*sin(-seta);
w = x*sin(-seta) + y*cos(-seta);
if (((w&=(-N/2)+1)&&(w&=(N/2)-1))&&((v&=(-M/2)+1)&&(v&=(M/2)-1)))
%g_im(x+(M/2)+1,y+(N/2)+1) = 1;%f(round(v+(M/2)+1),round(w+(N/2)+1));
Q_11 = f(floor(v)+(M/2)+1,floor(w)+(N/2)+1);
f(floor(v)+(M/2)+1,ceil(w)+(N/2)+1);
f(ceil(v)+(M/2)+1,floor(w)+(N/2)+1);
f(ceil(v)+(M/2)+1,ceil(w)+(N/2)+1);
R1 = (Q_21 - Q_11)*(w-floor(w)) + Q_11;
R2 = (Q_22 - Q_12)*(w-floor(w)) + Q_12;
g_im(x+(M/2)+1,y+(N/2)+1) = (R2-R1)*(v-floor(v)) + R1;
figure();subplot(1,2,1);imshow(f,[0 1]);xlabel('a).Original Image');
subplot(1,2,2);imshow(g_im,[0 1]);xlabel('b).Ruselt of Geometric spatial transform');
Geometric_spatial_transform.m
& & & 2.图像的配准
& & & 图像的配准,常常用于超解析领域。当然了,作为基础学习,博主没学那么深。这次的图像配准,试图去还原被倾斜变换的图像。首先,先将图像进行两个方向的倾斜。
& & & &我们这次的目的是,将图像b).还原为a).。这次变换相对简单,我们使用如下模型去拟合变换关系。
我们在原图与变换后的图像上,选择出四个标准点,然后带入方程,并求出系数。使用这个方程,将图像b).还原为a)。这个过程比较简单,下面是结果。另外,所选择的标准点,我已经在上图中用红圈标定出来了。
& & & &可以看到,还原的效果非常的好(额,其实这也是应为畸变比较简单的缘故)。为了看出于原图的区别,我们做出了差分图像。可以看出来,还原不是完美的。
& & & &至此,上个代码作为本文的结尾。额,由于特征点的选择是手工的,这个代码可能没有多少意义。(不要吐槽最后这一句话。一般的,在使用特征点做图象配准的时候,一般选择在某个实际的物体上放入某个实际的标志,然后通过检测这个实际的标志,去进行变换。【这里可以参考《Digital
Image Processing》 Rafael C. Gonzalez / Richard E. Woods的第二章的相关内容,这里有叙述的!!】)
&a target=_blank id=&L1& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L1& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L2& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L2& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L3& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L3& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L4& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L4& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L5& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L5& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L6& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L6& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L7& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L7& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L8& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L8& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L9& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L9& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L10& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L10& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L11& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L11& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L12& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L12& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L13& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L13& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L14& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L14& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L15& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L15& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L16& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L16& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L17& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L17& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L18& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L18& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L19& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L19& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L20& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L20& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L21& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L21& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L22& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L22& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L23& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L23& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L24& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L24& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L25& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L25& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L26& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L26& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L27& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L27& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L28& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L28& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L29& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L29& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L30& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L30& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L31& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L31& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L32& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L32& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L33& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L33& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L34& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L34& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L35& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L35& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L36& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L36& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L37& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L37& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L38& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L38& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L39& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L39& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L40& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L40& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L41& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L41& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L42& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L42& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L43& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L43& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L44& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L44& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L45& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L45& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L46& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L46& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L47& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L47& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L48& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L48& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L49& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L49& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L50& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L50& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L51& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L51& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L52& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L52& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L53& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L53& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L54& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L54& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L55& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L55& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L56& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L56& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L57& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L57& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L58& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L58& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L59& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L59& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L60& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L60& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L61& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L61& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L62& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L62& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L63& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L63& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L64& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L64& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L65& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L65& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L66& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L66& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L67& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L67& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L68& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L68& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L69& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L69& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L70& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L70& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L71& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L71& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L72& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L72& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L73& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L73& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L74& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L74& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L75& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L75& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L76& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L76& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L77& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L77& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L78& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L78& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L79& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L79& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L80& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L80& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L81& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L81& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L82& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L82& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L83& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L83& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L84& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L84& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L85& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L85& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L86& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L86& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L87& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L87& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L88& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L88& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L89& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L89& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L90& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L90& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L91& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L91& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L92& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L92& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L93& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L93& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L94& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L94& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L95& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L95& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L96& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L96& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L97& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L97& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L98& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L98& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L99& href=&http://blog.csdn.net/zhoufan900428/article/details/& rel=&#L99& style=&color: rgb(102, 102, 102); text-decoration:&&
&a target=_blank id=&L100& href=&http://blog.csdn.net/zhoufan900428/article/details/0& rel=&#L100& style=&color: rgb(102, 102, 102); text-decoration:&& 100&/a&
&a target=_blank id=&L101& href=&http://blog.csdn.net/zhoufan900428/article/details/1& rel=&#L101& style=&color: rgb(102, 102, 102); text-decoration:&& 101&/a&
&a target=_blank id=&L102& href=&http://blog.csdn.net/zhoufan900428/article/details/2& rel=&#L102& style=&color: rgb(102, 102, 102); text-decoration:&& 102&/a&
&a target=_blank id=&L103& href=&http://blog.csdn.net/zhoufan900428/article/details/3& rel=&#L103& style=&color: rgb(102, 102, 102); text-decoration:&& 103&/a&
&a target=_blank id=&L104& href=&http://blog.csdn.net/zhoufan900428/article/details/4& rel=&#L104& style=&color: rgb(102, 102, 102); text-decoration:&& 104&/a&
&a target=_blank id=&L105& href=&http://blog.csdn.net/zhoufan900428/article/details/5& rel=&#L105& style=&color: rgb(102, 102, 102); text-decoration:&& 105&/a&
&a target=_blank id=&L106& href=&http://blog.csdn.net/zhoufan900428/article/details/6& rel=&#L106& style=&color: rgb(102, 102, 102); text-decoration:&& 106&/a&
&a target=_blank id=&L107& href=&http://blog.csdn.net/zhoufan900428/article/details/7& rel=&#L107& style=&color: rgb(102, 102, 102); text-decoration:&& 107&/a&
&a target=_blank id=&L108& href=&http://blog.csdn.net/zhoufan900428/article/details/8& rel=&#L108& style=&color: rgb(102, 102, 102); text-decoration:&& 108&/a&
&a target=_blank id=&L109& href=&http://blog.csdn.net/zhoufan900428/article/details/9& rel=&#L109& style=&color: rgb(102, 102, 102); text-decoration:&& 109&/a&
&a target=_blank id=&L110& href=&http://blog.csdn.net/zhoufan900428/article/details/0& rel=&#L110& style=&color: rgb(102, 102, 102); text-decoration:&& 110&/a&
&a target=_blank id=&L111& href=&http://blog.csdn.net/zhoufan900428/article/details/1& rel=&#L111& style=&color: rgb(102, 102, 102); text-decoration:&& 111&/a&
&a target=_blank id=&L112& href=&http://blog.csdn.net/zhoufan900428/article/details/2& rel=&#L112& style=&color: rgb(102, 102, 102); text-decoration:&& 112&/a&
&a target=_blank id=&L113& href=&http://blog.csdn.net/zhoufan900428/article/details/3& rel=&#L113& style=&color: rgb(102, 102, 102); text-decoration:&& 113&/a&
&a target=_blank id=&L114& href=&http://blog.csdn.net/zhoufan900428/article/details/4& rel=&#L114& style=&color: rgb(102, 102, 102); text-decoration:&& 114&/a&
&a target=_blank id=&L115& href=&http://blog.csdn.net/zhoufan900428/article/details/5& rel=&#L115& style=&color: rgb(102, 102, 102); text-decoration:&& 115&/a&
&a target=_blank id=&L116& href=&http://blog.csdn.net/zhoufan900428/article/details/6& rel=&#L116& style=&color: rgb(102, 102, 102); text-decoration:&& 116&/a&
&a target=_blank id=&L117& href=&http://blog.csdn.net/zhoufan900428/article/details/7& rel=&#L117& style=&color: rgb(102, 102, 102); text-decoration:&& 117&/a&
&a target=_blank id=&L118& href=&http://blog.csdn.net/zhoufan900428/article/details/8& rel=&#L118& style=&color: rgb(102, 102, 102); text-decoration:&& 118&/a&
&a target=_blank id=&L119& href=&http://blog.csdn.net/zhoufan900428/article/details/9& rel=&#L119& style=&color: rgb(102, 102, 102); text-decoration:&& 119&/a&
&a target=_blank id=&L120& href=&http://blog.csdn.net/zhoufan900428/article/details/0& rel=&#L120& style=&color: rgb(102, 102, 102); text-decoration:&& 120&/a&
&a target=_blank id=&L121& href=&http://blog.csdn.net/zhoufan900428/article/details/1& rel=&#L121& style=&color: rgb(102, 102, 102); text-decoration:&& 121&/a&
&a target=_blank id=&L122& href=&http://blog.csdn.net/zhoufan900428/article/details/2& rel=&#L122& style=&color: rgb(102, 102, 102); text-decoration:&& 122&/a&
&a target=_blank id=&L123& href=&http://blog.csdn.net/zhoufan900428/article/details/3& rel=&#L123& style=&color: rgb(102, 102, 102); text-decoration:&& 123&/a&
&a target=_blank id=&L124& href=&http://blog.csdn.net/zhoufan900428/article/details/4& rel=&#L124& style=&color: rgb(102, 102, 102); text-decoration:&& 124&/a&
%% --------------image registration---------------------------f_Original = imread('./characters_test_pattern.tif');f_Original = mat2gray(f_Original,[0 255]);[M,N] = size(f_Original);
f = zeros(M+4,N+4);for x = 1:M
f(x+2,:) = [0 0 f_Original(x,:) 0 0];end
[M,N] = size(f);
s_v = 0.3;s_w = 0.02;
P = round(M+s_v*N);Q = round(N+s_w*M);g_1 = zeros(P,N);
for x = (-P/2):1:(P/2)-1
for y = (-N/2):1:(N/2)-1
v = x - s_v *
if (((w&=(-N/2))&&(w&=(N/2)-1))&&((v&=(-M/2))&&(v&=(M/2)-1)))
Q_11 = f(floor(v)+(M/2)+1,floor(w)+(N/2)+1);
f(floor(v)+(M/2)+1,ceil(w)+(N/2)+1);
f(ceil(v)+(M/2)+1,floor(w)+(N/2)+1);
f(ceil(v)+(M/2)+1,ceil(w)+(N/2)+1);
R1 = (Q_21 - Q_11)*(w-floor(w)) + Q_11;
R2 = (Q_22 - Q_12)*(w-floor(w)) + Q_12;
g_1(x+(P/2)+1,y+(N/2)+1) = (R2-R1)*(v-floor(v)) + R1;
g = zeros(P,Q);
for x = (-P/2):1:(P/2)-1
for y = (-Q/2):1:(Q/2)-1
w = y - s_w *
if (((w&=(-N/2))&&(w&=(N/2)-1))&&((v&=(-P/2))&&(v&=(P/2)-1)))
Q_11 = g_1(floor(v)+(P/2)+1,floor(w)+(N/2)+1);
g_1(floor(v)+(P/2)+1,ceil(w)+(N/2)+1);
g_1(ceil(v)+(P/2)+1,floor(w)+(N/2)+1);
g_1(ceil(v)+(P/2)+1,ceil(w)+(N/2)+1);
R1 = (Q_21 - Q_11)*(w-floor(w)) + Q_11;
R2 = (Q_22 - Q_12)*(w-floor(w)) + Q_12;
g(x+(P/2)+1,y+(Q/2)+1) = (R2-R1)*(v-floor(v)) + R1;
figure();subplot(1,2,1);imshow(f,[0 1]);xlabel('a).Original Image');plot(621, 78,'ro','MarkerSize',7);plot(116,113,'ro','MarkerSize',7);plot( 85,649,'ro','MarkerSize',7);plot(624,641,'ro','MarkerSize',7);
subplot(1,2,2);imshow(g,[0 1]);xlabel('b).Ruselt of Geometric spatial transform');plot(625,264,'ro','MarkerSize',7);plot(116,147,'ro','MarkerSize',7);plot( 96,674,'ro','MarkerSize',7);plot(638,828,'ro','MarkerSize',7);%% f_reg = zeros(M,N);
Original = [621-(N/2)
(621-(N/2))*(78-(M/2)) 1;
116-(N/2) 113-(M/2) (116-(N/2))*(113-(M/2)) 1;
85-(N/2) 649-(M/2)
(85-(N/2))*(649-(M/2)) 1;
624-(N/2) 641-(M/2) (624-(N/2))*(641-(M/2)) 1];
Ruselt = [625-(Q/2);116-(Q/2);96-(Q/2);638-(Q/2)];
c = (Original)\R
Ruselt = [264-(P/2);147-(P/2);674-(P/2);828-(P/2)];
c = [c (Original)\Ruselt];
%C5~C8 wwwwww
for y = (-M/2):1:(M/2)-1
for x = (-N/2):1:(N/2)-1
w = c(1,1)*y + c(2,1)*x + c(3,1)*x*y + c(4,1);
v = c(1,2)*y + c(2,2)*x + c(3,2)*x*y + c(4,2);
if (((w&=(-Q/2))&&(w&=(Q/2)-1))&&((v&=(-P/2))&&(v&=(P/2)-1)))
Q_11 = g(floor(v)+(P/2)+1,floor(w)+(Q/2)+1);
g(floor(v)+(P/2)+1,ceil(w)+(Q/2)+1);
g(ceil(v)+(P/2)+1,floor(w)+(Q/2)+1);
g(ceil(v)+(P/2)+1,ceil(w)+(Q/2)+1);
R1 = (Q_21 - Q_11)*(w-floor(w)) + Q_11;
R2 = (Q_22 - Q_12)*(w-floor(w)) + Q_12;
f_reg(x+(N/2)+1,y+(M/2)+1) = (R2-R1)*(v-floor(v)) + R1;
%g(round(v+(P/2)+1),round(w+(Q/2)+1)) = 0.5;
g_diff = abs(f - f_reg);
figure();subplot(1,2,1);imshow(f_reg,[0 1]);xlabel('c).Ruselt of image registration');
subplot(1,2,2);imshow(g_diff,[0 1]);xlabel('d).Difference image');
image_registration.m
& & & 原文发于博客:&
&&相关文章推荐
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:119356次
积分:1890
积分:1890
排名:千里之外
原创:58篇
转载:46篇
(3)(9)(1)(1)(2)(1)(6)(3)(2)(1)(5)(2)(3)(2)(12)(18)(6)(10)(7)(9)(1)(3)}

我要回帖

更多关于 正态分布 傅里叶变换 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信