相位相关matlab实现
来源:互联网 发布:淘宝店主 编辑:程序博客网 时间:2024/05/22 05:06
Here is working code for an example that uses a single image and cuts out a 256x256 pixel portion of the image from one location
即在同一副图像中,先切一个256*256的图片,然后位移,再切一个同样大小256*256的图像
and then cuts out the same size portion from a location that has been translated by 11 pixels in the x direction and 7 pixels in the y direction.
This shows that the basic technique does work when you have the code formatting correct.
image1 = rgb2gray(imread('frame429.jpg')); % read in image and convert from RGB ro grayscale
rect1 = [1 1 255 255]; % define first cutout region [xmin ymin width height]
rect2 = [12 8 255 255]; % define second translated cutout region [xmin ymin width height]
sub_image1 = imcrop(image1,rect1); % 1st cut out portion of original image
sub_image2 = imcrop(image1,rect2); % 2nd cut out portion of original image
filter1=blackman(length(sub_image1),'symmetric');
filtimg1=(filter1*filter1');
Image1=double(sub_image1).*filtimg1;
Image2=double(sub_image2).*filtimg1
FFT1 = fft2(Image1);
FFT2 = conj(fft2(Image2));
FFTR = FFT1.*FFT2;
magFFTR = abs(FFTR);
FFTRN = (FFTR./magFFTR);
result = ifft2(double(FFTRN));
figure;
colormap('gray'); % choose colormap for plotting
imagesc(result);
figure;
colormap(jet);
mesh(result);
The code can easily be changed to use two different images of the same dimensions:
image1 = rgb2gray(imread('castle_color1.tif')); % read image 1 (convert to grayscale if RGB)image2 = rgb2gray(imread('castle_color5.tif')); % read image 2 must have same dimensions as image 1subplot(1,2,1);imshow(image1);subplot(1,2,2);imshow(image2);filter1=blackman(size(image1,1),'symmetric'); % setup window in one direction - I chose Blackman window - could use Hamming or othersfilter2=blackman(size(image1,2),'symmetric'); % setup window in second directionfiltimg1=(filter1*filter2'); % make 2D windowing function that is sized to match imageImage1=double(image1).*filtimg1; % apply windowing function to imageImage2=double(image2).*filtimg1;FFT1 = fft2(Image1); % 2d FFTFFT2 = conj(fft2(Image2)); FFTR = FFT1.*FFT2; % G1*G2复共轭magFFTR = abs(FFTR); %sqrt(real^2 + imag^2) 幅值FFTRN = (FFTR./magFFTR);result = ifft2(double(FFTRN)); figure;colormap('gray'); % choose colormap for plottingimagesc(result);figure;colormap(jet);mesh(result);
- 相位相关matlab实现
- matlab实现相位解包裹
- Matlab关于相位相关用于图像配准
- matlab fft 幅度,相位
- 相位相关算法实现(Phase Correlation)(FFTW版)
- 相位相关算法
- 相位相关法介绍
- 分享Matlab相位声码器
- 相位技术的实现
- 相位相关影像匹配算法
- 数字图像处理,相位相关图像配准算法的C++实现
- 数字图像处理,相位相关图像配准算法的C++实现
- [Matlab]模拟相位调制寄解调
- matlab信号求相位简单例子
- 全相位FFT算法matlab的实
- 模板匹配&&频域相位相关
- matlab实现RBF的相关函数
- 功率谱密度相关方法MATLAB实现
- 论要不要重复造轮子
- wubi安装ubuntu后,增加swap大小,优化swap的使用参数-----------让ubuntu健步如飞,为编译android源码准备
- 纯CSS实现箭头旋转
- 郁闷的RecipientEditTextView!!!
- 中国的高速公路和美国接轨了?
- 相位相关matlab实现
- uva 10917 Walk Through the Forest(最短路+DP路径,4级)
- A - Hunters题解
- 将txt文件中的数据批量插入到数据库中SqlBulkCopy
- ubuntu下卸载mysql
- 用win7远程桌面连接ubuntu!!
- 初窥Linux 之 数据流重定向
- WSAEventSelect模型客户端代码示例
- 跟Google学习Android开发-起始篇-保存数据