필터 지우기
필터 지우기

Calculating distance from central point to perimeter of shape engulfing central point.

조회 수: 5 (최근 30일)
Hi all, I'm trying to make a code which takes a non-moving graph point and calculates the distance from that point to the nearest perimeter point of a shape surrounding it. The shape may vary in sides and location relative to that central point, but the central point will always be located inside of the shape. English is not my first language, so pardon me if this is unprofessionally written. I will attempt to clarify further if it is needed. Thanks, all.

채택된 답변

Matt J
Matt J 2018년 7월 10일
편집: Matt J 2018년 7월 10일
How is the shape represented? As an image? If so, bwdist() will give you the result directly. You could also do
[i,j]=find(yourImage);
mindist=min( (i-i0).^2 + (j-j0).^2 );

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by