This feature is useful if you want to align your image data to fixed-size groups of digits, e.g., to 4-byte (32-bit) or 8-byte (64-bit) words. Data alignment can improve performance.
In this topic Hide
Pixel data is read from the sensor line by line. For each image line, the camera transmits a specific number of bytes, depending on the image ROI width and the pixel format used.
The Line Pitch feature allows you to increase the number of bytes transmitted per line. To increase the line pitch, the camera appends zeroed bytes to each line. This allows you to align the image data to, e.g., 4-byte or 8-byte words.
Example: If you set the image ROI to a width of 250 pixels and the pixel format to Mono 8, the amount of transmitted pixel data per line is 250 bytes (250 pixels x 8 bit depth = 250 bytes).
This data cannot be aligned to 4-byte or 8-byte words because 250 is not a multiple of 4 or 8. To align the image data to 4-byte words, you must increase the line pitch from 250 bytes to at least 252 bytes (252 is the next multiple of 4). To align the image data to 8-byte words, you must increase the line pitch to at least 256 bytes.
If data chunks are enabled, adjusting the line pitch will not affect the chunk data. Zeros will only be added to the image data, not to the chunk data.
To determine the current line pitch, get the value of the LinePitch parameter.
This always returns the current line pitch in bytes, regardless of the LinePitchEnable parameter setting.
To align image data to 4-byte words, set the LinePitchEnable parameter to true.
If the current line pitch is not a multiple of four, the line pitch is automatically set to the next multiple of four. The image data is now aligned to 4-byte words (32-bit words).
To set the line pitch and align image data to any word size:
// Enable the line pitch feature
camera.LinePitchEnable.SetValue(true);
// Get the current line pitch
int64_t i = camera.LinePitch.GetValue();
// Set the Line Pitch parameter value to the next multiple of 8
camera.LinePitch.SetValue(((i+7)/8)*8);
You can also use the pylon Viewer to easily set the parameters.