plotshapes.m
来自「active shape model的matlab代码实现」· M 代码 · 共 34 行
M
34 行
function PlotShapes(Xu,str,ContoursEndingPoints);%function PlotShapes(Xu,str,ContoursEndingPoints);%ColorsArray={'y*','m*','c*','r*','g*','b*','k*'};%starsColorsArray={'y' ,'m' ,'c' ,'r' ,'g' ,'b' , 'k'}; %continousNumContours=length(ContoursEndingPoints);n=size(Xu,1);% m: 1st , 8th , 15th ... shape% c: 2nd , 9th , 16th% r: 3rd , 10th , 17th% g: 4th .% b: 5th . % k: 6th . % y: 7th , 14th ,21sttitle(str);hold onfor ind1=1:size(Xu,2), clr=ColorsArray{1+mod(ind1,length(ColorsArray))}; StartPoint=1; for ind2=1:NumContours, %plot closed contour-ind2 of shape-ind1 X=[Xu(StartPoint :ContoursEndingPoints(ind2) ,ind1);Xu(StartPoint ,ind1)]; Y=[Xu(StartPoint+n/2:ContoursEndingPoints(ind2)+n/2,ind1);Xu(StartPoint+n/2,ind1)]; plot(X,Y,clr); StartPoint=ContoursEndingPoints(ind2)+1; endend
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?