Problem 909. Image Processing 003: Interferometer Data Interpolation

Solution 172451

Submitted on 4 Dec 2012 by @bmtran (Bryant Tran)
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
w=100; [xm ym]=meshgrid(1:w); % simple ellipsoid z(xm(:)+(ym(:)-1)*w)=sqrt(1-(xm(:)/142).^2-(ym(:)/142).^2); z=reshape(z,w,w); z_orig=z; % used for performance check %figure(42);surf(z,'LineStyle','none') % or ellipsoid by for loops %for i=1:w % for j=1:w % z(i,j)=sqrt(1-(i/142)^2-(j/142)^2); % end %end z(50,50)=0; %figure(43);surf(z,'LineStyle','none') tic out = Fix_interferometer(z); toc delta=abs(out-z_orig); fprintf('Max delta=%e\n',max(delta(:))) assert(max(delta(:))<1e-4,sprintf('Max delta=%f\n',max(delta(:))))

Elapsed time is 0.260485 seconds. Max delta=3.330912e-05

2   Pass
%% % Load a real Interferometry Profile % Previously TriScatteredInterp corrected % Randomly induce Drop-Outs tic urlwrite('','Inter_zN.mat') load Inter_zN.mat toc zN_orig=zN; %figure(44);surf(zN_orig,'LineStyle','none') zN_idx=find(~isnan(zN)); for i=1:20 zN(zN_idx(randi(size(zN_idx,1))))=0; end %figure(45);surf(zN,'LineStyle','none') tic out = Fix_interferometer(zN); toc delta=abs(out-zN_orig); fprintf('Max delta=%e\n',max(delta(:))) % Threshold based on a handful of test cases assert(max(delta(:))<5e-7,sprintf('Max delta=%f\n',max(delta(:))))

ans = /users/msssytem8/Inter_zN.mat Elapsed time is 1.633319 seconds. Elapsed time is 2.698892 seconds. Max delta=1.427227e-07