光电工程师社区
标题:
求助!急!
[打印本页]
作者:
yulu
时间:
2009-9-24 15:07
标题:
求助!急!
计算全息图的制作及再现
代码:
close all;clear all;clc;
o=imread('cat.bmp');
o=rgb2gray(o);
o=double(o);
figure;
imshow(o,[]);title('原始图像');
odot=sqrt(o).*exp(i*2*pi*(rand(size(o))-0.5));
circle=50;
for m=1:circle
o1=fftshift(fft2(fftshift(odot)));
o2=fftshift(ifft2(fftshift(exp(i*angle(o1)))));
odot=sqrt(o).*exp(i*angle(o2));
end
P=angle(o1);
P=mat2gray(P);
imwrite(P,'yulu.bmp');
output=abs(o2).^2;
imwrite(output,'kittyk.bmp');
figure;
imshow(output,[]);title('全息图像');
在Matlab里运行显示的两幅图像都正常,但是运行后储存的全息图像'kittyk.bmp'是全黑的,各位高手能不能帮忙分析一下问题出在哪?感激不尽
作者:
chunchangxiang
时间:
2010-11-19 10:00
作者:
chunchangxiang
时间:
2010-11-19 10:00
作者:
chunchangxiang
时间:
2010-11-19 10:00
作者:
chunchangxiang
时间:
2010-11-19 10:00
欢迎光临 光电工程师社区 (http://bbs.oecr.com/)
Powered by Discuz! X3.2