ee.Image.focalMode
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Áp dụng bộ lọc reducer() hình thái học cho từng dải tần của hình ảnh bằng cách sử dụng một hạt nhân được đặt tên hoặc tuỳ chỉnh.
Cách sử dụng | Giá trị trả về |
---|
Image.focalMode(radius, kernelType, units, iterations, kernel) | Hình ảnh |
Đối số | Loại | Thông tin chi tiết |
---|
this: image | Hình ảnh | Hình ảnh mà bạn muốn áp dụng các thao tác. |
radius | Độ chính xác đơn, mặc định: 1,5 | Bán kính của nhân cần sử dụng. |
kernelType | Chuỗi, mặc định: "circle" | Loại nhân cần sử dụng. Các lựa chọn bao gồm: "hình tròn", "hình vuông", "hình chữ thập", "hình dấu cộng", "hình bát giác" và "hình kim cương". |
units | Chuỗi, mặc định: "pixels" | Nếu bạn không chỉ định một hạt nhân, thì điều này sẽ xác định xem hạt nhân có ở dạng mét hay pixel. |
iterations | Số nguyên, mặc định: 1 | Số lần áp dụng hạt nhân đã cho. |
kernel | Kernel, mặc định: null | Nhân tuỳ chỉnh. Nếu được dùng, kernelType và bán kính sẽ bị bỏ qua. |
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[[["\u003cp\u003eApplies a morphological reducer filter to each band of an image using a pre-defined or custom kernel.\u003c/p\u003e\n"],["\u003cp\u003eThe filter can be customized using parameters such as radius, kernel type, units, and iterations.\u003c/p\u003e\n"],["\u003cp\u003eUsers can define their own kernel, overriding the default options of kernel type and radius.\u003c/p\u003e\n"],["\u003cp\u003eThe function returns a modified image after applying the specified operations.\u003c/p\u003e\n"]]],["The `focalMode()` function applies a morphological reducer filter to an image's bands. It uses a specified `kernelType` (circle, square, etc.) or a custom `kernel`, with a defined `radius` and measurement `units` (pixels or meters). The operation can be repeated `iterations` times. If a custom `kernel` is provided, the `kernelType` and `radius` are ignored. The function returns a new image with the filter applied.\n"],null,["# ee.Image.focalMode\n\nApplies a morphological reducer() filter to each band of an image using a named or custom kernel.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|------------------------------------------------------------------------------------------|---------|\n| Image.focalMode`(`*radius* `, `*kernelType* `, `*units* `, `*iterations* `, `*kernel*`)` | Image |\n\n| Argument | Type | Details |\n|---------------|---------------------------|------------------------------------------------------------------------------------------------------------|\n| this: `image` | Image | The image to which to apply the operations. |\n| `radius` | Float, default: 1.5 | The radius of the kernel to use. |\n| `kernelType` | String, default: \"circle\" | The type of kernel to use. Options include: 'circle', 'square', 'cross', 'plus', 'octagon', and 'diamond'. |\n| `units` | String, default: \"pixels\" | If a kernel is not specified, this determines whether the kernel is in meters or pixels. |\n| `iterations` | Integer, default: 1 | The number of times to apply the given kernel. |\n| `kernel` | Kernel, default: null | A custom kernel. If used, kernelType and radius are ignored. |"]]