1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] Turn a convexhull defined by a list of 3D point coordinates into a 0-1 binary mask

Discussão em 'Python' iniciado por Stack, Setembro 8, 2025.

  1. Stack

    Stack Membro Participativo

    I have a convexHull given by a list of 3d point coordinate generated by scipy.spatial.ConvexHull. Now the question is, I want to turn this convexhull defined by the list of vertices into a 0-1 binary mask (an 0-1 only np array), points inside the convex hull region is 1 and points outside the hull region is 0. What should I do?

    Here is the key code I used to get the 3D convex hull:

    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


    What i want: create a 0-1 binary mask from the previous convexhull information

    Continue reading...

Compartilhe esta Página