0

I am new to image processing. I have made a program on Discrete Fourier Transform. I am able to get an inverse image from (magnitude + phase) information. Also I am able to get inverse image from only magnitude part but I am not able to get the inverse image from phase information only. I am doing this.

for(u=0;u<63;u++)
for(v=0;v<63;v++)
{
rl=std::real(F[u][v]);   //F[u][v] contains DFT coefficients
img=std::imag(F[u][v]);
phase = atan2(img,rl);   // phase angle image is found
auto c1 = std::complex<double>(cos(phase), sin(phase));
p[u][v]=c1;
}

Then I am finding the inverse image as following:

f(x,y)= ∑(u=0) to (M-1)∑(v=0) to (N-1) |p(u,v)| exp ^ j2pi(ux/M+vy/N)

Am I doing it right? Please help?

sony
  • 1
  • It looks right, but the result will be pretty much meaningless, since all the magnitudes are 1. – Paul R Oct 10 '14 at 09:49
  • Actually I am getting a total black image – sony Oct 10 '14 at 09:54
  • and do i need to use absolute value of p(u,v) as I have done above? – sony Oct 10 '14 at 09:55
  • I have seen in some tutorials which shows some outline of image if reconstructed from phase information but I am getting total black. – sony Oct 10 '14 at 09:57
  • Well it depends on how you are displaying your image, but if all your magnitudes are 1 then the image will most likely be very dark - you probably need to scale it up to make it visible. – Paul R Oct 10 '14 at 10:29

0 Answers0