公告:凡是在
2025 年 4 月 15 日前註冊使用 Earth Engine 的非商業專案,都必須
驗證非商業用途資格,才能繼續存取 Earth Engine。
ee.Algorithms.HoughTransform
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
對圖片套用 Hough 轉換。針對每個輸入頻帶,輸出一個頻帶,其中會透過 Hough 轉換的閾值 (值為 lineThreshold) 偵測線條。輸出頻帶的名稱為 [input]_lines,其中 [input] 是原始頻帶的名稱。參數的預設值是為了搭配 UINT8 圖片使用而提供,可做為起點。
用量 | 傳回 |
---|
ee.Algorithms.HoughTransform(image, gridSize, inputThreshold, lineThreshold, smooth) | 圖片 |
引數 | 類型 | 詳細資料 |
---|
image | 圖片 | 要套用轉換的圖片。 |
gridSize | 整數,預設值為 256 | 要執行計算的格線大小。 |
inputThreshold | 浮點數,預設值:64 | 輸入圖片的值門檻。等於或高於這個值的像素會視為有效。 |
lineThreshold | 浮點值 (預設值為 72) | 偵測線條的門檻。如果 Hough 轉換的值等於或高於這個門檻,系統就會視為偵測到線條。 |
smooth | 布林值,預設值為 true | 是否要在偵測線條前平滑化 Hough 轉換。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[null,null,["上次更新時間:2025-07-26 (世界標準時間)。"],[[["\u003cp\u003eDetects lines in an image by applying the Hough transform and thresholding the results.\u003c/p\u003e\n"],["\u003cp\u003eOutputs a new band for each input band, highlighting detected lines, named "[input]_lines".\u003c/p\u003e\n"],["\u003cp\u003eCustomizable parameters include grid size, input and line thresholds, and smoothing for the Hough transform.\u003c/p\u003e\n"],["\u003cp\u003eDefault parameter values are optimized for 8-bit unsigned integer images.\u003c/p\u003e\n"],["\u003cp\u003eUsers can adjust these parameters to fine-tune line detection for their specific images and use cases.\u003c/p\u003e\n"]]],["The Hough transform detects lines in an image. It takes an image as input and outputs a new image with detected lines for each band, named `[input]_lines`. Key actions include thresholding the input image based on `inputThreshold` to identify active pixels and then thresholding the Hough transform output with `lineThreshold` to detect lines. `gridSize` controls the computation grid, and `smooth` enables smoothing before line detection. Defaults are provided for UINT8 images.\n"],null,["# ee.Algorithms.HoughTransform\n\nApplies the Hough transform to an image. For every input band, outputs a band where lines are detected by thresholding the Hough transform with a value of lineThreshold. The output band is named \\[input\\]_lines, where \\[input\\] is the name of the original band. The defaults provided for the parameters are intended as a starting point for use with UINT8 images.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|-----------------------------------------------------------------------------------------------------------|---------|\n| `ee.Algorithms.HoughTransform(image, `*gridSize* `, `*inputThreshold* `, `*lineThreshold* `, `*smooth*`)` | Image |\n\n| Argument | Type | Details |\n|------------------|------------------------|-----------------------------------------------------------------------------------------------------------------------------------|\n| `image` | Image | The image to which to apply the transform. |\n| `gridSize` | Integer, default: 256 | The size of the grid over which to perform the computation. |\n| `inputThreshold` | Float, default: 64 | Value threshold for input image. Pixels equal to or above this value are considered active. |\n| `lineThreshold` | Float, default: 72 | Threshold for line detection. Values equal to or above this threshold on the Hough transform are considered to be detected lines. |\n| `smooth` | Boolean, default: true | Whether to smooth the Hough transform before line detection. |"]]