NAME

Tinkerforge::BrickletThermalImaging - 80x60 pixel thermal imaging camera

CONSTANTS

DEVICE_IDENTIFIER

This constant is used to identify a Thermal Imaging Bricklet.

The get_identity() subroutine and the CALLBACK_ENUMERATE callback of the IP Connection have a device_identifier parameter to specify the Brick's or Bricklet's type.

DEVICE_DISPLAY_NAME

This constant represents the display name of a Thermal Imaging Bricklet.

CALLBACK_HIGH_CONTRAST_IMAGE_LOW_LEVEL

This constant is used with the register_callback() subroutine to specify the CALLBACK_HIGH_CONTRAST_IMAGE_LOW_LEVEL callback.

CALLBACK_TEMPERATURE_IMAGE_LOW_LEVEL

This constant is used with the register_callback() subroutine to specify the CALLBACK_TEMPERATURE_IMAGE_LOW_LEVEL callback.

CALLBACK_HIGH_CONTRAST_IMAGE

This constant is used with the register_callback() subroutine to specify the CALLBACK_HIGH_CONTRAST_IMAGE callback.

CALLBACK_TEMPERATURE_IMAGE

This constant is used with the register_callback() subroutine to specify the CALLBACK_TEMPERATURE_IMAGE callback.

FUNCTION_GET_HIGH_CONTRAST_IMAGE_LOW_LEVEL

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_GET_TEMPERATURE_IMAGE_LOW_LEVEL

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_GET_STATISTICS

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_SET_RESOLUTION

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_GET_RESOLUTION

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_SET_SPOTMETER_CONFIG

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_GET_SPOTMETER_CONFIG

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_SET_HIGH_CONTRAST_CONFIG

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_GET_HIGH_CONTRAST_CONFIG

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_SET_IMAGE_TRANSFER_CONFIG

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_GET_IMAGE_TRANSFER_CONFIG

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_GET_SPITFP_ERROR_COUNT

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_SET_BOOTLOADER_MODE

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_GET_BOOTLOADER_MODE

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_SET_WRITE_FIRMWARE_POINTER

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_WRITE_FIRMWARE

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_SET_STATUS_LED_CONFIG

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_GET_STATUS_LED_CONFIG

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_GET_CHIP_TEMPERATURE

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_RESET

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_WRITE_UID

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_READ_UID

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTION_GET_IDENTITY

This constant is used with the get_response_expected(), set_response_expected() and set_response_expected_all() subroutines.

FUNCTIONS

new()

Creates an object with the unique device ID *uid* and adds it to the IP Connection *ipcon*.

get_high_contrast_image_low_level()

Returns the current high contrast image. See `here <https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Thermal_Imaging.html#high-contrast-image-vs-temperature-image>`__ for the difference between High Contrast and Temperature Image. If you don't know what to use the High Contrast Image is probably right for you.

The data is organized as a 8-bit value 80x60 pixel matrix linearized in a one-dimensional array. The data is arranged line by line from top left to bottom right.

Each 8-bit value represents one gray-scale image pixel that can directly be shown to a user on a display.

Before you can use this function you have to enable it with :func:`Set Image Transfer Config`.

get_temperature_image_low_level()

Returns the current temperature image. See `here <https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Thermal_Imaging.html#high-contrast-image-vs-temperature-image>`__ for the difference between High Contrast and Temperature Image. If you don't know what to use the High Contrast Image is probably right for you.

The data is organized as a 16-bit value 80x60 pixel matrix linearized in a one-dimensional array. The data is arranged line by line from top left to bottom right.

Each 16-bit value represents one temperature measurement in either Kelvin/10 or Kelvin/100 (depending on the resolution set with:func:`Set Resolution`).

Before you can use this function you have to enable it with :func:`Set Image Transfer Config`.

get_statistics()

Returns the spotmeter statistics, various temperatures, current resolution and status bits.

The spotmeter statistics are:

* Index 0: Mean Temperature. * Index 1: Maximum Temperature. * Index 2: Minimum Temperature. * Index 3: Pixel Count of spotmeter region of interest.

The temperatures are:

* Index 0: Focal Plain Array temperature. * Index 1: Focal Plain Array temperature at last FFC (Flat Field Correction). * Index 2: Housing temperature. * Index 3: Housing temperature at last FFC.

