필터 지우기
필터 지우기

How to produce equally distant samples in Matlab?

조회 수: 10 (최근 30일)
Jamais avenir
Jamais avenir 2017년 9월 2일
편집: Jamais avenir 2017년 9월 4일
I am interested to produce equally distant samples inside a closed n-dim space whereas each generated point has the same distance to its neighboring points. Is there any matlab function or method to do this?
Let's say we have a vector in 2D system with known coordination for the tip and tail of that vector. How to find equally distant samples over this vector? Let's assume we have a regular triangle shape and the coordination of the edges in the 3-dim Cartesian system is known. How to find equally distant samples in this shape? Last, what if the shape is not regular and has curvature arms (curves connecting the edges). Assume there are some known points (coordination) on the arms. How to find equally distant samples in this shape. For first figure:
p1=[1,3];
p2=[5,4];
for triangle shape:
p1=[1,3,0];
p2=[5,4,1];
p3=[-1,2,4];
for the last shape, there are just some known points on the arms (red curves).
  댓글 수: 25
Walter Roberson
Walter Roberson 2017년 9월 4일
You cannot get a spatially-curved 3D figure from those points.
In your post https://www.mathworks.com/matlabcentral/answers/354968-how-to-produce-equally-distant-samples-in-matlab#comment_481591 you showed a diagram with a leaf, and that leaf appears to have a shadow. Are leaf and shadow images available? If so then it might be possible to deduce some 3D information (not easily though.)
Jamais avenir
Jamais avenir 2017년 9월 4일
편집: Jamais avenir 2017년 9월 4일
@Walter, Now I am thinking on the simplified model where the leaf lies on a plane. As an example I've generated some points which indicate the boundary of a namely leaf-shape and they stay on a plane. I am curious to see how one can generate evenly spaced samples inside this boundary perhaps with your polyfitn. For the realistic model, I will ask for more information about coordinates of some points around the boundary and inside the leaf in order to simulate and visualize it on a computer first. Additionally, that was an example, we don't have the shadow.

댓글을 달려면 로그인하십시오.

답변 (1개)

Image Analyst
Image Analyst 2017년 9월 2일
I don't see how having curved "arms" makes any difference if you're just interested in finding the point in the middle between three specified points.
Anyway, you can write those points to an image and use bwdist() to compute the Euclidean Distance Transform. You may need to use poly2mask() if you have a solid shape with "arms".
Attach input data and desired result if you want more help.
  댓글 수: 3
Image Analyst
Image Analyst 2017년 9월 3일
In your diagram, a point at the center of the hexagon is equidistant from only 6 other points and has different distances to all the other points.
Assuming that's what you want, you can generate such a hexagonal grid by simply making two simple rectangular grids and combining them, with one offset from the other by half a box.
Jamais avenir
Jamais avenir 2017년 9월 3일
@Image Analyst, Yes that's what I want. Would you give me some hint on how to do this on matlab please!
Generate such a hexagonal grid by simply making two simple rectangular grids and combining them, with one offset from the other by half a box.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Deep Learning for Image Processing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by