owlift module

class OwColor

Bases: enum.Enum

Represents color tables.

GRAY

Grayscale

BLUE_ORANGE

Blue Orange

RAINBOW

Rainbow

class OwDevice(cobj, raw_play=False)

Bases: object

Represents the device.

property agc_range

Temperature range for Auto Gain Control (min, max). [Writable]

The temperature less than the specified minimum temperature is corrected to the minimum color value. The temperature greater than the specified maximum temperature is corrected to the maximum color value.

Type

(float, float)

property agc_roi_mask

ROI (Region of Interest) of Auto Gain Control. [Writable]

ROI is useful when colors look flat because there are pixels of high or low temperature at uninsteresting area. When the mask value that position corresponds to the pixel’s position is True or 0, the pixel is calculation target. If you try to set array that values are all Falses or zeros, throws an exception.

Type

numpy.array

property alive

Reverse value of disconnected(). [Read only]

Type

bool

capture_start()

Starts getting data from the device.

capture_stop()

Stops getting data from the device.

property color

Type of color table. [Writable]

Type

OwColor

command_get(module_id, cmd_id_base, num_data, opt=0)
command_run(module_id, cmd_id_base)

Executes the sensor’s command as command type “RUN”. See this document about sensor’s commands. An error possibly occurs after capture stared.

  • module_id (int)

    Module ID.

  • cmd_id_base (int)

    Command ID Base.

command_set(module_id, cmd_id_base, data)

Writes the specified value to the register, and executes the sensor’s command as command type “SET”. See this document about sensor’s commands. An error possibly occurs after capture stared.

  • module_id (int)

    Module ID.

  • cmd_id_base (int)

    Command ID Base.

  • data (numpy.ndarray)

    The array that stores registers’ values of numpy.uint16.

property disconnected

Whether or not the device was disconnected. [Read only]

When playing raw-recording file, represents whether or not at the end of the file

Type

bool

enable_high_gain_mode()

Enables High Gain mode. Cannot use against Type-A.

property file_time_length

Length of the raw-recording file in seconds. [Writable]

Type

int

property firmware_version

Version number of the device firmware. [Read only]

Type

int

property frame

Tuple of the the temperature data, the image data and the meta data. [Read only]

The temperature data and the image data are arrays that have dimensions of width x height. The each element of the temperature data is a kelvin value (float). Returns (None, None, None) if EOF is reached while playing a raw-recording file.

Type

(numpy.array, numpy.array, OwFrameMeta)

property frame_counter

Frame counter. [Read only]

Type

int

property frame_size

Frame size (width, height). [Read only]

Type

(int, int)

property gain_control

Type of gain control. [Writable]

Type

OwGainControl

get_active()

Queries to the device whether it is active or not.

Return

Whether it is active or not.

property image_enabled

Whether or not returning image by ‘frame’ property. [Writable]

Type

bool

property magnification_enabled

Whether or not magnifying the image 3 times vertically and horizontally. [Writable]

Type

bool

property manual_gain_range

Temperature range for Manual Gain Control (min, max). [Writable]

The temperature less than the specified minimum temperature is corrected to the minimum color value. The temperature greater than the specified maximum temperature is corrected to the maximum color value.

Type

(float, float)

property noise_filter

Threshold of the noise filter. [Writable]

The threshold means integer value of temperature difference. If the difference of the target pixel and its adjacent pixels is over the threshold, the target pixel will be averaged by the noise filter.

Type

float

property product_id

Product ID of the device. [Read only]

Type

int

property raw_enabled

Whether or not returning raw data instead of temperature data by ‘frame’ property. [Writable]

Type

bool

raw_play_rewind()

Rewind the reading position while playing a raw-recording file.

property raw_play_time_based_agc

Whether or not Time-Based AGC is enabled. [Writable]

This function can be called against an OwDevice object that is got by func:raw_play_start.

Type

bool

raw_play_time_based_agc_setup(frame_num_intvl=10, from_time_offset=0, to_time_offset=0)

