Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How to plot result on my own image and not in x y plot with Points2circle ?

1 回表示 (過去 30 日間)
mika
mika 2014 年 5 月 20 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Can any one tell me how can i apply this code to my 1000*1000 image in a way that the results
appear on my image knowing that the results presented on XY plot fits my image (I prepared all
inputs)
Here is an Example of execution below:
%EXAMPLE
load('main3.mat')%contains a vector ending_pts
px=ending_pts(:,1)
py=ending_pts(:,2)
xyr = points2circle([px(:) py(:)]) ;
% create circle
t = linspace(0,2*pi,100) ;
xc = xyr(1) + xyr(3) * cos(t) ; yc = xyr(2) + xyr(3) * sin(t) ;
% make lines connecting center and points
x00 = [xyr([1 1 1]) ; px.' ; xyr([1 1 1])] ;
y00 = [xyr([2 2 2]) ; py.' ; xyr([2 2 2])] ;
% plot it nicely
h = plot(x00(:),y00(:),'k-', ... % connect center to points
px([1:3 1]),py([1:3 1]),'b:', ... % triangle
xc,yc,'r-', ... % circle
xyr(1),xyr(2),'r.', ... % center
px,py,'bo' ... % the three points
) ;
legend(h([5 3 4]),{'Points','Circle','Center'}) ;
axis square
Here is the source folder
below the image where i want to apply this Function "Points2circle" with red are ending_pts
Any ideas please!
Help is much appreciated
thx
  1 件のコメント
mika
mika 2014 年 5 月 21 日
any ideas please !
i'm just startig with matlab.

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by