ช่วยอธิบายโค้ดนี้ให้หน่อยได้ไหมค่ะว่าทำงายังไง
function [ra,n] = computerR(I,ra,n);
[centers,radii] = imfindcircles(I,[20 100],'ObjectPolarity','dark');
[centers,radii] = imfindcircles(I,[20 100],'ObjectPolarity','dark','Sensitivity',0.9);
length(centers);
[n r]=size(radii);
table_c = [];
ra = zeros(n,1);
for i=1:n %??????????????
ra(i,1) = radii(i);
if ra(i,1) viscircles(centers(i,, ra(i,1),'EdgeColor','b');
else if ra(i,1) viscircles(centers(i,, ra(i,1),'EdgeColor','y');
else if ra(i,1) viscircles(centers(i,, ra(i,1),'EdgeColor','r');
else if ra(i,1) viscircles(centers(i,, ra(i,1),'EdgeColor','g');
else if ra(i,1) viscircles(centers(i,, ra(i,1),'EdgeColor','m');
else if ra(i,1) viscircles(centers(i,, ra(i,1),'EdgeColor','c');
end
end
end
end
end
end
end
length(centers)
สองบรรทัดนี้ทำงานยังไงค่ะ
length(centers);
[n r]=size(radii);
ให้รู้เรื่อง matlab ช่วยหน่อยค่ะ
function [ra,n] = computerR(I,ra,n);
[centers,radii] = imfindcircles(I,[20 100],'ObjectPolarity','dark');
[centers,radii] = imfindcircles(I,[20 100],'ObjectPolarity','dark','Sensitivity',0.9);
length(centers);
[n r]=size(radii);
table_c = [];
ra = zeros(n,1);
for i=1:n %??????????????
ra(i,1) = radii(i);
if ra(i,1) viscircles(centers(i,, ra(i,1),'EdgeColor','b');
else if ra(i,1) viscircles(centers(i,, ra(i,1),'EdgeColor','y');
else if ra(i,1) viscircles(centers(i,, ra(i,1),'EdgeColor','r');
else if ra(i,1) viscircles(centers(i,, ra(i,1),'EdgeColor','g');
else if ra(i,1) viscircles(centers(i,, ra(i,1),'EdgeColor','m');
else if ra(i,1) viscircles(centers(i,, ra(i,1),'EdgeColor','c');
end
end
end
end
end
end
end
length(centers)
สองบรรทัดนี้ทำงานยังไงค่ะ
length(centers);
[n r]=size(radii);