Camera control

class hsi.HSCamera(input)

The camera interface type.

This type can represent either a real camera (through a TCP or GigE connection) or a simulated image-based camera.

classmethod __new__(*args, **kwargs)
get_analog_gain()

Get Analog gain

Returns:

Analog gain

Return type:

float

get_bands()

Get the current band selection.

Returns:

List of band selections.

Return type:

list[BandSelection]

get_bit_mode()

Get the current bit mode.

Returns:

The current bit mode as bits (8, 10, or 12).

Return type:

int

get_config()

Get the hyperspectral camera configuration.

Returns:

The configuration object.

Return type:

HSCameraConfig

get_crop()

Get the current crop settings.

Returns:

The current crop information.

Return type:

CropInfo

get_exposure()

Get the exposure time in microseconds.

Returns:

Exposure time in microseconds.

Return type:

int

get_framerate()

Get the current framerate.

Returns:

The framerate.

Return type:

float

get_framerate_list()

Get the possible framerates.

Returns:

Either a min/max framerate range or a list of possible discrete values.

Return type:

dict | list

get_horizontal_binning()

Get the horizontal binning factor.

Returns:

The current horizontal binning factor.

Return type:

int

get_vertical_binning()

Get the vertical binning factor.

Returns:

The current vertical binning factor.

Return type:

int

get_wavelengths()

Get the wavelengths of the camera’s spectral bands.

Returns:

List of wavelengths in nanometers.

Return type:

list[float]

set_analog_gain(value)

Set Analog gain

Parameters:

value (float) – The new analog gain

Returns:

Analog gain

Return type:

float

set_bands(value)

Set the bands configuration.

Parameters:

value (list[BandSelection]) – The new band selections.

Returns:

The actual set band selections.

Return type:

list[BandSelection]

set_bit_mode(bit_mode)
set_config(value)

Set the hyperspectral camera configuration.

Parameters:

value (HSCameraConfig) – The new configuration.

Returns:

The actual set configuration.

Return type:

HSCameraConfig

set_exposure(value)

Set the exposure time.

Parameters:

value (int) – The new exposure time in microseconds.

Returns:

The actual set value.

Return type:

int

set_framerate(value)

Set the current framerate.

Parameters:

value (float) – The desired framerate.

Returns:

The framerate that was set on the camera.

Return type:

float

set_horizontal_binning(value)

Set the horizontal binning factor.

Parameters:

value (int) – The desired horizontal binning factor.

Returns:

The actual horizontal binning factor set on the camera.

Return type:

int

set_horizontal_crop(start, end)

Set the horizontal crop boundaries.

Parameters:
  • start (int) – The start position of the crop.

  • end (int) – The end position of the crop.

Returns:

The actual set horizontal crop.

Return type:

HorizontalCrop

set_vertical_binning(value)

Set the vertical binning factor.

Parameters:

value (int) – The desired vertical binning factor.

Returns:

The actual vertical binning factor set on the camera.

Return type:

int

stream(n_frames=None)

Start camera stream.

Parameters:

n_frames (Optional[int]) – If set, the stream produces at most this many frames before terminating on its own. If None (the default), the stream runs until CameraStream.stop() is called.

to_hs_image()

Convert to HSImage.

Returns:

Hyperspectral image.

Return type:

HSImage

__module__ = 'builtins'
class hsi.CameraStream

Type representing a regular two-dimensional frame stream.

__enter__()
__exit__(_exc_type, _exc_value, _traceback)
__iter__()

Implement iter(self).

__next__()

Implement next(self).

get_frame()

Get a single frame from the stream.

Returns:

The frame data as a 2D Numpy array and metadata.

Return type:

tuple[hsi.FrameMeta, ndarray] | none

stop()

Stop the stream.

__module__ = 'builtins'