Transfer Bit Depth#
减小传输位深可以提高相机的帧速率。增加传输位深可以提高图像质量。
该功能的使用#
为什么使用 Transfer Bit Depth#
通过 Transfer Bit Depth,您可以更改内部图像处理期间要传输的数据的位深度。如果由于传感器的特定特性不建议更改 sensor bit depth,则此功能非常有用。
重要提示
如果您的相机支持 Transfer Bit Depth 功能,请务必使用此功能,而不是 Sensor Bit Depth 功能。 只有在对结果不满意时,才更改 sensor bit depth。
设置传输位深时,请遵循以下准则:
- 为了获得最佳图像质量,请将传输位深设置为较高值。
较高的传输位深可以改善图像质量,因为相机的内部图像计算基于更高的位深。 - 为了获得最佳性能,请将传输位深设置为较低值。
较低的传感器位深可以提高性能,因为要传输的数据量会减少。
用例#
对于某些相机,如果使用 8 位像素格式,传感器位深会自动设置为 10 位。这取决于所使用的传感器,并取决于传感器的特定特性。对于这些传感器,不建议将传感器位深更改为较低的值,以达到增加相机帧速率等目的,否则会影响某些其他传感器特性。
这就是传输位深发挥作用的地方。您可以设置一个独立于所用传感器位深的值,例如,从提高的帧速率中受益。
Transfer Bit Depth 模式#
Transfer Bit Depth mode 允许您定义是否可以独立于所使用的 Pixel Format 来设置 transfer bit depth。您可以设置 BslTransferBitDepthMode 参数设置为以下值:
Auto:根据所使用的 像素格式 自动调整 transfer bit depth。这是默认设置。例如,如果您将 Pixel Format 设置为 Bayer 12,则 transfer bit depth 会自动设置为 12 bit。Manual:可以独立于所使用的 Pixel Format 来设置 transfer bit depth。例如,您可以将相机配置为根据用于内部图像处理的 10 位数据输出 8 位图像数据(Pixel Format = Mono 8,Transfer Bit Depth = 10 bit)。
设置 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 轻松设置参数。