深度和可信度編碼
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
深度地圖序列化為一組 XMP 屬性。隨著序列化程序,深度圖會先轉換為傳統圖片格式。編碼管道包含三個步驟 (如圖 2 所示):
- 從輸入格式 (例如 float 或 int32 值) 轉換為整數灰階圖片格式,例如位元組 (8 位元) 或字詞 (16 位元)。
- 使用標準圖片轉碼器進行壓縮,例如 JPEG 或 PNG。
- 序列化為 Base64 字串 XMP 屬性。
根據原始深度圖的位元數和儲存時使用的位元數而定,管道可以無損或有損,例如 JPEG 轉碼器為 8 位元,PNG 轉碼器為 8 或 16 位元。
目前支援兩種不同的格式:RangeLinear 和 RangeInverse。如果深度編碼在編碼時 (例如從浮點值轉換為 8 位元),建議採用 RangeInverse,這個做法會針對近深度值分配更多位元,並將遠位元分配給遠值,與 GPU 資訊卡中的 Z-buffer 的運作方式類似。
如果深度圖有附加的信賴圖,信賴區間也會使用與深度類似的管道,轉換為傳統圖片格式。可信度地圖一律會使用 RangeLinear 格式進行編碼,其中信賴區間為 [0, 1]。
範圍線性
讓 d 代表像素的深度,以及所處的最小和最大深度值。深度值會先標準化為 [0, 1] 範圍,
量化為 8 或 16 位元
反之,量化深度 d
8bit 則可還原為 d 這個深度
範圍反向
讓 d 代表像素的深度,以及所處的最小和最大深度值。深度值會先標準化為 [0, 1] 範圍,
量化為 8 或 16 位元
反之,經過標準化的深度「d」
時,可以將深度 d 復原為
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2023-06-23 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2023-06-23 (世界標準時間)。"],[[["Depthmaps are serialized as XMP properties after being converted to a traditional image format (e.g., JPEG or PNG)."],["The encoding pipeline involves converting the depthmap to an integer grayscale image, compressing it, and serializing it as a base64 string."],["Two formats, RangeLinear and the recommended RangeInverse, handle depth value encoding, with RangeInverse optimizing for potential precision loss."],["Confidence maps, if present, are encoded using RangeLinear format with a range of [0, 1]."],["Both formats provide formulas for normalization, quantization, and recovering original depth values."]]],[]]