Borrar filtros
Borrar filtros

how can I make these image?

1 visualización (últimos 30 días)
DOHYUN JANG
DOHYUN JANG el 18 de Nov. de 2019
Respondida: Subhadeep Koley el 21 de Nov. de 2019
no11=imread('no1.jpg');
no22=imread('no2.jpg');
bno1 = rgb2gray(no11);
bno2 = rgb2gray(no22);
subplot(2,2,1); imshow(bno1);
subplot(2,2,2); imshow(bno2);
mag1 = abs(fft2(bno1));
mag2 = abs(fft2(bno2));
phas1 = angle(fft2(bno1));
phas2 = angle(fft2(bno2));
C = imfuse(phas1,mag2);
D = imfuse(phas2,mag1);
A = ifft2(C);
B = ifft2(D);
subplot(2,2,3); imshow(A);
subplot(2,2,4); imshow(B);
this is my code and i tried to get the picture of
but the result is
How should I fix it??
  4 comentarios
Walter Roberson
Walter Roberson el 18 de Nov. de 2019
Try imshow(A,[])
DOHYUN JANG
DOHYUN JANG el 18 de Nov. de 2019
its same..

Iniciar sesión para comentar.

Respuestas (1)

Subhadeep Koley
Subhadeep Koley el 21 de Nov. de 2019
Dohyun, I think you could take the image 'pixel magnitude' instead of the 'fourier magnitude' to get the output you want. Also, in my opinion it is important ro rescale() the cofficients prior fusing. Refer the the code below.
no11=rescale(double(imread('no1.jpg')));
no22=rescale(double(imread('no2.jpg')));
bno1 = rgb2gray(no11);
bno2 = rgb2gray(no22);
subplot(2,2,1); imshow(bno1); title('Img1');
subplot(2,2,2); imshow(bno2); title('Img2');
phas1 = rescale(angle(fft2(bno1)));
phas2 = rescale(angle(fft2(bno2)));
C = rescale(double(imfuse(phas1,no22,'blend','Scaling','joint')));
D = rescale(double(imfuse(phas2,no11,'blend','Scaling','joint')));
subplot(2,2,3); imshow(C); title('Img1 magnitude + Img2 phase');
subplot(2,2,4); imshow(D); title('Img2 magnitude + Img1 phase');
fourierPlots.png
Hope this helps!

Categorías

Más información sobre Import, Export, and Conversion en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by