相機圖片中繼資料
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
ARCore 可讓您使用 ArImageMetadata
以存取相機圖片拍攝結果中的中繼資料鍵值。只有部分通知
你可能想存取的相機圖片中繼資料類型
包括焦距
圖片時間戳記資料或光源資訊。
Android Camera
模組可以記錄 160 以上的圖片參數
根據裝置功能而定。完整的清單
可能的中繼資料鍵,請參閱 NDK Camera
說明文件。
使用 ArImageMetadata_getConstEntry()
取得特定中繼資料標記值以下範例說明如何取得 ACAMERA_SENSOR_EXPOSURE_TIME
中繼資料值:
ArSession_update(session, frame);
// Obtain the metadata object from the frame.
ArImageMetadata* ar_metadata;
ArFrame_acquireImageMetadata(session, frame, &ar_metadata);
// Get the exposure time metadata (using ACAMERA_SENSOR_EXPOSURE_TIME in this
// example).
ArImageMetadata_const_entry exposure_entry;
ArImageMetadata_getConstEntry(session, ar_metadata,
ACAMERA_SENSOR_EXPOSURE_TIME, &exposure_entry);
使用 ArImageMetadata_getAllKeys()
取得擷取的所有中繼資料鍵清單
產生特定影格的高度
ArSession_update(session, frame);
// Obtain the metadata object from the frame.
ArImageMetadata* ar_metadata;
ArFrame_acquireImageMetadata(session, frame, &ar_metadata);
// Obtain the list of all the metadata for a given frame.
const uint32_t* all_tags = NULL;
int32_t number_of_tags = -1;
ArImageMetadata_getAllKeys(session, ar_metadata, &number_of_tags, &all_tags);
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[null,null,["上次更新時間:2025-07-26 (世界標準時間)。"],[[["\u003cp\u003eARCore's \u003ccode\u003eArImageMetadata\u003c/code\u003e allows access to camera image metadata like focal length, timestamps, and lighting information.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can retrieve specific metadata values, such as exposure time, using \u003ccode\u003eArImageMetadata_getConstEntry()\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eArImageMetadata_getAllKeys()\u003c/code\u003e provides a list of all metadata tags available for a given frame.\u003c/p\u003e\n"],["\u003cp\u003eThe Android \u003ccode\u003eCamera\u003c/code\u003e module can record extensive image parameters, with a full list available in the NDK documentation.\u003c/p\u003e\n"]]],[],null,["# Camera image metadata\n\nARCore lets you use [`ArImageMetadata`](/ar/reference/c/group/ar-image-metadata)\nto access metadata key values from the camera image capture result. Some\ncommon types of camera image metadata you might want to access are focal length,\nimage timestamp data, or lighting information.\n\nThe Android `Camera` module can record 160 or more parameters about the image\nfor each frame captured, depending on a device's capabilities. For a list of all\npossible metadata keys, see the [NDK `Camera` documentation](https://developer.android.com/ndk/reference/group/camera).\n\nGet the value of an individual metadata tag\n-------------------------------------------\n\nUse [`ArImageMetadata_getConstEntry()`](/ar/reference/c/group/ar-image-metadata#arimagemetadata_getconstentry)\nto get a specific metadata tag value. The following example shows obtaining the `ACAMERA_SENSOR_EXPOSURE_TIME` metadata value: \n\n```c\nArSession_update(session, frame);\n\n// Obtain the metadata object from the frame.\nArImageMetadata* ar_metadata;\nArFrame_acquireImageMetadata(session, frame, &ar_metadata);\n\n// Get the exposure time metadata (using ACAMERA_SENSOR_EXPOSURE_TIME in this\n// example).\nArImageMetadata_const_entry exposure_entry;\nArImageMetadata_getConstEntry(session, ar_metadata,\n ACAMERA_SENSOR_EXPOSURE_TIME, &exposure_entry);\n```\n\nGet a list of all metadata tags for a given frame\n-------------------------------------------------\n\nUse [`ArImageMetadata_getAllKeys()`](/ar/reference/c/group/ar-image-metadata#arimagemetadata_getallkeys) to get a list of all metadata keys captured\nfor a given frame. \n\n```c\nArSession_update(session, frame);\n\n// Obtain the metadata object from the frame.\nArImageMetadata* ar_metadata;\nArFrame_acquireImageMetadata(session, frame, &ar_metadata);\n\n// Obtain the list of all the metadata for a given frame.\nconst uint32_t* all_tags = NULL;\nint32_t number_of_tags = -1;\n\nArImageMetadata_getAllKeys(session, ar_metadata, &number_of_tags, &all_tags);\n```"]]