Extracts frames from the raw-recording file at the specified interval and setup Time-Based AGC minimum and maximum temperatures of all the frames.

  • frame_num_intvl (int)

    The interval number of frames for extracting.

  • from_time_offset (int)

    The time offset to start calculating.

  • to_time_offset (int)

    The time offset to stop calculating.

raw_record_add()

Adds the last frame data which was got by the ‘frame’ property to the raw-recording file.

raw_record_start(file_path, frame_rate_numerator=3, frame_rate_denominator=26)

Starts raw-recording.

  • file_path (str)

    The recording file path.

  • frame_rate_numerator (int)

    The numerator of the frame rate.

  • frame_rate_numerator (int)

    The denominator of the frame rate.

raw_record_stop()

Stops raw-recording.

raw_to_image(raw)

Converts the frame of raw data to a image.

The format of raw data is same as one returning by frame property when raw_enabled is True. The processes such as the noise filter are applied following the settings. The raw data passed to this function replaces the target of raw_record_add(). To be more specific, if you execute frame property, raw_to_image() and raw_record_add() in this order, the frame passed to raw_to_image() is added to a raw-recording file.

  • raw (numpy.array)

    Raw data.

Return

The array that represents image.

Return Type

numpy.array

reconnect()

Disconnect the device from the host and reconnect it by software operation. Type-F supports this function only after the firmware version 3.1.

release()

Release the device.

property rgb_order

Byte-order for RGB format. True: BGR, False: RGB [Writable]

Type

bool

run_ffc()

Execute FFC.

property serial_number

Serial number of the LWIR sensor in the device. [Read only]

Type

(int, int, int, int)

set_reflection_correction_file(file)

Sets a reflection correction data file.

Reflection correction reduce a reflected image of OWLIFT in a protection window. Reflection correction data file can be generated and exported by OWLIFTCap.

  • file (str)

    The path of the reflection correction data file. If None is passed, reflection correction is turned off.

temp_to_image(temp)

Converts the frame of temperature data to a image.

The format of temperature data is same as one returning by frame property when raw_enabled is False. The processes such as the noise filter are not applied. This is useful when you edit temperature data and convert to an image.

Return Type

numpy.array

property undistortion

Whether or not Undistortion is enabled. [Writable]

The default value is False for OWLIFT Type-A/B, is True for OWLIFT Type-F.

Type

bool

property upside_down_enabled

Whether or not rotating the image 180 degrees. [Writable]

Type

bool

property window_correction

Correction type for protection windows. [Writable]

ex) ow.window_correction = owlift.OwWindowCorrectionType.GAT05_STD_HOUSING

Type

OwWindowCorrectionType

exception OwException(value)

Bases: Exception

Represents exception.

property host_error

Host error. [Read only]

A host error is platform-dependant error code when ‘status’ is OwStatus.DIRECTSHOW_ERROR or OwStatus.V4L2_ERROR.

Type

int

property status

The kind of error. [Read only]

Type

OwStatus

class OwFrameMeta(telemetry_data, file_datetime, file_time_offset)

Bases: object

Represents the meta data attached to a frame.

property file_datetime

Timestamp while playing a raw-recording file. [Read only]

Type

datetime.datetime

property file_time_offset

Time offset while playing a raw-recording file. [Read only]

Type

int

property telemetry_data

Telemetry data. [Read only]

Type

OwTelemetryData

class OwGainControl

Bases: enum.Enum

Represents types of gain control.

MANUAL

Manual gain control

AUTO_LINEAR

Linear auto gain control

AUTO_NON_LINEAR

Non-linear auto gain control

class OwStatus

Bases: enum.Enum

Represents error codes.

OK

Success.

INTERNAL_ERROR

Library’s internal error.

NO_MEMORY

Not enough memory.

DEVICE_NOT_FOUND

No device was found.

DEVICE_NOT_READY

Device is not ready.

DEVICE_UNSUPPORTED

Unsupported device.

NOT_ENOUGH_SIZE

Not enough size of the area.

NOT_YET

Processing is not completed.

FIRMWARE_ERROR

Error occurred in device firmware.

SENSOR_ERROR

