How to produce equally distant samples in Matlab?

8 visualizaciones (últimos 30 días)
Jamais avenir
Jamais avenir el 2 de Sept. de 2017
Editada: Jamais avenir el 4 de Sept. de 2017
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 comentarios
Walter Roberson
Walter Roberson el 4 de Sept. de 2017
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 el 4 de Sept. de 2017
Editada: Jamais avenir el 4 de Sept. de 2017
@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.

Iniciar sesión para comentar.

Respuestas (1)

Image Analyst
Image Analyst el 2 de Sept. de 2017
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 comentarios
Image Analyst
Image Analyst el 3 de Sept. de 2017
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 el 3 de Sept. de 2017
@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.

Iniciar sesión para comentar.

Categorías

Más información sobre Agriculture en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by