returns the foreground region in image as a BoundaryMeshRegion object.

Details and Options

  • ImageMesh works with arbitrary 2D and 3D images, taking the nonzero pixels of the image as foreground.
  • ImageMesh has the same options as BoundaryMeshRegion, with the following changes and additions:
  • CornerNeighborsTruewhether to connect foreground pixels diagonally across corners in 2D
    DataRangeAutomaticthe range of mesh coordinates to generate
    MethodAutomaticthe method to use
  • In 2D, possible settings for Method include:
  • "Exact"exact representation of the contour
    "LinearSeparable"approximate contour by local linear separation
    "MarchingSquares"contour computed using marching squares
    "DualMarchingSquares"contour computed using dual marching squares
  • In 3D, possible settings for Method include:
  • "Exact"exact representation of the surface
    "MarchingCubes"surface computed using marching cubes
    "DualMarchingCubes"surface computed using dual marching cubes


open allclose all

Basic Examples  (2)

Convert a 2D shape to a boundary mesh:

Click for copyable input

Convert a 3D image into mesh:

Click for copyable input

Options  (3)

Applications  (3)

Properties & Relations  (1)

See Also

Image  ArrayMesh  MeshRegion  BoundaryMeshRegion

Introduced in 2016