ee.Image.fastDistanceTransform
Returns the distance, as determined by the specified distance metric, to the nearest non-zero valued pixel in the input. The output contains values for all pixels within the given neighborhood size, regardless of the input's mask. Note: the default distance metric returns squared distance.
Usage | Returns | Image.fastDistanceTransform(neighborhood, units, metric) | Image |
Argument | Type | Details | this: image | Image | The input image. |
neighborhood | Integer, default: 256 | Neighborhood size in pixels. |
units | String, default: "pixels" | The units of the neighborhood, currently only 'pixels' are supported. |
metric | String, default: "squared_euclidean" | Distance metric to use: options are `squared_euclidean`, `manhattan` or `chebyshev`. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-07-13 UTC.
[null,null,["Last updated 2024-07-13 UTC."],[[["Calculates the distance to the closest non-zero pixel for every pixel in an image, considering a specified neighborhood and distance metric."],["Provides flexibility in choosing neighborhood size, measurement units (currently only pixels), and distance metric (squared Euclidean, Manhattan, or Chebyshev)."],["Outputs an image where each pixel value represents the calculated distance to its nearest non-zero pixel, including areas outside the input mask."],["Defaults to a neighborhood size of 256 pixels, uses pixels as the unit of measurement, and employs the squared Euclidean distance metric."]]],[]]