카메라 이미지 메타데이터

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);