I have the following code to load a bitmap from file, which is a 256x256 pixel gray scale image:
a = imread('E:\images\pic1.bmp');
a = double(a(:, :, 1));
figure;
imagesc(abs(a));
colormap(gray);
axis off;
axis equal;
title('Input image');
rpm1 = exp(i * 2 * pi * rand(256));
theta1 = 2 * pi * rand(256);
Iprime1 = fft2((sqrt(a) .* rpm1));
A = abs(Iprime1);
phi1 = angle(Iprime1);
W = A / 2;
Q = cos(phi1 - theta1);
T = W ./ Q
When I inspect output T
in Matlab it is a matrix containing values in the range of 0.0000 to 0.0009.
However, when I display W
and Q
separately and calculate T
manually for a single element, it comes out to be a non zero value.
What am I missing?