카메라 이미지 메타데이터

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