公告:凡是在
2025 年 4 月 15 日前註冊使用 Earth Engine 的非商業專案,都必須
驗證非商業用途資格,才能繼續存取 Earth Engine。
ee.Image.displacement
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
決定將圖片註冊至參考圖片時所需的位移,同時允許局部橡皮片變形。位移是在參考圖像的 CRS 中計算,比例取決於下列三種投影的最低解析度:輸入圖像投影、參考圖像投影和要求的投影。然後,系統會將位移轉換為使用者指定的投影,以供輸出。
用量 | 傳回 |
---|
Image.displacement(referenceImage, maxOffset, projection, patchWidth, stiffness) | 圖片 |
引數 | 類型 | 詳細資料 |
---|
這個:image | 圖片 | 要註冊的圖片。 |
referenceImage | 圖片 | 要註冊的圖片。 |
maxOffset | 浮點值 | 嘗試對齊輸入圖片時允許的最大偏移量 (以公尺為單位)。使用較小的值可大幅縮短運算時間,但仍須夠大,才能涵蓋整個圖片區域內的最大位移。 |
projection | 投影,預設值:null | 要輸出位移值的投影。預設值為參照圖片第一個色帶的投影。 |
patchWidth | 浮點值,預設值為空值 | 偵測圖像偏移的修補程式大小 (以公尺為單位)。這個值應設得夠大,才能擷取紋理,並確保可忽略的物件在修補程式中很小。預設值為 null。如未提供修補程式大小,系統會自動判斷。 |
stiffness | 浮點值,預設值為 5 | 對解法強制執行剛度限制。有效值介於 [0,10] 之間。在判斷相鄰格線點的位移時,可使用硬度來拒絕離群值。值越高,解決方案就越趨向嚴格的轉換。值越小,註冊期間圖片的扭曲或變形程度就越大。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[null,null,["上次更新時間:2025-07-26 (世界標準時間)。"],[[["\u003cp\u003eThis method calculates the displacements needed to align an image with a reference image, allowing for localized, flexible deformations.\u003c/p\u003e\n"],["\u003cp\u003eDisplacements are determined in the reference image's coordinate system and at a resolution based on the input, reference, and requested projections.\u003c/p\u003e\n"],["\u003cp\u003eUsers can specify a maximum offset for alignment, a projection for outputting displacements, a patch size for offset detection, and a stiffness parameter to control deformation.\u003c/p\u003e\n"],["\u003cp\u003eThe output is an image containing the calculated displacement values, which can be used to warp or transform the input image to match the reference image.\u003c/p\u003e\n"],["\u003cp\u003eUsing a smaller \u003ccode\u003emaxOffset\u003c/code\u003e value can speed up computation but must be sufficient to cover the largest displacement within the image.\u003c/p\u003e\n"]]],[],null,["# ee.Image.displacement\n\nDetermines displacements required to register an image to a reference image while allowing local, rubber sheet deformations. Displacements are computed in the CRS of the reference image, at a scale dictated by the lowest resolution of the following three projections: input image projection, reference image projection, and requested projection. The displacements are then transformed into the user-specified projection for output.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|--------------------------------------------------------------------------------------------------|---------|\n| Image.displacement`(referenceImage, maxOffset, `*projection* `, `*patchWidth* `, `*stiffness*`)` | Image |\n\n| Argument | Type | Details |\n|------------------|---------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `image` | Image | The image to register. |\n| `referenceImage` | Image | The image to register to. |\n| `maxOffset` | Float | The maximum offset allowed when attempting to align the input images, in meters. Using a smaller value can reduce computation time significantly, but it must still be large enough to cover the greatest displacement within the entire image region. |\n| `projection` | Projection, default: null | The projection in which to output displacement values. The default is the projection of the first band of the reference image. |\n| `patchWidth` | Float, default: null | Patch size for detecting image offsets, in meters. This should be set large enough to capture texture, as well as large enough that ignorable objects are small within the patch. Default is null. Patch size will be determined automatically if not provided. |\n| `stiffness` | Float, default: 5 | Enforces a stiffness constraint on the solution. Valid values are in the range \\[0,10\\]. The stiffness is used for outlier rejection when determining displacements at adjacent grid points. Higher values move the solution towards a rigid transformation. Lower values allow more distortion or warping of the image during registration. |"]]