叶片表面水分的相变/相移

问题描述

我正在用Matlab写一个相位检索算法,我有几张不同的图像代表叶片表面上不同的水分(叶片表面水分),需要插入算法中才能看到相变/相移。发生在叶片表面每毫米的水中,但我不太确定如何查看每个图像的相变/相移并进行比较。是否在图表中表示相变/相移,或者还有其他方法可以查看相变/相移?我要绘制相位还是获取值?我可以为此提供一些帮助吗?谢谢。

编辑:我现在正在做的主题是干涉测量,它会在每个图像上产生条纹。这些条纹中的每一个都将包含相位值/信息,我的代码假定要做的是检索每个图像的相位信息/值,然后我需要查看每个图像上发生的相位变化/相移,但是我我不确定该怎么做,但我没有做到。基于该算法,我需要证明随着水分含量的增加/减少,相位值也将增加/减少/相位值将朝着可能的程度移动。现在我不知道我是否想通过图形或其他方法查看每个图像的相变/相移。我已附上一张图像,以显示输入图像的示例。Figure: Interferogram for different ml of water希望对此有所帮助。谢谢。

编辑2:image of a sample graph

这是我的代码

close all; clc; workspace; 
Iterations = 1100;       %Number of iterations 
p = 0.1;                 %Time to pause between display of images 
tic;                     %Timer Initialization
error = [];
%This whole part is to generate a mesh plot,i still dont kNow what info
%can get from here but just leave it first. 
x = linspace(-10,10,256);
y = linspace(-10,256);
[X,Y] = meshgrid(x,y);
x0 = 0;              % Center
y0 = 0;              % Center
sigma = 2;       % Beam Waistfringes
A = 1;               % Peak of the Beam 
%These 2 lines,res and Source,is basically input intensity. U need
%this in order to get the exponential image to process ltr.
res = ((X-x0).^2 + (Y-y0).^2)./(2*sigma^2);  
Source = A  .* exp(-res); 
%These 2 lines is for mesh plot also,ignore first
surf(Source);
shading interp 
%reading Fringe Image (Target)
Target = imread('0ml(1).jpeg');
Target = rgb2gray(Target);
Target = im2double(Target);
%Get the size of Target
[rowsimgA,colsimgA,numberOfColorChannelsimgA] = size(Source);
[rowsimgB,colsimgB,numberOfColorChannelsimgB] = size(Target);
%imresize function is basically to resize any image to a particular size.
%In this code u can see that i resize the Source beam input to the same
%size as the target image in the format of (Target,[rows,columns])
if rowsimgB ~= rowsimgA || colsimgA ~= colsimgB
    Target = imresize(Target,[rowsimgA colsimgA]); 
end
%FFT process
A = fftshift(ifft2(fftshift(Target)));
%Initiate loop
% The loop im not too sure yet,but basically when u multiplay the source
% and the phase,u produce exponential image,and then u do fft and ifft in
% order to reconstruct the image.
for i = 1:Iterations
  B = abs(Source) .* exp(1i*angle(A)); 
  C = fftshift(fft2(fftshift(B)));
  D = abs(Target) .* exp(1i*angle(C));
  A = fftshift(ifft2(fftshift(D)));
  error = [error; (1/sqrt(rowsimgA*colsimgA)*sqrt(sum(sum(abs(C)-abs(Target)).^2)))];  
end
%display Outputs
figure(2),imagesc(Target),colorbar,title('Original Fringe')
figure(3),i = 1:1:i; plot(i,(error')); title('Error');
%Phase Mask
figure(4),imagesc(angle(A)),title('Phase Mask');
%Last Pattern
figure(5),imagesc(abs(C)),title('Reconstructed Image');
%reconstructed Image (Phase Only)
figure(6),imagesc(angle(D)),title('Reconstructed Image (Phase Only)');
%reconstructed Image (Amplitude Only)
figure(7),imagesc(abs(D)),title('Reconstructed Image (Amplitude Only)');
%display Total Time Taken for Phase Retrieval
toc; 

`

解决方法

我认为在解决您的问题之前可能需要澄清一些方面。

首先,您似乎正在使用Gerchberg-Saxton算法,这确实是最常见的相位检索算法。按照其原始形式,它旨在解决可能与您的问题非常相似的特定问题:您想知道字段的幅度,但只能测量幅度。这是很常见的,例如在光学系统中,相机仅测量强度。 G&S提出的解决方案是测量幅度,然后将一些已知的变换应用于场,例如使用透镜进行的傅立叶变换,然后再次测量幅度。事实证明,如果您知道变换前后的场强,并且知道变换本身,则可以使用G-S算法推断相位。我想这就是你的追求。

似乎您已经基于Wikipedia页面上的G-S算法。这解决了全息术中经常发现的稍微不同的问题。在这种情况下,您将拥有高斯激光束,可以随意调整相位,但是无法控制振幅。然后,您进行傅立叶变换,例如使用镜头,然后要创建特定的强度模式。事实证明,G-S算法也允许您执行此操作,但是算法的形式略有不同。这就是Wikpedia页面上显示的内容。

就您而言,您不想假设高斯输入字段。取而代之的是,您要使用与转换之前相对应的测量字段,并使用与转换之后相对应的不同测量字段。从您的问题尚不清楚您是否实际上同时拥有这两个。如果不这样做,则可能需要更改光学设置。另外,我相信这只有在您使用相干光照明的情况下才能起作用。

最后,要解决您的实际问题,您应该考虑阶段的含义。在您的情况下,相变是由与水相比更长的通过水的路径长度引起的。因此,您正在测量水的“厚度”。如果水的厚度在图像上随空间变化,则应绘制相位图像,这确实是您在此处所做的:

imagesc(angle(A))

请紧记,相位会回绕,因此,如果水的厚度大于波长,则会出现条纹,因此推断出实际的水厚度可能很棘手。

编辑(响应OP的编辑):

这又是一个有点不同的问题,我认为Gerchberg-Saxton算法不会在这里为您提供帮助。相反,我建议研究离轴全息术。这涉及到以一个角度干扰您的目标光束和参考光束,您似乎已经这样做了(?)。

要计算相位,您必须先进行傅立叶变换,空间滤波和傅立叶逆变换。 Popoff在他的网站https://www.wavefrontshaping.net/post/id/12上对此提供了易于理解的解释,并且对此也有一些不错的论文,例如Verrier和Atlan在Applied Optics 2011中给出的概述。