公告:所有在
2025 年 4 月 15 日之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件,才能继续使用 Earth Engine。
ee.Image.connectedComponents
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
查找输入中第一个波段具有相同值的连通分量,并使用全局唯一值标记它们。连通性由给定的内核指定。大于 maxSize 的对象会被视为背景并进行遮盖。
用法 | 返回 |
---|
Image.connectedComponents(connectedness, maxSize) | 图片 |
参数 | 类型 | 详细信息 |
---|
此:image | 图片 | 要添加标签的图片。 |
connectedness | 内核 | 连通性核。 |
maxSize | 整数 | 要添加标签的对象的最大尺寸。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eIdentifies and labels connected regions within an image that share the same value in the first band.\u003c/p\u003e\n"],["\u003cp\u003eUtilizes a user-defined kernel to determine the connectivity between pixels for region identification.\u003c/p\u003e\n"],["\u003cp\u003eAssigns a unique label to each connected component, differentiating them for analysis.\u003c/p\u003e\n"],["\u003cp\u003eMasks and excludes objects exceeding a specified maximum size, treating them as background.\u003c/p\u003e\n"]]],[],null,["# ee.Image.connectedComponents\n\nFinds connected components with the same value of the first band of the input and labels them with a globally unique value. Connectedness is specified by the given kernel. Objects larger than maxSize are considered background, and are masked.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|-----------------------------------------------------|---------|\n| Image.connectedComponents`(connectedness, maxSize)` | Image |\n\n| Argument | Type | Details |\n|-----------------|---------|----------------------------------------|\n| this: `image` | Image | The image to label. |\n| `connectedness` | Kernel | Connectedness kernel. |\n| `maxSize` | Integer | Maximum size of objects to be labeled. |"]]