Transfer Bit Depth#
减小传输位深可以提高相机的帧速率。增加传输位深可以提高图像质量。
该功能的使用#
为什么使用 Transfer Bit Depth#
The transfer bit depth allows you to change the bit depth of the data to be transferred during internal image processing. This is useful if changing the sensor bit depth isn't recommended due to a sensor's specific characteristics.
Important
If the Transfer Bit Depth feature is available for your camera, always use this feature instead of the Sensor Bit Depth feature. Only if you're not satisfied with the result, change the sensor bit depth.
设置传输位深时,请遵循以下准则:
- 为了获得最佳图像质量,请将传输位深设置为较高值。
较高的传输位深可以改善图像质量,因为相机的内部图像计算基于更高的位深。 - 为了获得最佳性能,请将传输位深设置为较低值。
较低的传感器位深可以提高性能,因为要传输的数据量会减少。
用例#
对于某些相机,如果使用 8 位像素格式,传感器位深会自动设置为 10 位。这取决于所使用的传感器,并取决于传感器的特定特性。对于这些传感器,不建议将传感器位深更改为较低的值,以达到增加相机帧速率等目的,否则会影响某些其他传感器特性。
这就是传输位深发挥作用的地方。您可以设置一个独立于所用传感器位深的值,例如,从提高的帧速率中受益。
Transfer Bit Depth 模式#
Transfer Bit Depth 模式允许您定义是否可以独立于所使用的像素格式来设置传输位深。您可以将 BslTransferBitDepthMode
参数设置为以下值之一:
Auto
:根据使用的 Pixel Format 自动调整 Transfer Bit Depth。这是默认设置。例如,如果将 Pixel Format 设置为 Bayer 12,则 Transfer Bit Depth 将自动设置为 12 位。Manual
:可以独立于所用的像素格式设置传输位深。例如,您可以将相机配置为基于用于内部图像处理的 10 位数据(像素格式 = Mono 8,传输位深 = 10 位)输出 8 位图像数据。
设置 Transfer Bit Depth#
- 将
BslTransferBitDepthMode
参数设置为Manual
。 - 将
BslTransferBitDepth
参数设置为所需值。
例如,将参数设置为Bpp12
,即可将位深设置为 12 bpp(每像素位数)。
示例代码#
// Set the pixel format to Mono 8
camera.PixelFormat.SetValue(PixelFormat_Mono8);
// Set the transfer bit depth mode to Manual
camera.BslTransferBitDepthMode.SetValue(BslTransferBitDepthMode_Manual);
// Set the transfer bit depth to 10 bit
camera.BslTransferBitDepth.SetValue(BslTransferBitDepth_Bpp10);
INodeMap& nodemap = camera.GetNodeMap();
// Set the pixel format to Mono 8
CEnumParameter(nodemap, "PixelFormat").SetValue("Mono8");
// Set the transfer bit depth mode to Manual
CEnumParameter(nodemap, "BslTransferBitDepthMode").SetValue("Manual");
// Set the transfer bit depth to 10 bit
CEnumParameter(nodemap, "BslTransferBitDepth").SetValue("Bpp10");
// Set the pixel format to Mono 8
camera.Parameters[PLCamera.PixelFormat].SetValue(PLCamera.PixelFormat.Mono8);
// Set the transfer bit depth mode to Manual
camera.Parameters[PLCamera.BslTransferBitDepthMode].SetValue(PLCamera.BslTransferBitDepthMode.Manual);
// Set the transfer bit depth to 10 bit
camera.Parameters[PLCamera.BslTransferBitDepth].SetValue(PLCamera.BslTransferBitDepth.Bpp10);
/* Macro to check for errors */
#define CHECK(errc) if (GENAPI_E_OK != errc) printErrorAndExit(errc)
GENAPIC_RESULT errRes = GENAPI_E_OK; /* Return value of pylon methods */
/* Set the pixel format to Mono 8 */
errRes = PylonDeviceFeatureFromString(hdev, "PixelFormat", "Mono8");
CHECK(errRes);
/* Set the transfer bit depth mode to Manual */
errRes = PylonDeviceFeatureFromString(hdev, "BslTransferBitDepthMode", "Manual");
CHECK(errRes);
/* Set the transfer bit depth to 10 bit */
errRes = PylonDeviceFeatureFromString(hdev, "BslTransferBitDepth", "Bpp10");
CHECK(errRes);
您也可以使用 pylon Viewer 轻松设置参数。