基于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电子书和数学建模资料


相关文章
|
机器学习/深度学习 传感器 安全
基于matlab模拟微结构材料中的一维波传播
基于matlab模拟微结构材料中的一维波传播
|
机器学习/深度学习 算法
【MATLAB第34期】 MATLAB 2023年棕熊算法 BOA-LSTM时间序列预测模型 #含预测未来功能,以及优化结构层数及单双向类型 研究工作量丰富且新颖
【MATLAB第34期】 MATLAB 2023年棕熊算法 BOA-LSTM时间序列预测模型 #含预测未来功能,以及优化结构层数及单双向类型 研究工作量丰富且新颖
|
3月前
|
传感器 算法 安全
基于分布式模型预测控制DMPC的单向拓扑结构下异构车辆车队研究(Matlab代码实现)
基于分布式模型预测控制DMPC的单向拓扑结构下异构车辆车队研究(Matlab代码实现)
143 4
|
3月前
|
传感器 机器学习/深度学习 数据采集
【数据驱动】【航空航天结构的高效损伤检测技术】一种数据驱动的结构健康监测(SHM)方法,用于进行原位评估结构健康状态,即损伤位置和程度,在其中利用了选定位置的引导式兰姆波响应(Matlab代码实现)
【数据驱动】【航空航天结构的高效损伤检测技术】一种数据驱动的结构健康监测(SHM)方法,用于进行原位评估结构健康状态,即损伤位置和程度,在其中利用了选定位置的引导式兰姆波响应(Matlab代码实现)
119 1
|
3月前
|
数据采集 算法 前端开发
MATLAB|基于3D FDTD的微带线馈矩形天线分析[用于模拟超宽带脉冲通过线馈矩形天线的传播,以计算微带结构的回波损耗参数]
MATLAB|基于3D FDTD的微带线馈矩形天线分析[用于模拟超宽带脉冲通过线馈矩形天线的传播,以计算微带结构的回波损耗参数]
179 2
|
3月前
|
机器学习/深度学习 算法 调度
【图像分割】视网膜图像分割以提取血管的复杂结构(Matlab代码实现)
【图像分割】视网膜图像分割以提取血管的复杂结构(Matlab代码实现)
|
机器学习/深度学习 传感器 编解码
路径规划算法:基于晶体结构对优化的机器人路径规划算法- 附matlab代码
路径规划算法:基于晶体结构对优化的机器人路径规划算法- 附matlab代码
|
算法
【数学建模竞赛】Matlab逻辑规则,结构基础及函数
【数学建模竞赛】Matlab逻辑规则,结构基础及函数
246 0
|
机器学习/深度学习 传感器 算法
使用应用于环境振动数据的 SSI-COV 算法自动识别线状结构的模态参数附matlab代码
使用应用于环境振动数据的 SSI-COV 算法自动识别线状结构的模态参数附matlab代码

热门文章

最新文章