首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >叶片表面水分的相变/相移

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

Stack Overflow用户
提问于 2020-11-07 20:45:36
回答 1查看 74关注 0票数 0

我正在用Matlab编写一个相位恢复算法,我有一些不同的图像,它们代表了叶表面上不同毫升的水(叶表面水分),需要插入到算法中,以查看在叶表面上每毫米水中发生的相变/相移,但我不太确定如何查看每个图像的相变/相移并进行比较。我是在图中表示相变/相移,还是有其他方法来查看相变/相移?我是绘制相位图还是得到一个值?我能得到一些帮助吗?谢谢。

编辑:我现在正在做的主题是干涉测量,它会在每一张图像上产生条纹。这些条纹中的每一个都将包含相位值/信息,我的代码假定要做的是检索每个图像的相位信息/值,然后我需要查看每个图像上发生的相变/相移,但我不确定如何才能做到这一点,并且我无法做到这一点。基于该算法,我需要证明随着湿度的增加/减少,相位值也会增加/减少/相位值将如何移动。现在我不知道我是否应该通过图表或其他方法来查看每个图像的相变/相移。我附上了一张图片来显示输入图片的例子。Figure: Interferogram for different ml of water我希望我能在这方面得到一些帮助。谢谢。

编辑2:image of a sample graph

下面是我的代码:

代码语言:javascript
复制
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,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)), colorbar, title('Reconstructed Image');
%Reconstructed Image (Phase Only)
figure(6), imagesc(angle(D)), colorbar, title('Reconstructed Image (Phase Only)');
%Reconstructed Image (Amplitude Only)
figure(7), imagesc(abs(D)), colorbar, title('Reconstructed Image (Amplitude Only)');
%Display Total Time Taken for Phase Retrieval
toc; 

`

EN

回答 1

Stack Overflow用户

发布于 2020-11-08 00:53:45

我觉得在回答你的问题之前,可能有几个方面需要澄清。

首先,您似乎正在使用Gerchberg-Saxton算法,它确实是最常见的相位恢复算法。在最初的形式中,这是为了包装一个可能与您的问题非常相似的特定问题:您想知道场的大小和相位,但只能测量大小。这很常见,例如在光学中,相机仅测量强度。G&S提出的解决方案是测量震级,然后对场应用一些已知的变换,例如使用透镜的傅立叶变换,然后再次测量震级。事实证明,如果你知道变换前后的场的大小,并且知道变换本身,你就可以使用G-S算法推断相位。我想这就是你要找的东西。

看起来你是以维基百科的G-S算法为基础的。这是在解决全息术中经常发现的一个略微不同的问题。在这种情况下,你有一个高斯激光束,对于它,你可以用任何你喜欢的方式来调制相位,但你无法控制振幅。然后你对这个场进行傅里叶变换,例如使用透镜,然后你想要创建一个特定的强度模式。事实证明,G-S算法也允许这样做,但算法的形式略有不同。这是Wikpedia页面上显示的内容。

就您而言,您不希望假设为高斯输入域。相反,您希望使用对应于变换前的测量场和对应于变换后的不同测量场。从你的问题中还不清楚你是否真的同时拥有这两个。如果没有,您可能需要更改您的光学设置。另外,我相信这只有在你用相干光照明的情况下才会起作用。

最后,为了解决您的实际问题,您应该考虑阶段的含义。在你的例子中,相位的变化是由于水中的路径长度比空气中的路径更长所致。因此,你正在测量水的“厚度”。如果水的厚度在你的图像上发生空间变化,你应该绘制一个相位图像,这就是你在这里所做的:

图像(角度(A))

请记住,相位是包裹的,所以如果你有超过波长的水的厚度,你会得到条纹,并且可能很难推断实际的水厚度。

编辑(响应OP的编辑):

这又是一个有点不同的问题,我认为Gerchberg-Saxton算法在这里不会对您有所帮助。相反,我建议研究离轴全息术。这包括以一定的角度干涉你的物体光束和参考光束,你似乎已经这样做了(?)。

要计算相位,必须进行傅里叶变换、空间滤波和反傅立叶变换。波波夫在他的网站上为此提供了一个可访问的解释:https://www.wavefrontshaping.net/post/id/12,也有一些关于这方面的好论文,例如Verrier和Atlan在2011年的应用光学中给出的概述。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64727786

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档