Get OSD(On-Screen Display) Image¶
Remote emulation. which allows users to remotely receive display information from the camera including On-screen display. This provides the level of remote-control equivalent to a non-remote manipulation.
You can show the image like display of camera screen if you should overlay osd image at live-view image. Some item is invisible on osd image. See detail: Invisible display item on OSD image First, set the value at on at CrDeviceProperty_OSDImageMode. Then SDK start the loop-task that get osd image from camera. Caution: It may affect the camera’s performance if set the value at on. So recommended the value doesn’t set on if you don’t need osd image. Second, Get the osd image from SDK by GetOSDImage(). You can get the osd image from CrOSDImageDataBlock. The image of get osd image is not include live-view image. So you should need to overlay to live-view image at yourself. You can change interval of get osd image from camera by Device Setting.
Example:
// Set the value of OSDImageMode
SCRSDK::CrDeviceProperty prop;
prop.SetCode(SCRSDK::CrDevicePropertyCode::CrDeviceProperty_OSDImageMode);
prop.SetCurrentValue(SCRSDK::CrOSDImageMode_On);
prop.SetValueType(SCRSDK::CrDataType::CrDataType_UInt8); // Use target DP's CrDataType
SCRSDK::SetDeviceProperty(handle, &prop);
// Get the osd image
SCRSDK::CrOSDImageDataBlock osdData;
osdData.SetData(new CrInt8u[CR_OSD_IMAGE_MAX_SIZE]);
// CR_OSD_IMAGE_MAX_SIZE defined at CrImageDataBlock.h.
SCRSDK::CrError ret = SCRSDK::GetOSDImage(handle, &osdData);
if (CR_FAILED(ret))
{
printf("fail get osd image.\n");
}
When you want to overlay osd image and live-view image, you should use CrOSDImageMetaInfo in CrOSDImageDataBlock.
First, check the parameter of CrOSDImageMetaInfo.isLvPosExist.
you don’t need to overlay because related live-view image is not exist if it is disable.
Then check the other parameter that use at overlay in CrOSDImageMetaInfo. Then execute overlay osd image and live-view image. Live-view image is get by GetLiveViewImage().
Example:
SCRSDK::CrError err = SCRSDK::GetLiveViewImage(handle, liveViewData);
SCRSDK::CrError ret = SCRSDK::GetOSDImage(handle, &osdData);
if (CR_FAILED(ret))
{
printf("fail get osd image.\n");
} else {
SCRSDK::CrOSDImageMetaInfo meta = imageData.GetMetaInfo();
if (meta.isLvPosExist == SCRSDK::CrIsLvPosExist_Disable) {
// Live view image is not available. Don’t need overlay.
} else {
// Overlay osd image and live-view image.
CompositeImage(liveViewData, osdData);
}
}
|
|