Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function main ()
- %Calcular el hologama y su reconstruccion
- l=533e-9;
- z=0.05*5;
- tax = 0.01 ;
- tay = 0.01 ;
- %% Generacion y carga de datos USAR siempre este esquema y
- %% notacion
- %imagen = imread('cuadrado.tif');
- imagen = imread('cameraman.tif');
- imagen=double(imagen);
- % padN=100;%para a�adir mas ceros a la imagen
- % imagen= padarray(imagen,[padN padN]);
- [m,n]=size(imagen);
- ccx=[1:n];
- ccy=[1:m];
- x= (-tax/2) + ccx*(tax/n);
- y= (-tay/2) + ccy*(tay/m);
- frex=(n/(tax^2))*x;
- frey=(m/(tay^2))*y;
- [XX,YY]=meshgrid(x,y);
- [fx,fy]=meshgrid(frex,frey);
- %% el codigo:
- %%Parameter(C(z,l),H(fx,fy,l,z));
- %img=mxcall(imagen,l,z,tax,tay,fx,fy,n,m);
- %figure;
- %imshow(imagen);
- %%img=fresnel(imagen,l,z,tax,tay,fx,fy,n,m);
- img=mxcall(imagen,l,z,tax,tay,fx,fy,n,m);
- % figure;
- % imshow(abs(img).^2,[]);colormap('jet');clrmenu
- %% estos parametros ajustan la interferencia entre onda objeto y haz
- %% referencia
- N=2.8;a=(l*n/(N*tax));
- b=max(max(abs(img)))*0.35; % controla la intensidad del haz de referencia
- hologram = abs( r(l,a,XX,YY,b) + img ).^2; %%este es el holograma
- %hologram = hologram .*r(l,a,XX,YY,b);%% esta opcion sirve para centrar la
- %reconstruccion. De momento no necesitamos esto!!
- figure;
- imshow((hologram),[]);
- title('holograma');colormap('jet');clrmenu
- rec=fresnel(hologram,l,-z,tax,tay,fx,fy,n,m); %% esta es la reconstruccion del holograma
- figure;
- imshow(abs(rec).^2,[]);colormap('jet');clrmenu
- title('rec');
- clear all;
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement