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