공지사항:
2025년 4월 15일 전에 Earth Engine 사용을 위해 등록된 모든 비상업용 프로젝트는 Earth Engine 액세스를 유지하기 위해
비상업용 자격 요건을 인증해야 합니다.
ee.Image.neighborhoodToArray
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
스칼라 이미지의 각 픽셀의 이웃을 2D 배열로 변환합니다. 출력 배열의 축 0과 1은 각각 이미지의 Y축과 X축에 해당합니다. 출력 이미지에는 입력과 동일한 수의 밴드가 있으며 각 출력 밴드에는 해당 입력 밴드와 동일한 마스크가 있습니다. 입력 이미지의 설치 공간과 메타데이터가 보존됩니다.
사용 | 반환 값 |
---|
Image.neighborhoodToArray(kernel, defaultValue) | 이미지 |
인수 | 유형 | 세부정보 |
---|
다음과 같은 경우: image | 이미지 | 픽셀을 가져올 이미지입니다. 스칼라 값이어야 합니다. |
kernel | 커널 | 이웃의 모양을 지정하는 커널입니다. 고정된 정사각형 및 직사각형 커널만 지원됩니다. 가중치는 무시되고 커널의 모양만 사용됩니다. |
defaultValue | 부동 소수점 수, 기본값: 0 | 출력 배열에서 입력의 잘못된 (마스크 처리된) 픽셀을 대체하는 데 사용할 값입니다. 대역 유형이 정수인 경우 이 값의 소수 부분이 삭제됩니다. 모든 경우에 값이 대역의 값 범위로 제한됩니다. |
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-26(UTC)
[null,null,["최종 업데이트: 2025-07-26(UTC)"],[[["\u003cp\u003eTransforms a scalar image into a 2D array representation of pixel neighborhoods.\u003c/p\u003e\n"],["\u003cp\u003eOutput array dimensions align with the image's Y and X axes, maintaining the input's band count and mask.\u003c/p\u003e\n"],["\u003cp\u003eUtilizes a kernel to define neighborhood shape, with optional defaultValue for handling masked pixels.\u003c/p\u003e\n"],["\u003cp\u003ePreserves original image metadata and footprint for seamless integration into workflows.\u003c/p\u003e\n"]]],["Transforms a scalar image by converting each pixel's neighborhood into a 2D array. The output array's axes 0 and 1 correspond to the image's Y and X axes, respectively. The method uses a `kernel` to define the neighborhood's shape (fixed, square, or rectangle). Invalid pixels within the input are replaced using a `defaultValue`. The input image's footprint, metadata, and mask are retained, but kernel weights are not considered. The method returns a new `Image`.\n"],null,["# ee.Image.neighborhoodToArray\n\nTurns the neighborhood of each pixel in a scalar image into a 2D array. Axes 0 and 1 of the output array correspond to Y and X axes of the image, respectively. The output image will have as many bands as the input; each output band has the same mask as the corresponding input band. The footprint and metadata of the input image are preserved.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|-------------------------------------------------------|---------|\n| Image.neighborhoodToArray`(kernel, `*defaultValue*`)` | Image |\n\n| Argument | Type | Details |\n|----------------|-------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `image` | Image | The image to get pixels from; must be scalar-valued. |\n| `kernel` | Kernel | The kernel specifying the shape of the neighborhood. Only fixed, square and rectangle kernels are supported. Weights are ignored; only the shape of the kernel is used. |\n| `defaultValue` | Float, default: 0 | The value to use in the output arrays to replace the invalid (masked) pixels of the input. If the band type is integral, the fractional part of this value is discarded; in all cases, the value is clamped to the value range of the band. |"]]