공지사항:
2025년 4월 15일 전에 Earth Engine 사용을 위해 등록된 모든 비상업용 프로젝트는 Earth Engine 액세스를 유지하기 위해
비상업용 자격 요건을 인증해야 합니다.
ee.Algorithms.Image.Segmentation.GMeans
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
입력 이미지에 G-Means 클러스터링을 실행합니다. k-평균을 반복적으로 적용한 후 정규성 테스트를 실행하여 사용할 클러스터 수를 자동으로 결정합니다. 출력에는 각 픽셀이 속한 클러스터의 정수 ID가 포함된 '클러스터' 밴드가 포함됩니다. 이 알고리즘은 겹치지 않는 고정된 셀 그리드 (gridSize, 타일보다 작을 수 있음) 또는 겹치는 타일 (neighborhoodSize)에서 작동할 수 있습니다. 기본값은 겹치지 않는 타일을 사용하는 것입니다. 한 셀 또는 타일의 클러스터는 다른 셀의 클러스터와 관련이 없습니다. 셀 또는 타일 경계에 걸쳐 있는 클러스터는 두 절반에서 서로 다른 라벨을 받을 수 있습니다. 부분 마스크가 있는 입력 픽셀은 출력에서 완전히 마스크됩니다. 이 알고리즘은 동적 범위가 좁은 이미지 (바이트 또는 짧은 정수)에서만 성능이 우수할 것으로 예상됩니다.
G를 참고하세요. Hamerly 및 C. 엘칸 'Learning the k in k-means'. NIPS, 2003.
사용 | 반환 값 |
---|
ee.Algorithms.Image.Segmentation.GMeans(image, numIterations, pValue, neighborhoodSize, gridSize, uniqueLabels) | 이미지 |
인수 | 유형 | 세부정보 |
---|
image | 이미지 | 클러스터링할 입력 이미지입니다. |
numIterations | 정수, 기본값: 10 | 반복 횟수입니다. 기본값은 10입니다. |
pValue | 부동 소수점 수, 기본값: 50 | 정규성 검정의 유의 수준입니다. |
neighborhoodSize | 정수, 기본값: 0 | 이웃 크기입니다. 클러스터를 계산할 때 각 타일을 확장할 양 (중복)입니다. 이 옵션은 gridSize와 상호 배타적입니다. |
gridSize | 정수, 기본값: null | 그리드 셀 크기입니다. 0보다 큰 경우 kMeans가 이 크기의 셀에서 독립적으로 실행됩니다. 이렇게 하면 클러스터의 크기가 gridSize 이하로 제한됩니다. 이 옵션은 neighborhoodSize와 상호 배타적입니다. |
uniqueLabels | 불리언, 기본값: true | true인 경우 클러스터에 고유 ID가 할당됩니다. 그렇지 않으면 타일 또는 그리드 셀마다 반복됩니다. |
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-27(UTC)
[null,null,["최종 업데이트: 2025-07-27(UTC)"],[[["\u003cp\u003eThe GMeans algorithm automatically determines the optimal number of clusters for image segmentation using iterative k-means and a normality test.\u003c/p\u003e\n"],["\u003cp\u003eIt outputs an image with a 'clusters' band, assigning each pixel an integer ID corresponding to its cluster.\u003c/p\u003e\n"],["\u003cp\u003eUsers can control segmentation granularity through \u003ccode\u003egridSize\u003c/code\u003e for non-overlapping cells or \u003ccode\u003eneighborhoodSize\u003c/code\u003e for overlapping tiles.\u003c/p\u003e\n"],["\u003cp\u003eClusters are independent within each cell or tile, potentially leading to different labels for the same cluster across boundaries.\u003c/p\u003e\n"],["\u003cp\u003eThe algorithm is best suited for images with a narrow dynamic range, like those with byte or short data types.\u003c/p\u003e\n"]]],["The G-Means algorithm performs image clustering by iteratively applying k-means and a normality test to determine the optimal number of clusters. It outputs an image with a 'clusters' band, assigning each pixel to a cluster. It can operate on a fixed grid (gridSize) or tiles with overlap (neighborhoodSize), with default being tiles without overlap. Input images should have a narrow dynamic range and pixels with partial mask will be fully masked in the output. Clusters can be assigned unique ID's or repeat per tile.\n"],null,["# ee.Algorithms.Image.Segmentation.GMeans\n\nPerforms G-Means clustering on the input image. Iteratively applies k-means followed by a normality test to automatically determine the number of clusters to use. The output contains a 'clusters' band containing the integer ID of the cluster that each pixel belongs to. The algorithm can work either on a fixed grid of non-overlapping cells (gridSize, which can be smaller than a tile) or on tiles with overlap (neighborhoodSize). The default is to use tiles with no overlap. Clusters in one cell or tile are unrelated to clusters in another. Any cluster that spans a cell or tile boundary may receive two different labels in the two halves. Any input pixels with partial masks are fully masked in the output. This algorithm is only expected to perform well for images with a narrow dynamic range (i.e., bytes or shorts).\n\n\u003cbr /\u003e\n\nSee: G. Hamerly and C. Elkan. 'Learning the k in k-means'. NIPS, 2003.\n\n| Usage | Returns |\n|-------------------------------------------------------------------------------------------------------------------------------------------|---------|\n| `ee.Algorithms.Image.Segmentation.GMeans(image, `*numIterations* `, `*pValue* `, `*neighborhoodSize* `, `*gridSize* `, `*uniqueLabels*`)` | Image |\n\n| Argument | Type | Details |\n|--------------------|------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `image` | Image | The input image for clustering. |\n| `numIterations` | Integer, default: 10 | Number of iterations. Default 10. |\n| `pValue` | Float, default: 50 | Significance level for normality test. |\n| `neighborhoodSize` | Integer, default: 0 | Neighborhood size. The amount to extend each tile (overlap) when computing the clusters. This option is mutually exclusive with gridSize. |\n| `gridSize` | Integer, default: null | Grid cell-size. If greater than 0, kMeans will be run independently on cells of this size. This has the effect of limiting the size of any cluster to be gridSize or smaller. This option is mutually exclusive with neighborhoodSize. |\n| `uniqueLabels` | Boolean, default: true | If true, clusters are assigned unique IDs. Otherwise, they repeat per tile or grid cell. |"]]