フーリエ変換ホログラムの再生像を計算します.画像は png 形式の 8 ビットグレースケールで 256 x 256 ピクセルの場合です.
% CGH reconstruction
% read file
BMP = imread('cgh.png');
% fft
fmean = mean(BMP(:));
W0 = double(BMP) - fmean;
W1 = fftshift(fftn(W0));
W2 = real(W1 .* conj(W1));
fmax = max(W2(:)) / 255.0;
W3 = W2 / fmax;
% write file
imwrite(uint8(W3),'saisei.png');
% End of file


再生像の計算結果(saisei.png)
解説
(準備中)