Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: point clouds
Replies: 0

 Navaneetha Kannan Viswanathan Posts: 14 Registered: 1/19/11
point clouds
Posted: Mar 16, 2011 10:58 AM

Hi ,

This is my prog on isolating laser stripe from the set of images. My result for this script gives me the isolated laser stripe as an image. But, I want point cloud in 3D space.
Help me out.

source pics:

Script:

clear;
clc;
jpgFiles = dir('*.jpg');
for k = 1:length(jpgFiles)
filename = jpgFiles(k).name;
%imshow(data1);
[p1,q1]=find(250<=data1(:,:,1));
[p2,q2]=find(250<=data1(:,:,2));
[p3,q3]=find(250<=data1(:,:,2));
r1=[p1 q1];
r2=[p2 q2];
r3=[p3 q3];
s1=intersect(r1,r2,'rows');
s2=intersect(s1,r3,'rows');
t1=setdiff(r1,s2,'rows');

b=zeros(size(data1));
u1=mean(t1,1);
u2=std(t1,1)*0.6;
ul=round(u1+u2);
ll=round(u1-u2);
t1(t1(:,1)>ul(1),:)=[];
t1(t1(:,1)<ll(1),:)=[];
for i=1:length(t1)
b(t1(i,1),t1(i,2),1)=data1(t1(i,1),t1(i,2),1);
b(t1(i,1),t1(i,2),2)=data1(t1(i,1),t1(i,2),2);
b(t1(i,1),t1(i,2),3)=data1(t1(i,1),t1(i,2),3);
end
%figure
%imshow(b)
c=im2bw(b);
c=uint8(c);
data1(:,:,1)=data1(:,:,1).*c;
data1(:,:,2)=data1(:,:,2).*c;
data1(:,:,3)=data1(:,:,3).*c;
%figure(1),subplot(4,8,k),subimage(data1);
imshow(data1)
end;