Supported by...


Monochrome cameras can support PIXEL_FORMAT_MONO8, PIXEL_FORMAT_MONO16, PIXEL_FORMAT_MONO12_PACKED, and PIXEL_FORMAT_MONO12_PACKED_MSFIRST formats.


Color cameras can support PIXEL_FORMAT_YUV422, PIXEL_FORMAT_BAYER8, PIXEL_FORMAT_BAYER16, PIXEL_FORMAT_BAYER12_PACKED, PIXEL_FORMAT_BAYER12_PACKED_MSFIRST, RGB24, and BGR24 formats.


Polar cameras can support PIXEL_FORMAT_STOKES4_12, PIXEL_FORMAT_POLAR4_12, PIXEL_FORMAT_POLAR_RAW4_12, and PIXEL_FORMAT_HSV4_12.


The driver and API can also format the image into BGR24, RGB24, or RGB48 for any color camera.



Description


The Pixel Format feature selects the output type of the camera. The full range of possible settings is listed in the table below. For Firewire cameras, Color Coding is the equivalent IIDC feature and needs to be used in conjunction with the IIDC Color Filter ID when using color sensors.


The Pixel Format refers to the output formatted pixel. In cases where the camera's raw pixel size is larger than the output, the data is truncated and the least significant bits are lost. In cases where the camera's raw pixel size is smaller than the output, the least significant bits in the output data are padded with zeros. To determine what the raw pixel size is, see the Max Pixel Size feature. For more information on how the pixel is represented, refer to the Image Data Formats topic in the API reference.


Pixelink cameras that do not support flip or rotate functions on-board have the color coding raw/Bayer filter fixed in a format defined by the sensor. In IIDC, setting the Color Filter ID to a different value will have no effect on the output. In the API, color cameras will accept any of the Bayer formats listed in this table, but they will only implement the default sensor defined formats. For simplicity, PIXEL_FORMAT_BAYER8_GRBG is also defined as PIXEL_FORMAT_BAYER8, PIXEL_FORMAT_BAYER16_GRBG is also defined as PIXEL_FORMAT_BAYER16, and PIXEL_FORMAT_BAYER12_PACKED_GRBG is also defined as PIXEL_FORMAT_BAYER12_PACKED. These simplified compiler definitions can be used to set the BAYER8, BAYER16, or BAYER12_PACKED formats without having to know what the default configuration is.


Note: While the camera pixel format is not affected by a rotation or flip, the captured frame will have the rotation or flip applied in the driver. The pixel format of the captured frame is recorded in the frame descriptor that is returned along with the image buffer. This pixel format value will be different depending on the rotation and flip settings. Applications that process the raw Bayer formats will have to take these orientations into account.


The driver and API can also format the image into BGR24, RGB24, or RGB48 using the PxLFormatImage function.


IIDC Name
API Name
Description
Mono8 (0)
PIXEL_FORMAT_MONO8
Grayscale, 8 bits per pixel.
Mono16 (5)
PIXEL_FORMAT_MONO16
Grayscale, 16 bits per pixel, where the first byte is the most significant byte.
N/A
PIXEL_FORMAT_MONO12_PACKED
Grayscale, 12 bits per pixel, so 2 pixels are represented in 3 image bytes. The first byte will contain the 8 most significant bits of the first pixel, while the 4 least significant bits of the second byte, will contain the 4 least significant bits of the second pixel, while the 3rd byte will contain the most significant 8 bits of the second pixel. See Image Data Formats for more information.
N/A
PIXEL_FORMAT_MONO12_PACKED_MSFIRST
Grayscale, 12 bits per pixel, so 2 pixels are represented in 3 image bytes. The first byte will contain the 8 most significant bits of the first pixel and the second byte will contain the 8 most significant bits of the second pixel. The 4 least significant bits of both the first and second pixel, are packed into the 3rd byte, with the least significant 4 bits of this byte containing the least significant 4 bits of the first pixel and the least significant 4 bits of the second pixel are in the most significant 4 bits of this 3rd byte. See Image Data Formats for more information.
4:2:2 YUV (2)
PIXEL_FORMAT_YUV422
Color, 16 bits per pixel, with a coding pattern of U0, Y0, V0, Y1, U2, Y2, V2, Y3. See Image Data Formats for more information.
Raw8 (9) Filter ID = 0
PIXEL_FORMAT_BAYER8_RGGB
8 bits per pixel. Data in Bayer pattern format with first pixel being red.
Raw8 (9) Filter ID = 2
PIXEL_FORMAT_BAYER8_GRBG or PIXEL_FORMAT_BAYER8
8 bits per pixel. Data in Bayer pattern format with first pixel being green (on a red line).
Raw8 (9) Filter ID = 1
PIXEL_FORMAT_BAYER8_GBRG
8 bits per pixel. Data in Bayer pattern format with first pixel being green (on a blue line).
Raw8 (9) Filter ID = 3
PIXEL_FORMAT_BAYER8_BGGR
8 bits per pixel. Data in Bayer pattern format with first pixel being blue.
Raw16 (10) Filter ID = 0
PIXEL_FORMAT_BAYER16_RGGB
16 bits per pixel. Data in Bayer pattern format with first pixel being red.
Raw16 (10) Filter ID = 2
PIXEL_FORMAT_BAYER16_GRBG or PIXEL_FORMAT_BAYER16
16 bits per pixel. Data in Bayer pattern format with first pixel being green (on a red line).
Raw16 (10) Filter ID = 1

