ee.Image.spectralDistance
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.
Tính khoảng cách phổ trên mỗi pixel giữa hai hình ảnh. Nếu hình ảnh dựa trên mảng thì chỉ băng tần đầu tiên của mỗi hình ảnh được sử dụng; nếu không, tất cả các băng tần đều tham gia vào quá trình tính toán khoảng cách. Do đó, hai hình ảnh này dự kiến sẽ có cùng số lượng dải tần hoặc có cùng độ dài mảng một chiều.
Cách sử dụng | Giá trị trả về |
---|
Image.spectralDistance(image2, metric) | Hình ảnh |
Đối số | Loại | Thông tin chi tiết |
---|
this: image1 | Hình ảnh | Hình ảnh đầu tiên. |
image2 | Hình ảnh | Hình ảnh thứ hai. |
metric | Chuỗi, mặc định: "sam" | Chỉ số khoảng cách quang phổ cần sử dụng. Một trong các giá trị "sam" (spectral angle mapper), "sid" (spectral information divergence), "sed" (squared Euclidean distance) hoặc "emd" (earth movers distance). |
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\u003eComputes the spectral distance between two images on a per-pixel basis, considering either a single band or all bands depending on image type.\u003c/p\u003e\n"],["\u003cp\u003eImages must have the same number of bands or be 1-dimensional arrays of the same length.\u003c/p\u003e\n"],["\u003cp\u003eOffers various spectral distance metrics including SAM, SID, SED, and EMD, with SAM as the default.\u003c/p\u003e\n"],["\u003cp\u003eReturns a new image representing the calculated spectral distances.\u003c/p\u003e\n"],["\u003cp\u003eAccessible through the \u003ccode\u003espectralDistance()\u003c/code\u003e method applied to the first image, taking the second image and an optional metric as arguments.\u003c/p\u003e\n"]]],[],null,["# ee.Image.spectralDistance\n\nComputes the per-pixel spectral distance between two images. If the images are array based then only the first band of each image is used; otherwise all bands are involved in the distance computation. The two images are therefore expected to contain the same number of bands or have the same 1-dimensional array length.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|----------------------------------------------|---------|\n| Image.spectralDistance`(image2, `*metric*`)` | Image |\n\n| Argument | Type | Details |\n|----------------|------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `image1` | Image | The first image. |\n| `image2` | Image | The second image. |\n| `metric` | String, default: \"sam\" | The spectral distance metric to use. One of 'sam' (spectral angle mapper), 'sid' (spectral information divergence), 'sed' (squared Euclidean distance), or 'emd' (earth movers distance). |"]]