by Anonymous » 09 Sep 2025, 15:37
Ich habe eine Konvexhull, die durch eine Liste der 3D -Punktkoordinate angegeben wird, die von scipy.spatial.convexhull erzeugt wird. Nun ist die Frage, dass ich diese konvexhull, die durch die Liste der Scheitelpunkte definiert ist, in eine 0-1-Binärmaske (ein 0: 1-NP-Array), Punkte innerhalb der konvexen Rumpfregion 1 und Punkte außerhalb der Rumpfregion beträgt 0. Was sollte ich tun?
Code: Select all
from scipy.spatial import ConvexHull
...
hull = ConvexHull(pts) # pts is a xyz-coordinate list of all points in a point clout
hull_vertices = pts[hull.vertices] # coordinates of the key points in the convexhull
Was ich möchte: Erstellen Sie eine 0-1-Binärmaske aus den vorherigen konvexhull-Informationen
Ich habe eine Konvexhull, die durch eine Liste der 3D -Punktkoordinate angegeben wird, die von scipy.spatial.convexhull erzeugt wird. Nun ist die Frage, dass ich diese konvexhull, die durch die Liste der Scheitelpunkte definiert ist, in eine 0-1-Binärmaske (ein 0: 1-NP-Array), Punkte innerhalb der konvexen Rumpfregion 1 und Punkte außerhalb der Rumpfregion beträgt 0. Was sollte ich tun?[code]from scipy.spatial import ConvexHull
...
hull = ConvexHull(pts) # pts is a xyz-coordinate list of all points in a point clout
hull_vertices = pts[hull.vertices] # coordinates of the key points in the convexhull
[/code]
Was ich möchte: Erstellen Sie eine 0-1-Binärmaske aus den vorherigen konvexhull-Informationen