PIXEL_FORMAT_BAYER16_GBRG
16 bits per pixel. Data in Bayer pattern format with first pixel being green (on a blue line)..
Raw16 (10) Filter ID = 3
PIXEL_FORMAT_BAYER16_BGGR
16 bits per pixel. Data in Bayer pattern format with first pixel being blue.
N/A
PIXEL_FORMAT_BAYER12_RGGB_PACKED
12 bits per pixel. Data in Bayer pattern format with first pixel being red. See PIXEL_FORMAT_MONO12_PACKED for packing information.
N/A
PIXEL_FORMAT_BAYER12_GRBG_PACKED or PIXEL_FORMAT_BAYER12_PACKED
12 bits per pixel. Data in Bayer pattern format with first pixel being green (on a red line). See PIXEL_FORMAT_MONO12_PACKED.
N/A
PIXEL_FORMAT_BAYER12_GBRG_PACKED
12 bits per pixel. Data in Bayer pattern format with first pixel being green (on a blue line). See PIXEL_FORMAT_MONO12_PACKED for packing information.
N/A
PIXEL_FORMAT_BAYER12_BGGR_PACKED
12 bits per pixel. Data in Bayer pattern format with first pixel being blue. See PIXEL_FORMAT_MONO12_PACKED for packing information.
N/A
PIXEL_FORMAT_BAYER12_RGGB_PACKED_MSFIRST
12 bits per pixel. Data in Bayer pattern format with first pixel being red. See PIXEL_FORMAT_MONO12_PACKED_MSFIRST for packing information.
N/A
PIXEL_FORMAT_BAYER12_GRBG_PACKED_MSFIRST or PIXEL_FORMAT_BAYER12_PACKED_MSFIRST
12 bits per pixel. Data in Bayer pattern format with first pixel being green (on a red line). See PIXEL_FORMAT_MONO12_PACKED_MSFIRST for packing information.
N/A
PIXEL_FORMAT_BAYER12_GBRG_PACKED_MSFIRST
12 bits per pixel. Data in Bayer pattern format with first pixel being green (on a blue line). See PIXEL_FORMAT_MONO12_PACKED_MSFIRST for packing information.
N/A
PIXEL_FORMAT_BAYER12_BGGR_PACKED_MSFIRST
12 bits per pixel. Data in Bayer pattern format with first pixel being blue. See PIXEL_FORMAT_MONO12_PACKED_MSFIRST for packing information.
RGB8 (4)
PIXEL_FORMAT_RGB24 or PIXEL_FORMAT_RGB24_DIB
Color, 24 bits per pixel, where each color occupies 8 bits, and appear in the order R-G-B. The output is an array of data similar to the BMP format but without the header. The data is in a Windows Device Independent Bitmap (Windows DIB) format. Windows DIB format is an array of data with 8 bits per color channel or 24 bits per pixel in the order of blue, green, red, left to right, bottom to top (last row first).
RGB8 (4)
PIXEL_FORMAT_RGB24_NON_DIB
Color, 24 bits per pixel. Similar to IMAGE_FORMAT_RAW_RGB24, but the data is presented in a non-DIB format. More explicitly, the colors are in a red, green, blue order (left to right), top to bottom (last row last). See Image Data Formats for packing information.
N/A
PIXEL_FORMAT_BGR24 or PIXEL_FORMAT_BGR24_NON_DIB
Color, 24 bits per pixel. Similar to IMAGE_FORMAT_RAW_RGB24_NON_DIB, but the colors are sequenced blue, green, then red. See Image Data Formats for packing information.
RGB16 (6)
PIXEL_FORMAT_RGB48 or PIXEL_FORMAT_RGB48_NON_DIB
Color, 48 bits per pixel. Each pixel is a triplet of little-endian 16-bit values. The colors are in a red, green, blue order (left to right), top to bottom (last row last).
RGB16 (6)
PIXEL_FORMAT_RGB48_DIB
Color, 48 bits per pixel. Similar to PIXEL_FORMAT_RGB48, but the data is presented in Windows DIB format. More explicitly, the colors are in a red, green, blue order left to right, bottom to top (last row first).
N/A
PIXEL_FORMAT_STOKES4_12
Polar cameras only. 48 bits per pixel, 12 bits for each of 4 Stokes channels. See Image Data Formats for packing information.
N/A
PIXEL_FORMAT_POLAR4_12
Polar cameras only. 48 bits per pixel – made up of a 12 bit weighted polar channel value, repeated 4 times. See Image Data Formats for packing information.
N/APIXEL_FORMAT_POLAR_RAW4_12Polar cameras only. 48 bits per pixel; 4 12-bit values for each of the polar channels – 0, 45, 90,and 135 degrees. See Image Data Formats for packing information.
N/A
PIXEL_FORMAT_HSV4_12
Polar cameras only. 48 bits per pixel; 12 bits for each of degree and angle of polarization, and 12 bits pixel value repeated twice. See Image Data Formats for packing information.



API Control

PxLGetFeature, PxLSetFeature


FEATURE ID
Number of Params
Parameters
Units
Restrictions 
FEATURE_PIXEL_FORMAT  

Format of the pixel data.

1
fValue
N/A
Integer Only (see Pixel Format)



Note: The Pixel Format returned in the frame descriptor in PxlGetNextFrame will reflect that settings of FEATURE_ROTATE and FEATURE_FLIP, and may be different than the setting of FEATURE_PIXEL_FORMAT reported by the camera.


Note: The stream state must be off (STREAM_OFF) to modify this feature. See PxLSetStreamState.   



Feature Flags


Camera
Presence
Read Only
Auto
Manual
One-time Auto
Off
CiD
All Cameras
Yes
No
No
Yes
No
No
Yes


Parameters


Camera

Parameter

Unit

Type

Min

Max

Default

Step Size

Comments

Monochrome

Color Coding Format

None

Absolute

0

5

0

N/A

Not all modes between the min and max value are supported.

Color

Color coding format

None

Absolute

2

10

9

N/A

Not all modes between the min and max value are supported.