Error occurred in device sensor.

DIRECTSHOW_ERROR

Error occurred in DirectShow.

V4L2_ERROR

Error occurred in V4L2.

NULL_POINTER

Argument as a pointer type is NULL.

INVALID_VALUE

Value of argument is invalid.

INVALID_STATE

Function is called in invalid state.

FILE_IO_ERROR

File I/O error occurred.

INVALID_FILE_FORMAT

Invalid file format.

END_OF_FILE

End of file.

INCOMPATIBLE

Incompatible.

class OwTelemetryData(telem_bytes)

Bases: object

Represents Telemetry Data.

Property

Offset

Description

telemetry_revision

0

Telemetry Revision

time_counter

1

Time Counter

status_bits

3

Status Bits

status_ffc_complete

3

Whether or not FFC state is completed which Status Bits represents

module_serial

5

Module Serial #

software_revision

13

Software Revision

frame_counter

20

Frame Counter

frame_mean

22

Frame Mean

fpa_temp_in_counts

23

FPA Temp in counts

fpa_temp_kx100

24

FPA Temp in Kelvin x 100

housing_temp_in_counts

25

Housing Temp in counts

housing_temp_kx100

26

Housing Temp in kelvin x 100

fpa_temp_ffc_kx100

29

FPA Temp at last FFC

ffc_time_counter

30

Time Counter at last FFC

housing_temp_ffc_kx100

32

Housing Temp at last FFC

reserved_b0

0

Reserved

emissivity_x8192

19

Emissivity scaled by 8192

background_temp_kx100

20

Background Temperature in kelvin x 100

atmospheric_trans_x8192

21

Atmospheric Transmission scaled by 8192

atmospheric_temp_kx100

22

Atmospheric Temperature in kelvin x 100

window_trans_x8192

23

Window Transmission scaled by 8192

window_reflect_x8192

24

Window Reflection scaled by 8192

window_temp_kx100

25

Window Temperature in kelvin x 100

window_reflect_temp_kx100

26

Window Reflected Temperature in kelvin x 100

gain_mode

5

Gain Mode

effective_gain

6

Effective Gain

gain_mode_desired_flag

7

Gain Mode Desired Flag

temp_gain_mode_threshold_h_to_l_degc

8

Temperature Gain Mode Threshold High to Low (degC)

temp_gain_mode_threshold_l_to_h_degc

9

Temperature Gain Mode Threshold Low to High (degC)

temp_gain_mode_threshold_h_to_l_k

10

Temperature Gain Mode Threshold High to Low (K)

temp_gain_mode_threshold_l_to_h_k

11

Temperature Gain Mode Threshold Low to High (K)

population_gain_mode_threshold_h_to_l

14

Population Gain Mode Threshold High to Low

population_gain_mode_threshold_l_to_t

15

Population Gain Mode Threshold Low to High

gain_mode_roi

22

Gain Mode ROI

t_linear_eabled_state

48

TLinear Enabled State

t_linear_resolution

49

TLinear Resolution

spot_meter_mean

50

Spotmeter Mean

spot_meter_max

51

Spotmeter Maximum

spot_meter_min

52

Spotmeter Minimum

spot_meter_population

53

Spotmeter Population

spot_meter_roi_start_row

54

Spotmeter ROI Start Row

spot_meter_roi_start_col

55

Spotmeter ROI Start Col

spot_meter_roi_end_row

56

Spotmeter ROI End Row

spot_meter_roi_end_col

57

Spotmeter ROI End Col

class OwWindowCorrectionType

Bases: enum.Enum

Represents a correction type for protection windows.

NONE

No protection window

GAT05_STD_HOUSING

Standard housing / GAT-05

devices()

Returns the list of devices.

Return

The list of devices.

Return Type

tuple of OwDevice

lib_version()

Returns the native library’s version number.

Return

The native library’s version number.

Return Type

(int, int, int)

raw_play_start(file_path)

Play the raw-recording file.

  • file_path (str)

    The file path of a raw-recording file.

Return

The virtual device whose data source is the raw-recording file.

Return Type

OwDevice