.


:




:

































 

 

 

 


4:




bwtraceboundary (X, Y) - . , .

connectivity=8;
num_points=180;
contour=bwtraceboundary(BW, [row, col], 'N', connectivity, num_points);
imshow(RGB);
hold on;
plot(contour(:, 2), contour(:, 1), 'g', 'LineWidth', 2);

5: . : (x-xc)^2+(y-yc)^2=radius^2, (xc, yc) - . a, b, c x^2+y^2+a*x+b*y+c=0, a=-2*xc, b=-2*yc, c=xc^2+yc^2-radius^2 a, b, c . x=contour(:, 2);y=contour(:, 1); % % abc=[x y ones(length(x), 1)]\[-(x.^2+y.^2)];a=abc(1); b=abc(2); c=abc(3); % xc=-a/2;yc=-b/2;radius=sqrt((xc^2+yc^2)-c) % plot(xc, yc, 'yx', 'LineWidth', 2); % theta=0:0.01:2*pi; % % Xfit=radius*cos(theta)+xc;Yfit=radius*sin(theta)+yc;plot(Xfit, Yfit);message=sprintf(' %2.3f ', radius);text(15, 15, message, 'Color', 'y', 'FontWeight', 'bold'); radius= 80.7567

. , . . . .





:


: 2015-10-01; !; : 380 |


:

:

, .
==> ...

1767 - | 1587 -


© 2015-2024 lektsii.org - -

: 0.008 .