How to do Interpolation for paired images.?

1 visualización (últimos 30 días)
Sebastian Joseph
Sebastian Joseph el 16 de Abr. de 2021
Comentada: Sebastian Joseph el 22 de Abr. de 2021
I have a pair of projected images of a 3d object and I want to find the intermediate image between the projected images by interpolation in Fourier domain. Eg the projected images are at 0 degree and 50°. How to find the intermediate image say @ 25° by interpolation 2/1 in fourier domain..??

Respuestas (1)

Matt J
Matt J el 16 de Abr. de 2021
  3 comentarios
Sebastian Joseph
Sebastian Joseph el 22 de Abr. de 2021
Editada: Matt J el 22 de Abr. de 2021
Hi,
I tried for one of the ways as shown in below for interpolation, but every time i am getting the result (attached) and is far away from which i want. I want a result similar to the input images but in a projection angle of 25 degree.
The code:.
%%
clc; clear all;
close all;
% Initialization of Input Images
A1 = im2double(rgb2gray(imread('cuphex 0degree.png')));
A5 = im2double(rgb2gray(imread('cuphex 50degree.png')));
% Fourier Transorm of Input Image
A1 = fftshift(fft2(ifftshift(1.*A1)));
A5 = fftshift(fft2(ifftshift(1.*A5)));
[M,N] = size(A1);
Nx = N;
Mx = 2*N;
height = size(A1,1);
width = size(A1,2);
%Taking Vectors from input images
for ii = 1:height
input_fftA1 = A1(ii,:,:);
input_fftA1(:,1:2:2*N) = A1(ii,:,:);
[x y] = size(input_fftA1);
[x0 y0] = meshgrid(1:y, 1:x);
input_fftA5 = A5(ii,:,:);
input_fftA5(:,2:2:2*N) = A5(ii,:,:);
[x1 y1] = size(input_fftA5);
[x01 y01] = meshgrid(1:y1, 1:x1);
% figure(1), imagesc(abs(input_fftA1));
% figure(3), imagesc(abs(input_fftA5));
end
% Interpolation Plane
mj1 = 1.5:2:2*Mx+1;
mj2 = 1.5:2:2*M+1;
mj3 = mj2'+mj1;
% figure(), plot(mj1);
% figure(), imagesc(mj1);
% hold all
% figure(), plot(mj2);
% figure(), imagesc(mj2);
% figure(), plot(mj3);
% figure(), imagesc(mj3);
% Interpolation
Out_img = interp2(x0,y0,mj3,x01,y01, 'linear'); %spline , 'extrap'
imagesc(Out_img);
out = Out_img;
out(isnan(out))=0;%replace Nan
plot(out);
out1=reshape(out,length(N),[]);
plot(out1);
imagesc(out1);
% IFFT of the result
% Fourier Transorm of Input Image
A3 = fftshift(ifft2(ifftshift(out1)));
imagesc(A3);
I am really got stucked with this. Could you let me know where i am making mistake..??
Sebastian Joseph
Sebastian Joseph el 22 de Abr. de 2021
I would like to have intermediate image between paired image. between 0 and 50 degree image. some what 25 degree image like this.(attached)

Iniciar sesión para comentar.

Categorías

Más información sobre Image Processing Toolbox en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by