Earth Engine은 공유 컴퓨팅 리소스를 보호하고 모든 사용자에게 안정적인 성능을 보장하기 위해
비상업적 할당량 등급을 도입합니다. 모든 비상업용 프로젝트는
2026년 4월 27일까지 할당량 등급을 선택해야 하며, 선택하지 않으면 커뮤니티 등급이 기본적으로 사용됩니다. 등급 할당량은 등급 선택 날짜와 관계없이
2026년 4월 27일에 모든 프로젝트에 적용됩니다.
자세히 알아보기
ee.Algorithms.Image.Segmentation.SNIC
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
SNIC (Simple Non-Iterative Clustering)를 기반으로 하는 슈퍼픽셀 클러스터링입니다. 클러스터 ID 대역과 각 입력 대역의 클러스터별 평균을 출력합니다. 'seeds' 이미지가 입력으로 제공되지 않으면 출력에 생성된 시드 위치가 포함된 'seeds' 대역이 포함됩니다.
참고: Achanta, Radhakrishna 및 Susstrunk, Sabine, 'Superpixels and Polygons using Simple Non-Iterative Clustering', CVPR, 2017
| 사용 | 반환 값 |
|---|
ee.Algorithms.Image.Segmentation.SNIC(image, size, compactness, connectivity, neighborhoodSize, seeds) | 이미지 |
| 인수 | 유형 | 세부정보 |
|---|
image | 이미지 | 클러스터링을 위한 입력 이미지입니다. |
size | 정수, 기본값: 5 | 슈퍼픽셀 시드 위치 간격(픽셀 단위)입니다. 'seeds' 이미지가 제공되면 그리드가 생성되지 않습니다. |
compactness | 부동 소수점, 기본값: 1 | 압축 계수입니다. 값이 클수록 클러스터가 더 콤팩트 (정사각형)해집니다. 이 값을 0으로 설정하면 공간 거리 가중치가 사용 중지됩니다. |
connectivity | 정수, 기본값: 8 | 연결 4 또는 8입니다. |
neighborhoodSize | 정수, 기본값: null | 타일 경계 아티팩트를 방지하기 위한 타일 인접 크기입니다. 기본값은 2 * 크기입니다. |
seeds | 이미지, 기본값: null | 제공된 경우 0이 아닌 값의 픽셀이 시드 위치로 사용됩니다. '연결'에 지정된 대로 터치하는 픽셀은 동일한 클러스터에 속하는 것으로 간주됩니다. |
예
코드 편집기(JavaScript)
// Note that the compactness and size parameters can have a significant impact
// on the result. They must be adjusted to meet image-specific characteristics
// and patterns, typically through trial. Pixel scale (map zoom level) is also
// important to consider. When exploring interactively through map tile
// visualization, the segmentation result it dependent on zoom level. If you
// need to evaluate the result at a specific scale, call .reproject() on the
// result, but do so with caution because it overrides the default scaling
// behavior that makes tile computation fast and efficient.
// Load a NAIP image for a neighborhood in Las Vegas.
var naip = ee.Image('USDA/NAIP/DOQQ/m_3611554_sw_11_1_20170613');
// Apply the SNIC algorithm to the image.
var snic = ee.Algorithms.Image.Segmentation.SNIC({
image: naip,
size: 30,
compactness: 0.1,
connectivity: 8,
});
// Display the original NAIP image as RGB.
// Lock map zoom to maintain the desired scale of the segmentation computation.
Map.setLocked(false, 18, 18);
Map.setCenter(-115.32053, 36.182016, 18);
Map.addLayer(naip, null, 'NAIP RGB');
// Display the clusters.
Map.addLayer(snic.randomVisualizer(), null, 'Clusters');
// Display the RGB cluster means.
var visParams = {
bands: ['R_mean', 'G_mean', 'B_mean'],
min: 0,
max: 255
};
Map.addLayer(snic, visParams, 'RGB cluster means');
Python 설정
Python API 및 대화형 개발을 위한 geemap 사용에 관한 자세한 내용은
Python 환경 페이지를 참고하세요.
import ee
import geemap.core as geemap
Colab (Python)
# Note that the compactness and size parameters can have a significant impact
# on the result. They must be adjusted to meet image-specific characteristics
# and patterns, typically through trial. Pixel scale (map zoom level) is also
# important to consider. When exploring interactively through map tile
# visualization, the segmentation result it dependent on zoom level. If you
# need to evaluate the result at a specific scale, call .reproject() on the
# result, but do so with caution because it overrides the default scaling
# behavior that makes tile computation fast and efficient.
# Load a NAIP image for a neighborhood in Las Vegas.
naip = ee.Image('USDA/NAIP/DOQQ/m_3611554_sw_11_1_20170613')
# Apply the SNIC algorithm to the image.
snic = ee.Algorithms.Image.Segmentation.SNIC(
image=naip, size=30, compactness=0.1, connectivity=8
)
# Display the original NAIP image as RGB.
m = geemap.Map()
m.set_center(-115.32053, 36.182016, 18)
m.add_layer(naip, None, 'NAIP RGB')
# Display the clusters.
m.add_layer(snic.randomVisualizer(), None, 'Clusters')
# Display the RGB cluster means.
vis_params = {'bands': ['R_mean', 'G_mean', 'B_mean'], 'min': 0, 'max': 255}
m.add_layer(snic, vis_params, 'RGB cluster means')
m
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2026-04-20(UTC)
[null,null,["최종 업데이트: 2026-04-20(UTC)"],[],["SNIC clustering segments an image into superpixels, outputting cluster IDs and per-cluster averages for each input band. Key parameters include `size` (seed spacing), `compactness` (cluster shape), and `connectivity`. A user can provide `seeds` to define seed locations; otherwise, they are generated. The output `Image` includes cluster IDs, band averages, and optionally generated seed locations. Adjusting `size` and `compactness` is crucial for optimal results, which are also affected by pixel scale.\n"]]