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?