close all
[row,col,v]=find(nyB<ny25);
P25=[nxB(row) nyB(row)];
figure(4);imshow(B);hold on;
plot(ones(1,sz2)*ny25,'r');
plot(P25(:,1),P25(:,2),'Color',[1 .5 .5],'LineStyle','none','Marker','.')
nP25=[1:1:length(P25)];
N=3;
s=1
str_color=['g' 'b' 'y'];
str_marker=['d' 'o' 's'];
Psct25=[];
while s<=N
n0=randi(numel(nP25),1,1);
figure(4);hold all;plot(P25(n0,1),P25(n0,2),'LineStyle','none','Color',str_color(s),'Marker',str_marker(s));
Psct25=[Psct25;P25(n0,:)];
P25(n0,:)=[];nP25(n0)=[];
s=s+1;
end
[row_up,col,v]=find(nyB<ny50);
[row_down,col,v]=find(nyB>ny25);
row=intersect(row_up,row_down);
P50=[nxB(row) nyB(row)];
figure(5);imshow(B);hold on;
plot(ones(1,sz2)*ny25,'r');
plot(ones(1,sz2)*ny50,'r');
plot(P50(:,1),P50(:,2),'Color',[1 .5 .5],'LineStyle','none','Marker','.')
nP50=[1:1:length(P50)];
N=3;
s=1
str_color=['g' 'b' 'y'];
str_marker=['d' 'o' 's'];
Psct50=[];
while s<=N
n0=randi(numel(nP25),1,1);
figure(5);hold all;plot(P50(n0,1),P50(n0,2),'LineStyle','none','Color',str_color(s),'Marker',str_marker(s));
Psct50=[Psct50;P50(n0,:)];
P50(n0,:)=[];nP50(n0)=[];
s=s+1;
end
[row_up,col,v]=find(nyB<ny75);
[row_down,col,v]=find(nyB>ny50);
row=intersect(row_up,row_down);
P75=[nxB(row) nyB(row)];
figure(6);imshow(B);hold on;
plot(ones(1,sz2)*ny75,'r');
plot(ones(1,sz2)*ny50,'r');
plot(P75(:,1),P75(:,2),'Color',[1 .5 .5],'LineStyle','none','Marker','.')
nP75=[1:1:length(P75)];
N=3;
s=1
str_color=['g' 'b' 'y'];
str_marker=['d' 'o' 's'];
Psct75=[];
while s<=N
n0=randi(numel(nP75),1,1);
figure(6);hold all;plot(P75(n0,1),P75(n0,2),'LineStyle','none','Color',str_color(s),'Marker',str_marker(s));
Psct75=[Psct75;P75(n0,:)];
P75(n0,:)=[];nP75(n0)=[];
s=s+1;
end
[row,col,v]=find(nyB>ny75);
P100=[nxB(row) nyB(row)];
figure(7);imshow(B);hold on;
plot(ones(1,sz2)*ny75,'r');
plot(P100(:,1),P100(:,2),'Color',[1 .5 .5],'LineStyle','none','Marker','.')
nP100=[1:1:length(P100)];
N=3;
s=1
str_color=['g' 'b' 'y'];
str_marker=['d' 'o' 's'];
Psct100=[];
while s<=N
n0=randi(numel(nP100),1,1);
figure(7);hold all;plot(P100(n0,1),P100(n0,2),'LineStyle','none','Color',str_color(s),'Marker',str_marker(s));
Psct100=[Psct100;P100(n0,:)];
P100(n0,:)=[];nP100(n0)=[];
s=s+1;
end