Message Boards Message Boards

3
|
4488 Views
|
1 Reply
|
6 Total Likes
View groups...
Share
Share this post:

fixing “curpted” image in frequency domain

Posted 8 years ago

I would like to get some ideas how to fix the given image (specific solution) using frequency domain and fft.

the image:

input image

We can see that the image consist of 2 translated images and we want to translate them back. I know that i need to use the fact :

fft translation

I tried something like that (matlab code), but it's clearly that I am wrong:

FileName='dog.tif';

%--- Read Image ---
im = readImage(FileName);
imshow(im);

%--- apply FFT on the given image ---
fftIm = fftshift(fft2(im));

%--- apply LOG and abs for plotting the transform --- 
fLog = log(1 + abs(fftIm));

%----modify the image in the frequency domain-------
fftImMod=fftIm;
x=24;       %x distance between the 2 images
y=4;        %y distance between the 2 images
dimIm = 305; %the dimensions of the image NxM = 305x305 

for j=1:size(fftIm,1)

    for k=1:size(fftIm,2)

        fftImMod(j,k)=fftIm(j,k)/exp((-2*(pi)*i)*(j*x + k*y)/dimIm);

    end;
end;

%--- apply LOG and abs for plotting the reduced transform --- 
fLogAfterMod = log(1 + abs(fftImMod));

%--- return to the image space ---
result=ifft2(fftshift(fftImMod));


% --- display results ---
colormap(gray)
subplot(2,2,1),imagesc(im); title('Original Image')
subplot(2,2,2),imagesc(fLog); title('Fourier Image')
subplot(2,2,3),imagesc(fLogAfterMod); title('Fourier of modified image ')
subplot(2,2,4),imagesc(real(result)); title('Result Image')

the output:

output

I hope the question is clear... I'm new in Image Processing and very confused..

thanks!

POSTED BY: chagay chagay

@chagay chagay , is this homework? Since I think it's homework, I'll just say that you can cast this problem as an inverse convolution problem, and will leave the explanation open for now.

ImageDeconvolve looks reasonable fine:

enter image description here

POSTED BY: Matthias Odisio
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract