Pixel Format (BCON for MIPI)#
There are different pixel formats depending on the model of your camera and whether it is a color or a mono camera.
Info
Detailed information about pixel formats can be found in the GenICam Pixel Format Naming Convention 2.1.
Using the Feature#
Choosing a Pixel Format#
To choose a pixel format:
- Make sure the camera is idle, i.e., not capturing images.
- Set the
PixelFormat
parameter to one of the following values (if available):MonoXX
(e.g.,Mono10
,Mono12p
)YCbCrXXX
,YUVXXX
RGB8
,BGR8
Determining the Pixel Format#
To determine the pixel format currently used by the camera, read the value of the PixelFormat
parameter.
Available Pixel Formats#
Info
For a list of the enumeration values, see the Programmer's Guide and Reference Documentation delivered with the Basler pylon Camera Software Suite.
Mono Formats#
If a monochrome camera uses one of the mono pixel formats, it outputs 8, 10, or 12 bits of data per pixel.
If a color camera uses one of the mono pixel formats, the values for each pixel are first converted to the YCbCr color model. The Y component of this model represents a brightness value and is equivalent to the value that would be derived from a pixel in a monochrome sensor. So in essence, when a color camera is set to, e.g., Mono 8, it outputs an 8-bit monochrome image.
YCbCr Formats#
Color cameras can also output color images based on pixel data in YCbCr (or YUV) format.
If a color camera uses this format, each pixel value in the captured image goes through a conversion process as it exits the sensor and passes through the camera. This process yields Y, Cb, and Cr color information for each pixel value.
RGB and BGR Formats#
When a color camera uses the RGB 8 or BGR 8 pixel format, the camera outputs 8 bit of red data, 8 bit of green data, and 8 bit of blue data for each pixel in the acquired frame.
The pixel formats differ by the output sequences for the color data (red, green, blue or blue, green, red).
Maximum Pixel Bit Depth#
The maximum pixel bit depth is defined by the pixel format with the highest bit depth among the pixel formats available on your camera.
Example: If the available pixel formats for your camera are Mono 8 and Mono 12, the maximum pixel bit depth of the camera is 12 bit.
Specifics#
Camera Model | Available Pixel Formats |
---|---|
daA2500-60mc | YUV422_8 |
daA2500-60mci | YCbCr420_8 |
daA2500-60mci @ i.MX8M Plus | YUV422_8 |
daA3840-30mc | YCbCr420_8 |
daA4200-30mci | YUV422_8 |
daA4200-30mci @ i.MX8M Plus | YUV422_8 |
Sample Code#
// Set the pixel format to Mono 8
camera.PixelFormat.SetValue(PixelFormat_Mono8);
INodeMap& nodemap = camera.GetNodeMap();
// Set the pixel format to Mono 8
CEnumParameter(nodemap, "PixelFormat").SetValue("Mono8");
/* 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);
You can also use the pylon Viewer to easily set the parameters.