Ladybug JPEG Image Quality and Buffer Size Settings
Overview
Compression and image quality are highly dependent on the scene being captured and can be affected by levels of light, complexity of scene, and data format.
When balancing JPEG image quality and frame rate on Ladybug cameras, there are two primary factors to consider:
- Compression Control—The rate at which the Ladybug compression engine works. A higher compression rate produces higher-quality JPEG images. In turn, higher-quality images result in larger amounts of data that must be transmitted to the PC.
- Image Buffer Size—The size of the frame buffer on the PC (controlled by the camera driver) that receives images from the camera. A larger buffer size means higher-quality data can be processed. However, processing more data may come at the expense of frame rate.
You can use the Ladybug Settings dialog of the Camera Control window in the LadybugCapPro program to adjust compression control and buffer size, effectively balancing the quality of JPEG images that are transmitted from a Ladybug camera with the frame rate of these transmissions. There are two primary mechanisms: auto and manual.
Compression Control in the Ladybug Settings dialog
For more information about working in the Ladybug Settings dialog of the LadybugCapPro program, refer to the ‘Ladybug Settings’ topic in the Ladybug SDK Help.
General Recommendations
We recommend following these general guidelines:
- Maximize frame rate by setting Packet Size to the maximum allowed by the bus which is 32000 bytes for USB 3.1.
- Packet size is adjusted on the Custom Video Modes dialog of the Camera Control window in LadybugCapPro.
- Set the JPEG Quality to Auto to allow the compressor unit to determine the best compression rate to fit the bandwidth and avoid dropped frames.
Adjusting JPEG Quality Automatically
This is the recommended setting.
When JPEG Quality-Auto is enabled, you can adjust the Auto Buffer Usage setting. This control specifies the percentage of the image buffer size that is actually used for JPEG compressed image data. Specifying a value less than the maximum allows for room in the image buffer to accommodate extra image data, depending on scene variations from frame to frame. Increasing this value may result in an increase in the JPEG Quality setting.
A Buffer Usage setting of no more than 95% is recommended. The visual improvement in compression quality that results from a setting higher than 95% is negligible compared to the increased amount of data generated.
Enabling JPEG Quality-Auto means that the compression rate continually adjusts so that it never exceeds the amount of data allowed by the image buffer size.
When JPEG Quality-Auto is not enabled, the percentage of the image buffer that is used cannot be controlled.
Adjusting JPEG Quality Manually
When JPEG Quality-Auto is not enabled, you can adjust the JPEG Quality value manually.
The recommended value for Ladybug6 is dependent on the data format:
Data Format | % |
JPEG8 | 90 |
JPEG12 | 35 |
JPEG12 Processed | 12 |
The recommended value for Ladybug5+ is 80%.
When manually set, the JPEG Quality may be too high for your image size, frame rate or packet size settings. If this is the case, you may get unexpected results from your camera, including dropped frames and ‘Buffer too small’ errors displayed on the LadybugCapPro status bar. Depending on your requirements, you can address this by increasing the image buffer size, lowering the frame rate, or lowering image quality.