基于MATLAB的单目或双目结构光正弦条纹校准

简介: 基于MATLAB的单目或双目结构光正弦条纹校准

✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。

🍎个人主页:Matlab科研工作室

🍊个人信条:格物致知。

更多Matlab仿真内容点击👇

智能优化算法       神经网络预测       雷达通信      无线传感器        电力系统

信号处理              图像处理               路径规划       元胞自动机        无人机

⛄ 内容介绍

In this paper, for a phase measuring profilometry (PMP) system based on a digital light projector, a novel method of grating fringe quick pre-correction is proposed. In the actual engineering conditions, it is impractical to strictly limit the geometry of the system. So grating fringes on the reference plane often appear as distortions of keystone and period broadening, which are difficult to completely eliminate in the traditional calibration process. A precorrection method based on analytic spatial transform is designed to solve these problems individually. The correction process occurs before the digital micromirror device image is generated, and theoretically, it can be compatible with most existing PMP correction and calibration methods. The correction is simple and completely implicit, and does not require a special calibration target. The correction is quick, only needs to project and shoot a fringe pattern and a corner pattern, and can be completed within a few seconds. A simulation and several experiments were carried out to verify the effectiveness of this method.

⛄ 部分代码

clc

clear

close all

%% 使用PMP恢复圆锥并对比

% rootFolder = fullfile([pwd,'\PMPbefore1']);

rootFolder = fullfile([pwd,'\PMPafter1']);

imgSets = imageSet(rootFolder);%遍历文件夹

count=imgSets.Count(1,1);%文件夹内图像数

group=5;%5个为1组做一次PMP

num=floor(count/group);%定标次数

xy=2*pi/5;%投影光栅相移量

% h1=figure;

% I=read(imgSets,1);

% imshow(I,[]);

% title('第一幅图像,左上到右下选取ROI');

% [px1,py1]=ginput(2);

% close(h1);

% h2=figure;

% I=read(imgSets,count);

% imshow(I,[]);

% title('最后一幅图像,左上到右下选取ROI');

% [px2,py2]=ginput(2);

% px=[max([px1(1),px2(1)]);min([px1(2),px2(2)])];

% py=[max([py1(1),py2(1)]);min([py1(2),py2(2)])];

px=[109;903];

py=[181;741];

LX=px(2)-px(1);

LY=py(2)-py(1);


Ephase=cell(1,num);

for i=1:num

   B=cell(1,group);

   for j=1:group

       n=(i-1)*group+j;

       B{j}=read(imgSets,n);

       if size(B{j},3)==3

           B{j}=double(rgb2gray(B{j}));

       else

           B{j}=double(B{j});

       end

       B{j}=imcrop(B{j},[px(1) py(1) LX+1 LY+1]);

   end

   B{j}=B{j}.*255./(max(B{j}(:))-min(B{j}(:)));

   Ephase{i}=atan2( (2*(B{2}-B{4}))*sin(xy) ,(2*B{3}-B{1}-B{5}) );

   Ephase{i}=single(Ephase{i});

end

figure,imshow(B{end},[]);


% figure;mesh( Ephase{2});

unwrapPhase=cell(1,num);

cha_unwrapPhase=cell(1,num-1);

% figure;

for i=1:num

   unwrapPhase{i}=Miguel_2D_unwrapper(Ephase{i});

%     unwrapPhase{i}=GetUnwrappedPhase_Bone(Ephase{i},pi/2);

%     unwrapPhase{i}=Diamond(Ephase{i});

end

for i=1:num-1

   cha_unwrapPhase{i}=unwrapPhase{i+1}-unwrapPhase{1};

%     figure,mesh(-cha_unwrapPhase{i});

end

P=-cha_unwrapPhase{1};

[m,n]=size(P);

x=1:n;y=1:m;

[x,y]=meshgrid(x,y);

cankao=mean(mean(P(:,300:end)));

cankao = round(cankao/pi)*pi;

P=P-cankao;

figure,mesh(P);

view(3);

colormap gray

colorbar

figure,imshow(P,[]);

colorbar


disp(['Height is ',num2str(max(P(:)))])

% figure,plot3(x(:),y(:),P(:),'b.');


% figure,mesh(-unwrapPhase{1});

% figure,mesh(-unwrapPhase{2});

% save After1.mat P cankao

% save Before1.mat P cankao

⛄ 运行结果

⛄ 参考文献

⛳️ 代码获取关注我

❤️部分理论引用网络文献,若有侵权联系博主删除
❤️ 关注我领取海量matlab电子书和数学建模资料


相关文章
|
1月前
|
算法
【数学建模竞赛】Matlab逻辑规则,结构基础及函数
【数学建模竞赛】Matlab逻辑规则,结构基础及函数
26 0
|
7月前
MATLAB实战 | 平面桁架结构受力分析
平面桁架结构受力分析
217 0
|
7月前
|
机器学习/深度学习 传感器 算法
使用应用于环境振动数据的 SSI-COV 算法自动识别线状结构的模态参数附matlab代码
使用应用于环境振动数据的 SSI-COV 算法自动识别线状结构的模态参数附matlab代码
|
8月前
|
机器学习/深度学习 传感器 算法
【机械】基于偏微分方程工具箱 (TM)计算受压力载荷作用的结构板的挠度附matlab代码
【机械】基于偏微分方程工具箱 (TM)计算受压力载荷作用的结构板的挠度附matlab代码
|
8月前
|
数据可视化
创建和分析二维桁架和梁结构研究(Matlab代码实现)
创建和分析二维桁架和梁结构研究(Matlab代码实现)
|
8月前
【Hammerstein模型的级联】快速估计构成一连串哈默斯坦模型的结构元素研究(Matlab代码实现)
【Hammerstein模型的级联】快速估计构成一连串哈默斯坦模型的结构元素研究(Matlab代码实现)
|
8月前
|
传感器
【湍流介质的三维传播模拟器】全衍射3-D传播模拟器,用于在具有随机和背景结构的介质中传播无线电和光传播(Matlab代码实现)
【湍流介质的三维传播模拟器】全衍射3-D传播模拟器,用于在具有随机和背景结构的介质中传播无线电和光传播(Matlab代码实现)
|
10月前
|
算法
m基于滑膜变结构的倒立摆控制系统matlab仿真
m基于滑膜变结构的倒立摆控制系统matlab仿真
271 0
|
10月前
|
机器学习/深度学习 传感器 算法
基于Matlab模拟球面变频条纹
基于Matlab模拟球面变频条纹
|
11月前
|
存储 C++
MATLAB 之 常用内部函数,运算,字符串和结构数据与单元数据-2
在 MATLAB 中,有两种基本的数据类型,一个是数值型数据,一个是字符型数据或称字符串数据。 数值型数据比较好理解,是指能参与数值运算的数据,又分为整型、浮点型和复数型。 字符型数据在日常应用中则不太强调,但却是大量存在的,例如统计一篇英文文章中不同英文字母出现的次数,按姓名排序,等等。字符串数据由若干个字符组成,这些字符可以是计算机系统中允许使用的任何字符

热门文章

最新文章