公告:所有在
2025 年 4 月 15 日之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件,才能继续使用 Earth Engine。
ee.Image.fastDistanceTransform
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
返回输入中距离最近的非零值像素的距离(由指定的距离指标确定)。输出包含给定邻域大小内的所有像素的值,而不考虑输入的掩码。注意:默认距离指标会返回平方距离。
用法 | 返回 |
---|
Image.fastDistanceTransform(neighborhood, units, metric) | 图片 |
参数 | 类型 | 详细信息 |
---|
此:image | 图片 | 输入图片。 |
neighborhood | 整数,默认值:256 | 邻域大小(以像素为单位)。 |
units | 字符串,默认值:“pixels” | 邻域的单位,目前仅支持“像素”。 |
metric | 字符串,默认值:“squared_euclidean” | 要使用的距离指标:选项包括“squared_euclidean”“manhattan”或“chebyshev”。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eCalculates the distance to the closest non-zero pixel for every pixel in an image, considering a specified neighborhood and distance metric.\u003c/p\u003e\n"],["\u003cp\u003eProvides flexibility in choosing neighborhood size, measurement units (currently only pixels), and distance metric (squared Euclidean, Manhattan, or Chebyshev).\u003c/p\u003e\n"],["\u003cp\u003eOutputs an image where each pixel value represents the calculated distance to its nearest non-zero pixel, including areas outside the input mask.\u003c/p\u003e\n"],["\u003cp\u003eDefaults to a neighborhood size of 256 pixels, uses pixels as the unit of measurement, and employs the squared Euclidean distance metric.\u003c/p\u003e\n"]]],[],null,["# ee.Image.fastDistanceTransform\n\nReturns 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.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|--------------------------------------------------------------------------|---------|\n| Image.fastDistanceTransform`(`*neighborhood* `, `*units* `, `*metric*`)` | Image |\n\n| Argument | Type | Details |\n|----------------|--------------------------------------|--------------------------------------------------------------------------------------------|\n| this: `image` | Image | The input image. |\n| `neighborhood` | Integer, default: 256 | Neighborhood size in pixels. |\n| `units` | String, default: \"pixels\" | The units of the neighborhood, currently only 'pixels' are supported. |\n| `metric` | String, default: \"squared_euclidean\" | Distance metric to use: options are \\`squared_euclidean\\`, \\`manhattan\\` or \\`chebyshev\\`. |"]]