The resolution is either `0 to 6553 Kelvin` or `0 to 655 Kelvin`. If the resolution is the former, the temperatures are in Kelvin/10, if it is the latter the temperatures are in Kelvin/100.

FFC (Flat Field Correction) Status:

* FFC Never Commanded: Only seen on startup before first FFC. * FFC Imminent: This state is entered 2 seconds prior to initiating FFC. * FFC In Progress: Flat field correction is started (shutter moves in front of lens and back). Takes about 1 second. * FFC Complete: Shutter is in waiting position again, FFC done.

Temperature warning bits:

* Index 0: Shutter lockout (if true shutter is locked out because temperature is outside -10°C to +65°C) * Index 1: Overtemperature shut down imminent (goes true 10 seconds before shutdown)

set_resolution()

Sets the resolution. The Thermal Imaging Bricklet can either measure

* from 0 to 6553 Kelvin (-273.15°C to +6279.85°C) with 0.1°C resolution or * from 0 to 655 Kelvin (-273.15°C to +381.85°C) with 0.01°C resolution.

The default value is 0 to 655 Kelvin.

get_resolution()

Returns the resolution as set by :func:`Set Resolution`.

set_spotmeter_config()

Sets the spotmeter region of interest. The 4 values are

* Index 0: Column start (has to be smaller then Column end). * Index 1: Row start (has to be smaller then Row end). * Index 2: Column end (has to be smaller then 80). * Index 3: Row end (has to be smaller then 60).

The spotmeter statistics can be read out with :func:`Get Statistics`.

The default region of interest is (39, 29, 40, 30).

get_spotmeter_config()

Returns the spotmeter config as set by :func:`Set Spotmeter Config`.

set_high_contrast_config()

Sets the high contrast region of interest, dampening factor, clip limit and empty counts. This config is only used in high contrast mode (see :func:`Set Image Transfer Config`).

The high contrast region of interest consists of four values:

* Index 0: Column start (has to be smaller or equal then Column end). * Index 1: Row start (has to be smaller then Row end). * Index 2: Column end (has to be smaller then 80). * Index 3: Row end (has to be smaller then 60).

The algorithm to generate the high contrast image is applied to this region.

Dampening Factor: This parameter is the amount of temporal dampening applied to the HEQ (history equalization) transformation function. An IIR filter of the form::

(N / 256) * previous + ((256 - N) / 256) * current

is applied, and the HEQ dampening factor represents the value N in the equation, i.e., a value that applies to the amount of influence the previous HEQ transformation function has on the current function. The lower the value of N the higher the influence of the current video frame whereas the higher the value of N the more influence the previous damped transfer function has.

Clip Limit Index 0 (AGC HEQ Clip Limit Low): This parameter defines an artificial population that is added to every non-empty histogram bin. In other words, if the Clip Limit Low is set to L, a bin with an actual population of X will have an effective population of L + X. Any empty bin that is nearby a populated bin will be given an artificial population of L. The effect of higher values is to provide a more linear transfer function; lower values provide a more non-linear (equalized) transfer function.

Clip Limit Index 1 (AGC HEQ Clip Limit High): This parameter defines the maximum number of pixels allowed to accumulate in any given histogram bin. Any additional pixels in a given bin are clipped. The effect of this parameter is to limit the influence of highly-populated bins on the resulting HEQ transformation function.

Empty Counts: This parameter specifies the maximum number of pixels in a bin that will be interpreted as an empty bin. Histogram bins with this number of pixels or less will be processed as an empty bin.

The default values are

* Region Of Interest = (0, 0, 79, 59), * Dampening Factor = 64, * Clip Limit = (4800, 512) and * Empty Counts = 2.

get_high_contrast_config()

Returns the high contrast config as set by :func:`Set High Contrast Config`.

set_image_transfer_config()

The necessary bandwidth of this Bricklet is too high to use getter/callback or high contrast/temperature image at the same time. You have to configure the one you want to use, the Bricklet will optimize the internal configuration accordingly.

Corresponding functions:

