Hello,
Our team is trying to use the Argus API to obtain the RAW data and embedded metadata from a camera. I have followed the Argus sample code to write a loop for capturing RAW images, and the capture process itself seems fine.
Based on the obtained frame object, I would like to further extract the metadata contained in the frame (coming from the sensor). My main configuration code is as follows:
UniqueObj<OutputStreamSettings> outSettings(iSession->createOutputStreamSettings(STREAM_TYPE_EGL));
IEGLOutputStreamSettings* iOutSet = interface_cast<IEGLOutputStreamSettings>(outSettings);
iOutSet->setPixelFormat(Argus::PIXEL_FMT_RAW16);
iOutSet->setResolution(interface_cast<ISensorMode>(modes[Sensor_mode])->getResolution());
iOutSet->setMetadataEnable(true);
iOutSet->setMode(EGL_STREAM_MODE_FIFO);
UniqueObj<OutputStream> stream(iSession->createOutputStream(outSettings.get()));
UniqueObj<FrameConsumer> consumer(FrameConsumer::create(stream.get()));
IFrameConsumer* iConsumer = interface_cast<IFrameConsumer>(consumer);
UniqueObj<Request> request(iSession->createRequest(CAPTURE_INTENT_STILL_CAPTURE));
Ext::ISensorPrivateMetadataRequest* iMetaReq =
interface_cast<Ext::ISensorPrivateMetadataRequest>(request);
IRequest* iReq = interface_cast<IRequest>(request);
iReq->setEnableIspStage(true);
iReq->enableOutputStream(stream.get());
ISourceSettings *iSourceSettings = interface_cast<ISourceSettings>(request);
iSourceSettings->setSensorMode(modes[Sensor_mode]);
iSession->repeat(request.get());
UniqueObj<Frame> frame(iConsumer->acquireFrame(TIMEOUT_NS, &status));
const EGLStream::IArgusCaptureMetadata* iArgusCaptureMetadata =
interface_cast<const EGLStream::IArgusCaptureMetadata>(frame);
if(!iArgusCaptureMetadata)
printf("No IArgusCaptureMetadata on frame\n");
const CaptureMetadata* capMeta = iArgusCaptureMetadata->getMetadata();
if(!capMeta)
printf("No CaptureMetadata on frame\n");
const Ext::ISensorPrivateMetadata* iMeta =
interface_cast<const Ext::ISensorPrivateMetadata>(capMeta);
if(!iMeta)
printf("No ISensorPrivateMetadata on frame\n");
In my tests, I found something strange: if I set the capture pixel format to RAW16, i.e.,
iOutSet->setPixelFormat(Argus::PIXEL_FMT_RAW16);
and disable the ISP stage with
iReq->setEnableIspStage(false);
then the ISensorPrivateMetadata* iMeta I get is null.
However, if I enable the ISP stage with
iReq->setEnableIspStage(true);
then ISensorPrivateMetadata* iMeta is not null, and the metadata retrieved matches the actual data.
What I don’t quite understand is: since camera metadata should come from the sensor, why is it that I can only get ISensorPrivateMetadata after enabling the ISP stage?
To obtain RAW data that is as unmodified as possible, I believe it is necessary to skip the ISP stage. So, in the Argus framework, if I want to get the sensor metadata from the frame object, do I have to enable the ISP stage? Or is there something wrong with my settings?