How to plot the height of a laser line in an intensity image?

2 views (last 30 days)
Dear all,
I want to make a mesh plot of 150 intensity images with a laser line on every image. The goal is to generate a mesh plot of the laser lines, so I get a visualisation of the object I scanned with the laser. This is my Matlab code
% my code
%threshold=235;
modelx=[];
modely=[];
modelz=[];
for i = 1:150;
filename = strcat('frame', num2str(i), '.jpg');
frame = imread(filename);
[x,y]=meshgrid(1:size(frame,1), 1:size(frame,2));
red_frame=frame(:,:,1);
%laser rgb values, row
[z,row]=max(red_frame);
modelx=x;
modely=y;
end;
mesh(modelx,modely,modelz);
end
The problem is I don't know how I plot/calculate the z-values of the laser with corresponding x and y values.
I hope someone can help me!

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!