Configuring Sensor Properties¶
Sensor properties available via tcamprop¶
The tcampimipisrc provides access to the sensor settings via tcamprop. (See https://www.theimagingsource.com/documentation/tiscamera/tcamprop.html for the tcamprop documentation)
Please note that not every control is available for every camera model. For example, some image sensor’s do not support trigger mode. Other controls might not be available because the camera does not have I/O connectors.
Control | Type | Unit |
---|---|---|
ExposureTime | double | µs |
Gain | double | dB/10 |
BlackLevel | double | |
OffsetX | integer | Pixels |
OffsetY | integer | Pixels |
OffsetAutoCenter | boolean | |
ReverseX | boolean | |
ReverseY | boolean | |
TriggerMode | enum | |
TriggerSource | enum | |
StrobeMode | enum |
Exposure Time¶
The ExposureTime property is a common control that controls the exposure time of the sensor.
Control | Exposure Time |
---|---|
Name | ExposureTime |
Type | double |
Unit | µs |
Minimum | Sensor-specific |
Maximum | Sensor-specific |
Gain¶
The Gain property is a common control that controls both analog and digital image signal amplification done by the sensor.
Control | Gain |
---|---|
Name | Gain |
Type | double |
Unit | dB / 10 |
Minimum | Sensor-specific |
Maximum | Sensor-specific |
Black Level¶
The BlackLevel property is a common setting that controls the minimum value for a black pixel.
Control | Black Level |
---|---|
Name | BlackLevel |
Type | double |
Minimum | Sensor-specific |
Maximum | Sensor-specific |
Offset X¶
The OffsetX control configures the horizontal start position of the readout in partial scan mode.
When setting a value that is larger than possible given the width of the current resolution, the camera will internallyy apply the largest valid value.
Control | Offset X |
---|---|
Name | OffsetX |
Type | integer |
Minimum | 0 |
Maximum | Sensor-specific |
Step Size | Sensor-specific |
Offset Y¶
The OffsetY control configures the vertical start position of the readout in partial scan mode.
When setting a value that is larger than possible given the height of the current resolution, the camera will internally apply the largest valid value.
Control | Offset Y |
---|---|
Name | OffsetY |
Type | integer |
Minimum | 0 |
Maximum | Sensor-specific |
Step Size | Sensor-specific |
Offset Auto Center¶
The OffsetAutoCenter control can be used to always read out the center region of the image sensor.
When OffsetAutoCenter is true, the values of offset_x and offset_y are ignored.
Control | Offset Auto Center |
---|---|
Name | OffsetAutoCenter |
Type | boolean |
true | Always read out the center region of the image sensor |
false | Read out the region starting at OffsetX, OffsetY |
Reverse X¶
The ReverseX control can be used to flip the image along the X axis.
Control | Reverse X |
---|---|
Name | ReverseX |
Type | boolean |
true | Flip the image. |
false | Do not flip the image. |
Reverse Y¶
The ReverseY control can be used to flip the image along the Y axis.
Control | Reverse Y |
---|---|
Name | ReverseY |
Type | boolean |
true | Flip the image. |
false | Do not flip the image. |
Trigger Mode¶
The TriggerMode control can be used to put the camera in trigger mode. In trigger mode, the camera waits for an external signal before delivering an image.
Control | Trigger Mode |
---|---|
Name | TriggerMode |
Type | enum |
Off | Deliver images continuously |
On | Deliver images on demand |
Trigger Source¶
The TriggerSource control can be used to configure which input signal the sensor should listen to in trigger mode.
Control | Trigger Source |
---|---|
Name | TriggerSource |
Type | enum |
PicoBlade | Accept trigger signal from the TRIG_IN pins of the camera’s PicoBlade connector |
FPD-Link | Accept trigger signal via FPD-Link |
Strobe Mode¶
The StrobeMode control configures an electric signal that indicates sensor activities to the outside world.
Control | Strobe Mode |
---|---|
Name | StrobeMode |
Type | enum |
Off | Disabled |
On | Generate a signal that indicates the sensor’s light-sensitive period |
Cap formats provided by the driver¶
The tcampimipisrc exposes the follwoing caps depending on the sensor that is connected.
video/x-raw,format=GRAY10m
video/x-raw,format=GRAY12m
video/x-bayer,format=rggb10m
video/x-bayer,format=rggb12m
video/x-bayer,format=grbg10m
12-bit MIPI packed format layout¶
Bytes 0-2: [pix0_hi][pix1_hi][pix0_lo|pix1_lo]
Example code to convert 12 bit formats to 2 uint16_t values:
uint8_t* src = ..;
uint16_t pixel0 = (src[0] << 8) | (src[2] & 0x0F) << 4;
uint16_t pixel1 = (src[1] << 8) | (src[2] & 0xF0) << 0;
10-bit MIPI packed format layout¶
Bytes 0-5: [pix0_hi][pix1_hi][pix2_hi][pix3_hi][pix0_lo|pix1_lo|pix2_lo|pix3_lo]
Example code to convert 10 bit formats to 4 uint16_t values:
uint8_t* src = ..;
uint16_t pixel0 = (src[0] << 8) | (src[4] & 0b00000011) << 6;
uint16_t pixel1 = (src[1] << 8) | (src[4] & 0b00001100) << 4;
uint16_t pixel2 = (src[2] << 8) | (src[4] & 0b00110000) << 2;
uint16_t pixel3 = (src[3] << 8) | (src[4] & 0b11000000) << 0;