ee.Image.neighborhoodToArray
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
همسایگی هر پیکسل در یک تصویر اسکالر را به یک آرایه دو بعدی تبدیل می کند. محورهای 0 و 1 آرایه خروجی به ترتیب با محورهای Y و X تصویر مطابقت دارند. تصویر خروجی به اندازه ورودی دارای باند خواهد بود. هر باند خروجی همان ماسک باند ورودی مربوطه را دارد. ردپای و ابرداده تصویر ورودی حفظ می شود.
استفاده | برمی گرداند | Image. neighborhoodToArray (kernel, defaultValue ) | تصویر |
استدلال | تایپ کنید | جزئیات | این: image | تصویر | تصویر برای گرفتن پیکسل از. باید دارای ارزش اسکالر باشد. |
kernel | هسته | هسته که شکل محله را مشخص می کند. فقط هسته های ثابت، مربع و مستطیل پشتیبانی می شوند. وزن ها نادیده گرفته می شوند. فقط از شکل هسته استفاده می شود. |
defaultValue | شناور، پیش فرض: 0 | مقدار مورد استفاده در آرایه های خروجی برای جایگزینی پیکسل های نامعتبر (ماسک شده) ورودی. اگر نوع باند یکپارچه باشد، قسمت کسری این مقدار کنار گذاشته می شود. در همه موارد، مقدار به محدوده مقدار باند بسته می شود. |
،همسایگی هر پیکسل در یک تصویر اسکالر را به یک آرایه دو بعدی تبدیل می کند. محورهای 0 و 1 آرایه خروجی به ترتیب با محورهای Y و X تصویر مطابقت دارند. تصویر خروجی به اندازه ورودی دارای باند خواهد بود. هر باند خروجی همان ماسک باند ورودی مربوطه را دارد. ردپای و ابرداده تصویر ورودی حفظ می شود.
استفاده | برمی گرداند | Image. neighborhoodToArray (kernel, defaultValue ) | تصویر |
استدلال | تایپ کنید | جزئیات | این: image | تصویر | تصویر برای گرفتن پیکسل از. باید دارای ارزش اسکالر باشد. |
kernel | هسته | هسته که شکل محله را مشخص می کند. فقط هسته های ثابت، مربع و مستطیل پشتیبانی می شوند. وزن ها نادیده گرفته می شوند. فقط از شکل هسته استفاده می شود. |
defaultValue | شناور، پیش فرض: 0 | مقدار مورد استفاده در آرایه های خروجی برای جایگزینی پیکسل های نامعتبر (ماسک شده) ورودی. اگر نوع باند یکپارچه باشد، قسمت کسری این مقدار کنار گذاشته می شود. در همه موارد، مقدار به محدوده مقدار باند بسته می شود. |
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\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. |"]]