* Manual High Contrast Image: :func:`Get High Contrast Image`. * Manual Temperature Image: :func:`Get Temperature Image`. * Callback High Contrast Image: :cb:`High Contrast Image` callback. * Callback Temperature Image: :cb:`Temperature Image` callback.

The default is Manual High Contrast Image (0).

get_image_transfer_config()

Returns the image transfer config, as set by :func:`Set Image Transfer Config`.

get_spitfp_error_count()

Returns the error count for the communication between Brick and Bricklet.

The errors are divided into

* ack checksum errors, * message checksum errors, * frameing errors and * overflow errors.

The errors counts are for errors that occur on the Bricklet side. All Bricks have a similar function that returns the errors on the Brick side.

set_bootloader_mode()

Sets the bootloader mode and returns the status after the requested mode change was instigated.

You can change from bootloader mode to firmware mode and vice versa. A change from bootloader mode to firmware mode will only take place if the entry function, device identifier und crc are present and correct.

This function is used by Brick Viewer during flashing. It should not be necessary to call it in a normal user program.

get_bootloader_mode()

Returns the current bootloader mode, see :func:`Set Bootloader Mode`.

set_write_firmware_pointer()

Sets the firmware pointer for :func:`Write Firmware`. The pointer has to be increased by chunks of size 64. The data is written to flash every 4 chunks (which equals to one page of size 256).

This function is used by Brick Viewer during flashing. It should not be necessary to call it in a normal user program.

write_firmware()

Writes 64 Bytes of firmware at the position as written by :func:`Set Write Firmware Pointer` before. The firmware is written to flash every 4 chunks.

You can only write firmware in bootloader mode.

This function is used by Brick Viewer during flashing. It should not be necessary to call it in a normal user program.

set_status_led_config()

Sets the status LED configuration. By default the LED shows communication traffic between Brick and Bricklet, it flickers once for every 10 received data packets.

You can also turn the LED permanently on/off or show a heartbeat.

If the Bricklet is in bootloader mode, the LED is will show heartbeat by default.

get_status_led_config()

Returns the configuration as set by :func:`Set Status LED Config`

get_chip_temperature()

Returns the temperature in °C as measured inside the microcontroller. The value returned is not the ambient temperature!

The temperature is only proportional to the real temperature and it has bad accuracy. Practically it is only useful as an indicator for temperature changes.

reset()

Calling this function will reset the Bricklet. All configurations will be lost.

After a reset you have to create new device objects, calling functions on the existing ones will result in undefined behavior!

write_uid()

Writes a new UID into flash. If you want to set a new UID you have to decode the Base58 encoded UID string into an integer first.

We recommend that you use Brick Viewer to change the UID.

read_uid()

Returns the current UID as an integer. Encode as Base58 to get the usual string version.

get_identity()

Returns the UID, the UID where the Bricklet is connected to, the position, the hardware and firmware version as well as the device identifier.

The position can be 'a', 'b', 'c' or 'd'.

The device identifier numbers can be found :ref:`here <device_identifier>`. |device_identifier_constant|

get_high_contrast_image()

Returns the current high contrast image. See `here <https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Thermal_Imaging.html#high-contrast-image-vs-temperature-image>`__ for the difference between High Contrast and Temperature Image. If you don't know what to use the High Contrast Image is probably right for you.

The data is organized as a 8-bit value 80x60 pixel matrix linearized in a one-dimensional array. The data is arranged line by line from top left to bottom right.

Each 8-bit value represents one gray-scale image pixel that can directly be shown to a user on a display.

Before you can use this function you have to enable it with :func:`Set Image Transfer Config`.

get_temperature_image()

Returns the current temperature image. See `here <https://www.tinkerforge.com/en/doc/Hardware/Bricklets/Thermal_Imaging.html#high-contrast-image-vs-temperature-image>`__ for the difference between High Contrast and Temperature Image. If you don't know what to use the High Contrast Image is probably right for you.

The data is organized as a 16-bit value 80x60 pixel matrix linearized in a one-dimensional array. The data is arranged line by line from top left to bottom right.

Each 16-bit value represents one temperature measurement in either Kelvin/10 or Kelvin/100 (depending on the resolution set with:func:`Set Resolution`).

Before you can use this function you have to enable it with :func:`Set Image Transfer Config`.