ee.Image.spectralDistance
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
คำนวณระยะห่างเชิงสเปกตรัมต่อพิกเซลระหว่างรูปภาพ 2 รูป หากรูปภาพเป็นแบบอาร์เรย์ ระบบจะใช้เฉพาะแถบแรกของแต่ละรูปภาพ มิฉะนั้นแถบทั้งหมดจะเกี่ยวข้องกับการคำนวณระยะทาง ดังนั้น รูปภาพทั้ง 2 ภาพควรมีจำนวนแถบเท่ากันหรือมีความยาวของอาร์เรย์ 1 มิติเท่ากัน
การใช้งาน | การคืนสินค้า |
---|
Image.spectralDistance(image2, metric) | รูปภาพ |
อาร์กิวเมนต์ | ประเภท | รายละเอียด |
---|
ดังนี้ image1 | รูปภาพ | รูปภาพแรก |
image2 | รูปภาพ | รูปภาพที่ 2 |
metric | String, ค่าเริ่มต้น: "sam" | เมตริกระยะทางสเปกตรัมที่จะใช้ โดยอาจเป็น "sam" (spectral angle mapper), "sid" (spectral information divergence), "sed" (squared Euclidean distance) หรือ "emd" (earth movers distance) |
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 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). |"]]