מטא-נתונים של תמונת מצלמה
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
בעזרת ARCore אפשר להשתמש ב-ArImageMetadata
כדי לגשת לערכי מפתח של מטא-נתונים מתוצאת צילום התמונה במצלמה. במידה מסוימת
סוגים נפוצים של מטא-נתונים של תמונת מצלמה שאולי תרצו לגשת אליהם הם התמקדות,
חותמת זמן של תמונה או מידע על התאורה.
במודול Camera
של Android אפשר להקליט 160 פרמטרים או יותר לגבי התמונה.
לכל פריים שתועד, בהתאם ליכולות המכשיר. לרשימה של כל
למפתחות מטא-נתונים אפשריים, כדאי לעיין במסמכי התיעוד בנושא Camera
של NDK.
שימוש ב-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);
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-26 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-26 (שעון UTC)."],[[["\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```"]]