Skip to content

blueye.sdk.camera

camera

Classes:

  • Camera –

    Handles the camera functionality for the Blueye drone.

  • Overlay –

    Control the overlay on videos and pictures.

  • Tilt –

    Handles the camera tilt functionality for the Blueye drone.

Camera

Camera(
    parent_drone: Drone, is_guestport_camera: bool = False
)

Handles the camera functionality for the Blueye drone.

Parameters:

  • parent_drone (Drone) –

    The parent drone instance.

  • is_guestport_camera (bool, default: False ) –

    Whether this is a guestport camera.

Methods:

Source code in blueye/sdk/camera.py
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
def __init__(self, parent_drone: Drone, is_guestport_camera: bool = False):
    """Initialize the Camera class.

    Args:
        parent_drone (Drone): The parent drone instance.
        is_guestport_camera (bool, optional): Whether this is a guestport camera.
    """
    self._parent_drone = parent_drone
    self._is_guestport_camera = is_guestport_camera
    self._camera_type = (
        blueye.protocol.Camera.CAMERA_GUESTPORT
        if is_guestport_camera
        else blueye.protocol.Camera.CAMERA_MAIN
    )
    if not self._is_guestport_camera:
        self.tilt = Tilt(parent_drone)
        self.overlay = Overlay(parent_drone)
    self._camera_parameters = None

configure

configure(timeout: float = 0.5) -> _ParamsBatch

Return a context manager for batching camera parameter changes.

All attribute assignments on the returned object are accumulated and sent as a single set_camera_parameters request when the with block exits. If an exception is raised inside the block the changes are discarded.

Parameters take the same names and values as the corresponding setters; the protobuf field names and enums are accepted as well.

Parameters:

  • timeout (float, default: 0.5 ) –

    Timeout in seconds for the request. Increase when changing parameters that trigger pipeline restarts (e.g. codec, resolution).

Raises:

  • ValueError –

    If a value is not valid for the parameter being set.

  • RuntimeError –

    If a parameter requires a newer Blunux version than the drone runs.

Usage::

with drone.camera.configure() as params:
    params.recording_codec = bp.RecordingCodec.RECORDING_CODEC_H265
    params.recording_bitrate = 20_000_000
# sent here
Source code in blueye/sdk/camera.py
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
def configure(self, timeout: float = 0.5) -> _ParamsBatch:
    """Return a context manager for batching camera parameter changes.

    All attribute assignments on the returned object are accumulated and sent as a single
    ``set_camera_parameters`` request when the ``with`` block exits.  If an exception is
    raised inside the block the changes are discarded.

    Parameters take the same names and values as the corresponding setters; the protobuf
    field names and enums are accepted as well.

    Args:
        timeout (float, optional): Timeout in seconds for the request. Increase when changing
            parameters that trigger pipeline restarts (e.g. codec, resolution).

    Raises:
        ValueError: If a value is not valid for the parameter being set.
        RuntimeError: If a parameter requires a newer Blunux version than the drone runs.

    Usage::

        with drone.camera.configure() as params:
            params.recording_codec = bp.RecordingCodec.RECORDING_CODEC_H265
            params.recording_bitrate = 20_000_000
        # sent here
    """
    return self._ParamsBatch(self, timeout=timeout)

enable_ehdr

enable_ehdr(enable_ehdr: bool)

Enable or disable the eHDR mode.

Only available on Ultra.

Parameters:

  • enable_ehdr (bool) –

    True to enable eHDR mode, False to disable it. Enabled by default.

Raises:

  • RuntimeError –

    If the connected drone is running a Blunux version older than 5.0.0.

Source code in blueye/sdk/camera.py
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
def enable_ehdr(self, enable_ehdr: bool):
    """Enable or disable the eHDR mode.

    Only available on Ultra.

    Args:
        enable_ehdr (bool): True to enable eHDR mode, False to disable it. Enabled by default.

    Raises:
        RuntimeError: If the connected drone is running a Blunux version older than 5.0.0.
    """
    self._parent_drone._verify_required_blunux_version("5.0.0")
    if self._camera_parameters is None:
        self._update_camera_parameters()
    self._camera_parameters.ehdr_enabled = enable_ehdr
    self._parent_drone._req_rep_client.set_camera_parameters(self._camera_parameters)

get_backlight_compensation

get_backlight_compensation() -> int

Get the camera backlight compensation.

Only available on Ultra.

Returns:

  • int –

    The camera backlight compensation.

Source code in blueye/sdk/camera.py
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
def get_backlight_compensation(self) -> int:
    """Get the camera backlight compensation.

    Only available on Ultra.

    Returns:
        The camera backlight compensation.
    """
    self._update_camera_parameters()
    return self._camera_parameters.backlight_compensation

get_bitrate

get_bitrate() -> int

Get the video stream bitrate.

Returns:

  • int –

    The H264 video stream bitrate.

Source code in blueye/sdk/camera.py
1058
1059
1060
1061
1062
1063
1064
1065
def get_bitrate(self) -> int:
    """Get the video stream bitrate.

    Returns:
        The H264 video stream bitrate.
    """
    self._update_camera_parameters()
    return self._camera_parameters.h264_bitrate

get_bitrate_still_picture

get_bitrate_still_picture() -> int

Get the bitrate for the still picture stream.

Returns:

  • int –

    The still picture stream bitrate.

Source code in blueye/sdk/camera.py
1081
1082
1083
1084
1085
1086
1087
1088
def get_bitrate_still_picture(self) -> int:
    """Get the bitrate for the still picture stream.

    Returns:
        The still picture stream bitrate.
    """
    self._update_camera_parameters()
    return self._camera_parameters.mjpg_bitrate

get_brightness

get_brightness() -> int

Get the camera brightness.

Only available on Ultra.

Returns:

  • int –

    The camera brightness.

Source code in blueye/sdk/camera.py
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
def get_brightness(self) -> int:
    """Get the camera brightness.

    Only available on Ultra.

    Returns:
        The camera brightness.
    """
    self._update_camera_parameters()
    return self._camera_parameters.brightness

get_contrast

get_contrast() -> int

Get the camera contrast.

Only available on Ultra.

Returns:

  • int –

    The camera contrast.

Source code in blueye/sdk/camera.py
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
def get_contrast(self) -> int:
    """Get the camera contrast.

    Only available on Ultra.

    Returns:
        The camera contrast.
    """
    self._update_camera_parameters()
    return self._camera_parameters.contrast

get_denoise

get_denoise() -> int

Get the camera noise reduction.

Only available on Ultra.

Returns:

  • int –

    The camera noise reduction.

Source code in blueye/sdk/camera.py
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
def get_denoise(self) -> int:
    """Get the camera noise reduction.

    Only available on Ultra.

    Returns:
        The camera noise reduction.
    """
    self._update_camera_parameters()
    return self._camera_parameters.denoise

get_ehdr_exposure_max_number

get_ehdr_exposure_max_number() -> int

Get the maximum number of eHDR frames.

Only available on Ultra.

Returns:

  • int –

    The maximum number of eHDR frames.

Source code in blueye/sdk/camera.py
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
def get_ehdr_exposure_max_number(self) -> int:
    """Get the maximum number of eHDR frames.

    Only available on Ultra.

    Returns:
        The maximum number of eHDR frames.
    """
    self._update_camera_parameters()
    return self._camera_parameters.ehdr_exposure_max_number

get_ehdr_exposure_min_number

get_ehdr_exposure_min_number() -> int

Get the minimum number of eHDR frames.

Only available on Ultra.

Returns:

  • int –

    The minimum number of eHDR frames.

Source code in blueye/sdk/camera.py
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
def get_ehdr_exposure_min_number(self) -> int:
    """Get the minimum number of eHDR frames.

    Only available on Ultra.

    Returns:
        The minimum number of eHDR frames.
    """
    self._update_camera_parameters()
    return self._camera_parameters.ehdr_exposure_min_number

get_exposure

get_exposure() -> int

Get the camera exposure.

Returns:

  • int –

    The camera exposure.

Source code in blueye/sdk/camera.py
1106
1107
1108
1109
1110
1111
1112
1113
def get_exposure(self) -> int:
    """Get the camera exposure.

    Returns:
        The camera exposure.
    """
    self._update_camera_parameters()
    return self._camera_parameters.exposure

get_framerate

get_framerate() -> int

Get the camera frame rate.

Raises:

  • RuntimeError –

    If the drone reports a frame rate the SDK does not recognize.

Returns:

  • int –

    The camera frame rate.

Source code in blueye/sdk/camera.py
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
def get_framerate(self) -> int:
    """Get the camera frame rate.

    Raises:
        RuntimeError: If the drone reports a frame rate the SDK does not recognize.

    Returns:
        The camera frame rate.
    """
    self._update_camera_parameters()
    try:
        return _FRAMERATE_TO_FPS[self._camera_parameters.framerate]
    except KeyError:
        raise RuntimeError(
            "Drone reported an unsupported framerate: "
            f"{_describe_enum(self._camera_parameters.framerate)}"
        ) from None

get_gain

get_gain() -> float

Get the camera gain.

Only available on Pioneer/Pro/X1/X3.

Returns:

  • float –

    The camera ISO gain.

Source code in blueye/sdk/camera.py
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
def get_gain(self) -> float:
    """Get the camera gain.

    Only available on Pioneer/Pro/X1/X3.

    Returns:
        The camera ISO gain.
    """
    self._update_camera_parameters()
    return self._camera_parameters.gain

get_gamma

get_gamma() -> int

Get the camera gamma.

Only available on Ultra.

Returns:

  • int –

    The camera gamma.

Source code in blueye/sdk/camera.py
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
def get_gamma(self) -> int:
    """Get the camera gamma.

    Only available on Ultra.

    Returns:
        The camera gamma.
    """
    self._update_camera_parameters()
    return self._camera_parameters.gamma

get_hue

get_hue() -> int

Get the camera hue.

Returns:

  • int –

    The camera hue.

Source code in blueye/sdk/camera.py
1153
1154
1155
1156
1157
1158
1159
1160
def get_hue(self) -> int:
    """Get the camera hue.

    Returns:
        The camera hue.
    """
    self._update_camera_parameters()
    return self._camera_parameters.hue

get_mtu_size

get_mtu_size() -> int

Get the network MTU size used for video streaming.

Returns:

  • int –

    The MTU size in bytes (0 if the drone default is used).

Source code in blueye/sdk/camera.py
1760
1761
1762
1763
1764
1765
1766
1767
def get_mtu_size(self) -> int:
    """Get the network MTU size used for video streaming.

    Returns:
        The MTU size in bytes (0 if the drone default is used).
    """
    self._update_camera_parameters()
    return self._camera_parameters.mtu_size

get_record_time

get_record_time() -> Optional[int]

Get the duration of the current camera recording.

Returns:

  • Optional[int] –

    The length in seconds of the current recording, -1 if the camera is not currently recording. Returns None if the SDK hasn't received a RecordState telemetry message.

Source code in blueye/sdk/camera.py
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
def get_record_time(self) -> Optional[int]:
    """Get the duration of the current camera recording.

    Returns:
        The length in seconds of the current recording, -1 if the camera is not currently
        recording. Returns None if the SDK hasn't received a RecordState telemetry message.
    """
    record_state = self._get_record_state()
    if record_state is None:
        return None
    if self._is_guestport_camera:
        return record_state.guestport_seconds
    else:
        return record_state.main_seconds

get_recording_bitrate

get_recording_bitrate() -> int

Get the recording bitrate in bits per second.

A value of 0 means the drone will auto-compute a default bitrate based on the current resolution, framerate, and codec.

Returns:

  • int –

    The current recording bitrate in bits per second (0 if automatic).

Source code in blueye/sdk/camera.py
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
def get_recording_bitrate(self) -> int:
    """Get the recording bitrate in bits per second.

    A value of 0 means the drone will auto-compute a default bitrate based on the current
    resolution, framerate, and codec.

    Returns:
        The current recording bitrate in bits per second (0 if automatic).
    """
    self._update_camera_parameters()
    return self._camera_parameters.recording_bitrate

get_recording_codec

get_recording_codec() -> RecordingCodec

Get the recording video codec.

Returns:

Source code in blueye/sdk/camera.py
1670
1671
1672
1673
1674
1675
1676
1677
def get_recording_codec(self) -> blueye.protocol.RecordingCodec:
    """Get the recording video codec.

    Returns:
        The current recording codec setting.
    """
    self._update_camera_parameters()
    return self._camera_parameters.recording_codec

get_recording_resolution

get_recording_resolution() -> Resolution

Get the camera recording resolution.

For drones running Blunux version < 4.4.1 this is the same as the get_resolution method.

Returns:

Source code in blueye/sdk/camera.py
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
def get_recording_resolution(self) -> blueye.protocol.Resolution:
    """Get the camera recording resolution.

    For drones running Blunux version < 4.4.1 this is the same as the
    [`get_resolution`][blueye.sdk.camera.Camera.get_resolution] method.

    Returns:
        The camera recording resolution.
    """
    self._update_camera_parameters()

    # Drones running Blunux < 4.4 do not support recording resolution so we return the old
    # resolution field instead.
    if version.parse(self._parent_drone.software_version_short) < version.parse("4.4"):
        return self._camera_parameters.resolution
    else:
        return self._camera_parameters.recording_resolution

get_resolution

get_resolution() -> int

Get the camera resolution.

Deprecated

Drones running Blunux 4.4 or newer take the resolution from the stream and recording resolution fields. Use get_stream_resolution and get_recording_resolution instead.

Raises:

  • RuntimeError –

    If the drone reports a resolution the SDK does not recognize.

Returns:

  • int –

    The camera resolution.

Source code in blueye/sdk/camera.py
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
def get_resolution(self) -> int:
    """Get the camera resolution.

    Deprecated:
        Drones running Blunux 4.4 or newer take the resolution from the stream and recording
        resolution fields. Use
        [`get_stream_resolution`][blueye.sdk.camera.Camera.get_stream_resolution] and
        [`get_recording_resolution`][blueye.sdk.camera.Camera.get_recording_resolution]
        instead.

    Raises:
        RuntimeError: If the drone reports a resolution the SDK does not recognize.

    Returns:
        The camera resolution.
    """
    warnings.warn(
        "`Camera.get_resolution` is deprecated, use `Camera.get_stream_resolution` or "
        "`Camera.get_recording_resolution` instead",
        DeprecationWarning,
        stacklevel=2,
    )
    self._update_camera_parameters()
    try:
        return _RESOLUTION_TO_HEIGHT[self._camera_parameters.resolution]
    except KeyError:
        raise RuntimeError(
            "Drone reported an unsupported resolution: "
            f"{_describe_enum(self._camera_parameters.resolution)}"
        ) from None

get_saturation

get_saturation() -> int

Get the camera saturation.

Only available on Ultra.

Returns:

  • int –

    The camera saturation.

Source code in blueye/sdk/camera.py
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
def get_saturation(self) -> int:
    """Get the camera saturation.

    Only available on Ultra.

    Returns:
        The camera saturation.
    """
    self._update_camera_parameters()
    return self._camera_parameters.saturation

get_sharpness

get_sharpness() -> int

Get the camera sharpness.

Only available on Ultra.

Returns:

  • int –

    The camera sharpness.

Source code in blueye/sdk/camera.py
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
def get_sharpness(self) -> int:
    """Get the camera sharpness.

    Only available on Ultra.

    Returns:
        The camera sharpness.
    """
    self._update_camera_parameters()
    return self._camera_parameters.sharpness

get_stream_resolution

get_stream_resolution() -> Resolution

Get the camera stream resolution.

For drones running blunux version < 4.4.1 this is the same as the get_resolution method.

Returns:

Source code in blueye/sdk/camera.py
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
def get_stream_resolution(self) -> blueye.protocol.Resolution:
    """Get the camera stream resolution.

    For drones running blunux version < 4.4.1 this is the same as the
    [`get_resolution`][blueye.sdk.camera.Camera.get_resolution] method.

    Returns:
        The camera stream resolution
    """
    self._update_camera_parameters()

    # Drones running Blunux < 4.4 do not support stream resolution so we return the old
    # resolution field instead.
    if version.parse(self._parent_drone.software_version_short) < version.parse("4.4"):
        return self._camera_parameters.resolution
    else:
        return self._camera_parameters.stream_resolution

get_streaming_protocol

get_streaming_protocol() -> StreamingProtocol

Get the streaming protocol (codec used for the RTSP stream).

Returns:

Source code in blueye/sdk/camera.py
1733
1734
1735
1736
1737
1738
1739
1740
def get_streaming_protocol(self) -> blueye.protocol.StreamingProtocol:
    """Get the streaming protocol (codec used for the RTSP stream).

    Returns:
        The current streaming protocol.
    """
    self._update_camera_parameters()
    return self._camera_parameters.streaming_protocol

get_whitebalance

get_whitebalance() -> int

Get the camera white balance.

Returns:

  • int –

    The camera white balance.

Source code in blueye/sdk/camera.py
1130
1131
1132
1133
1134
1135
1136
1137
def get_whitebalance(self) -> int:
    """Get the camera white balance.

    Returns:
        The camera white balance.
    """
    self._update_camera_parameters()
    return self._camera_parameters.white_balance

is_ehdr_enabled

is_ehdr_enabled() -> bool

Get the state of the eHDR mode.

Only available on Ultra.

Returns:

  • bool –

    The current state of the eHDR mode.

Source code in blueye/sdk/camera.py
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
def is_ehdr_enabled(self) -> bool:
    """Get the state of the eHDR mode.

    Only available on Ultra.

    Returns:
        The current state of the eHDR mode.
    """
    self._update_camera_parameters()
    return self._camera_parameters.ehdr_enabled

is_recording_active

is_recording_active() -> Optional[bool]

Get the camera recording state.

Returns:

  • Optional[bool] –

    True if the camera is currently recording, False if not. Returns None if the SDK hasn't received a RecordState telemetry message.

Source code in blueye/sdk/camera.py
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
def is_recording_active(self) -> Optional[bool]:
    """Get the camera recording state.

    Returns:
        True if the camera is currently recording, False if not. Returns None if the SDK
        hasn't received a RecordState telemetry message.
    """
    record_state = self._get_record_state()
    if record_state is None:
        return None
    if self._is_guestport_camera:
        return record_state.guestport_is_recording
    else:
        return record_state.main_is_recording

set_backlight_compensation

set_backlight_compensation(compensation: int)

Set the camera backlight compensation.

Only available on Ultra.

Parameters:

  • compensation (int) –

    Set the backlight compensation (-150..150), 10 is the default.

Raises:

  • RuntimeError –

    If the connected drone is running a Blunux version older than 5.0.0.

Source code in blueye/sdk/camera.py
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
def set_backlight_compensation(self, compensation: int):
    """Set the camera backlight compensation.

    Only available on Ultra.

    Args:
        compensation (int): Set the backlight compensation (-150..150), 10 is the default.

    Raises:
        RuntimeError: If the connected drone is running a Blunux version older than 5.0.0.
    """
    self._parent_drone._verify_required_blunux_version("5.0.0")
    if self._camera_parameters is None:
        self._update_camera_parameters()
    self._camera_parameters.backlight_compensation = compensation
    self._parent_drone._req_rep_client.set_camera_parameters(self._camera_parameters)

set_bitrate

set_bitrate(bitrate: int)

Set the video stream bitrate.

Parameters:

  • bitrate (int) –

    Set the video stream bitrate in bits, valid values are in range (1 000 000 .. 16 000 000).

Source code in blueye/sdk/camera.py
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
def set_bitrate(self, bitrate: int):
    """Set the video stream bitrate.

    Args:
        bitrate (int): Set the video stream bitrate in bits, valid values are in range
                       (1 000 000 .. 16 000 000).
    """
    if self._camera_parameters is None:
        self._update_camera_parameters()
    self._camera_parameters.h264_bitrate = bitrate
    self._parent_drone._req_rep_client.set_camera_parameters(self._camera_parameters)

set_bitrate_still_picture

set_bitrate_still_picture(bitrate: int)

Set the bitrate for the still picture stream.

Parameters:

  • bitrate (int) –

    Set the still picture stream bitrate in bits, valid values are in range (1 000 000 .. 300 000 000). Default value is 100 000 000.

Source code in blueye/sdk/camera.py
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
def set_bitrate_still_picture(self, bitrate: int):
    """Set the bitrate for the still picture stream.

    Args:
        bitrate (int): Set the still picture stream bitrate in bits, valid values are in range
                       (1 000 000 .. 300 000 000). Default value is 100 000 000.
    """
    if self._camera_parameters is None:
        self._update_camera_parameters()
    self._camera_parameters.mjpg_bitrate = bitrate
    self._parent_drone._req_rep_client.set_camera_parameters(self._camera_parameters)

set_brightness

set_brightness(brightness: int)

Set the camera brightness.

Only available on Ultra.

Parameters:

  • brightness (int) –

    Set the brightness (-10..10), 0 is the default.

Raises:

  • RuntimeError –

    If the connected drone is running a Blunux version older than 5.0.0.

Source code in blueye/sdk/camera.py
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
def set_brightness(self, brightness: int):
    """Set the camera brightness.

    Only available on Ultra.

    Args:
        brightness (int): Set the brightness (-10..10), 0 is the default.

    Raises:
        RuntimeError: If the connected drone is running a Blunux version older than 5.0.0.
    """
    self._parent_drone._verify_required_blunux_version("5.0.0")
    if self._camera_parameters is None:
        self._update_camera_parameters()
    self._camera_parameters.brightness = brightness
    self._parent_drone._req_rep_client.set_camera_parameters(self._camera_parameters)

set_contrast

set_contrast(contrast: int)

Set the camera contrast.

Only available on Ultra.

Parameters:

  • contrast (int) –

    Set the contrast (-50..50), 0 is the default.

Raises:

  • RuntimeError –

    If the connected drone is running a Blunux version older than 5.0.0.

Source code in blueye/sdk/camera.py
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
def set_contrast(self, contrast: int):
    """Set the camera contrast.

    Only available on Ultra.

    Args:
        contrast (int): Set the contrast (-50..50), 0 is the default.

    Raises:
        RuntimeError: If the connected drone is running a Blunux version older than 5.0.0.
    """
    self._parent_drone._verify_required_blunux_version("5.0.0")
    if self._camera_parameters is None:
        self._update_camera_parameters()
    self._camera_parameters.contrast = contrast
    self._parent_drone._req_rep_client.set_camera_parameters(self._camera_parameters)

set_denoise

set_denoise(denoise: int)

Set the camera noise reduction.

Only available on Ultra.

Parameters:

  • denoise (int) –

    Set the noise reduction (-20..20), -20 is the default.

Raises:

  • RuntimeError –

    If the connected drone is running a Blunux version older than 5.0.0.

Source code in blueye/sdk/camera.py
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
def set_denoise(self, denoise: int):
    """Set the camera noise reduction.

    Only available on Ultra.

    Args:
        denoise (int): Set the noise reduction (-20..20), -20 is the default.

    Raises:
        RuntimeError: If the connected drone is running a Blunux version older than 5.0.0.
    """
    self._parent_drone._verify_required_blunux_version("5.0.0")
    if self._camera_parameters is None:
        self._update_camera_parameters()
    self._camera_parameters.denoise = denoise
    self._parent_drone._req_rep_client.set_camera_parameters(self._camera_parameters)

set_ehdr_exposure_max_number

set_ehdr_exposure_max_number(number: int)

Set the maximum number of eHDR frames.

Only available on Ultra.

Parameters:

  • number (int) –

    Set the maximum number of eHDR frames (1..4), 2 is the default. Setting it higher than 2 can reduce the frame rate.

Raises:

  • RuntimeError –

    If the connected drone is running a Blunux version older than 5.0.0.

Source code in blueye/sdk/camera.py
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
def set_ehdr_exposure_max_number(self, number: int):
    """Set the maximum number of eHDR frames.

    Only available on Ultra.

    Args:
        number (int): Set the maximum number of eHDR frames (1..4), 2 is the default. Setting
            it higher than 2 can reduce the frame rate.

    Raises:
        RuntimeError: If the connected drone is running a Blunux version older than 5.0.0.
    """
    self._parent_drone._verify_required_blunux_version("5.0.0")
    if self._camera_parameters is None:
        self._update_camera_parameters()
    self._camera_parameters.ehdr_exposure_max_number = number
    self._parent_drone._req_rep_client.set_camera_parameters(self._camera_parameters)

set_ehdr_exposure_min_number

set_ehdr_exposure_min_number(number: int)

Set the minimum number of eHDR frames.

Only available on Ultra.

Parameters:

  • number (int) –

    Set the minimum number of eHDR frames (1..4), 1 is the default.

Raises:

  • RuntimeError –

    If the connected drone is running a Blunux version older than 5.0.0.

Source code in blueye/sdk/camera.py
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
def set_ehdr_exposure_min_number(self, number: int):
    """Set the minimum number of eHDR frames.

    Only available on Ultra.

    Args:
        number (int): Set the minimum number of eHDR frames (1..4), 1 is the default.

    Raises:
        RuntimeError: If the connected drone is running a Blunux version older than 5.0.0.
    """
    self._parent_drone._verify_required_blunux_version("5.0.0")
    if self._camera_parameters is None:
        self._update_camera_parameters()
    self._camera_parameters.ehdr_exposure_min_number = number
    self._parent_drone._req_rep_client.set_camera_parameters(self._camera_parameters)

set_exposure

set_exposure(exposure: int)

Set the camera exposure.

Parameters:

  • exposure (int) –

    Set the camera exposure time. Unit is thousandths of a second, ie. 5 = 5s/1000. Valid values are in the range (1 .. 5000) or -1 for auto exposure.

Source code in blueye/sdk/camera.py
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
def set_exposure(self, exposure: int):
    """Set the camera exposure.

    Args:
        exposure (int): Set the camera exposure time. Unit is thousandths of a second,
                        ie. 5 = 5s/1000. Valid values are in the range (1 .. 5000) or -1
                        for auto exposure.
    """
    if self._camera_parameters is None:
        self._update_camera_parameters()
    self._camera_parameters.exposure = exposure
    self._parent_drone._req_rep_client.set_camera_parameters(self._camera_parameters)

set_framerate

set_framerate(framerate: int)

Set the camera frame rate.

Parameters:

  • framerate (int) –

    Set the camera frame rate in frames per second. Valid values are 25, 30 or 60. 25 fps is only supported on Pioneer/Pro/X1/X3, and 60 fps only on the Ultra at 1440p or lower. If the requested frame rate is not supported at the current resolution the drone reduces it while respecting the resolution.

Raises:

  • ValueError –

    If the frame rate is not 25, 30 or 60.

Source code in blueye/sdk/camera.py
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
def set_framerate(self, framerate: int):
    """Set the camera frame rate.

    Args:
        framerate (int): Set the camera frame rate in frames per second. Valid values are 25,
            30 or 60. 25 fps is only supported on Pioneer/Pro/X1/X3, and 60 fps only on the
            Ultra at 1440p or lower. If the requested frame rate is not supported at the
            current resolution the drone reduces it while respecting the resolution.

    Raises:
        ValueError: If the frame rate is not 25, 30 or 60.
    """
    if framerate not in _FPS_TO_FRAMERATE:
        raise ValueError(f"{framerate} is not a valid framerate. Valid values are 25, 30 or 60")
    if self._camera_parameters is None:
        self._update_camera_parameters()
    self._camera_parameters.framerate = _FPS_TO_FRAMERATE[framerate]
    self._parent_drone._req_rep_client.set_camera_parameters(self._camera_parameters)

set_gain

set_gain(gain: float)

Set the camera gain.

Only available on Pioneer/Pro/X1/X3.

Parameters:

  • gain (float) –

    Set the ISO gain (0..1).

Source code in blueye/sdk/camera.py
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
def set_gain(self, gain: float):
    """Set the camera gain.

    Only available on Pioneer/Pro/X1/X3.

    Args:
        gain (float): Set the ISO gain (0..1).
    """
    if self._camera_parameters is None:
        self._update_camera_parameters()
    self._camera_parameters.gain = gain
    self._parent_drone._req_rep_client.set_camera_parameters(self._camera_parameters)

set_gamma

set_gamma(gamma: int)

Set the camera gamma.

Only available on Ultra.

Parameters:

  • gamma (int) –

    Set the gamma (4..79), 22 is the default.

Raises:

  • RuntimeError –

    If the connected drone is running a Blunux version older than 5.0.0.

Source code in blueye/sdk/camera.py
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
def set_gamma(self, gamma: int):
    """Set the camera gamma.

    Only available on Ultra.

    Args:
        gamma (int): Set the gamma (4..79), 22 is the default.

    Raises:
        RuntimeError: If the connected drone is running a Blunux version older than 5.0.0.
    """
    self._parent_drone._verify_required_blunux_version("5.0.0")
    if self._camera_parameters is None:
        self._update_camera_parameters()
    self._camera_parameters.gamma = gamma
    self._parent_drone._req_rep_client.set_camera_parameters(self._camera_parameters)

set_hue

set_hue(hue: int)

Set the camera hue.

Parameters:

  • hue (int) –

    Set the camera hue. Valid values are in the range (-40..40).

Source code in blueye/sdk/camera.py
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
def set_hue(self, hue: int):
    """Set the camera hue.

    Args:
        hue (int): Set the camera hue. Valid values are in the range (-40..40).
    """
    if self._camera_parameters is None:
        self._update_camera_parameters()
    self._camera_parameters.hue = hue
    self._parent_drone._req_rep_client.set_camera_parameters(self._camera_parameters)

set_mtu_size

set_mtu_size(mtu_size: int)

Set the network MTU size used for video streaming.

Parameters:

  • mtu_size (int) –

    Set the MTU size in bytes (68..65535). The Blueye app allows values between 500 and 1460. A value of 0 means the drone uses its default of 1400.

Raises:

  • RuntimeError –

    If the connected drone is running a Blunux version older than 5.1.0.

Source code in blueye/sdk/camera.py
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
def set_mtu_size(self, mtu_size: int):
    """Set the network MTU size used for video streaming.

    Args:
        mtu_size (int): Set the MTU size in bytes (68..65535). The Blueye app allows values
            between 500 and 1460. A value of 0 means the drone uses its default of 1400.

    Raises:
        RuntimeError: If the connected drone is running a Blunux version older than 5.1.0.
    """
    self._parent_drone._verify_required_blunux_version("5.1.0")
    if self._camera_parameters is None:
        self._update_camera_parameters()
    self._camera_parameters.mtu_size = mtu_size
    self._parent_drone._req_rep_client.set_camera_parameters(self._camera_parameters)

set_recording

set_recording(start_recording: bool)

Set the camera recording state.

Parameters:

  • start_recording (bool) –

    Set to True to start a recording, set to False to stop the current recording.

Warns:

  • RuntimeWarning –

    If no recording state telemetry data is received.

Source code in blueye/sdk/camera.py
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
def set_recording(self, start_recording: bool):
    """Set the camera recording state.

    Args:
        start_recording (bool): Set to True to start a recording, set to False to stop the
                                current recording.

    Warns:
        RuntimeWarning: If no recording state telemetry data is received.
    """
    record_state = self._get_record_state()
    if record_state is None:
        logger.warning("Unable to set recording state, no record state telemetry received")
        return
    if self._is_guestport_camera:
        self._parent_drone._ctrl_client.set_recording_state(
            record_state.main_is_recording, start_recording
        )
    else:
        self._parent_drone._ctrl_client.set_recording_state(
            start_recording, record_state.guestport_is_recording
        )

set_recording_bitrate

set_recording_bitrate(bitrate: int)

Set the recording bitrate in bits per second.

A value of 0 means the drone will auto-compute a default bitrate based on the current resolution, framerate, and codec.

Parameters:

  • bitrate (int) –

    Set the recording bitrate in bits per second. Use 0 for automatic.

Raises:

  • RuntimeError –

    If the connected drone is running Blunux older than 5.0.0.

Source code in blueye/sdk/camera.py
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
def set_recording_bitrate(self, bitrate: int):
    """Set the recording bitrate in bits per second.

    A value of 0 means the drone will auto-compute a default bitrate based on the current
    resolution, framerate, and codec.

    Args:
        bitrate (int): Set the recording bitrate in bits per second. Use 0 for automatic.

    Raises:
        RuntimeError: If the connected drone is running Blunux older than 5.0.0.
    """
    self._parent_drone._verify_required_blunux_version("5.0.0")
    if self._camera_parameters is None:
        self._update_camera_parameters()
    self._camera_parameters.recording_bitrate = bitrate
    self._parent_drone._req_rep_client.set_camera_parameters(self._camera_parameters)

set_recording_codec

set_recording_codec(codec: RecordingCodec)

Set the recording video codec.

Parameters:

  • codec (RecordingCodec) –

    Set the recording codec. RECORDING_CODEC_UNSPECIFIED uses the platform default (H.264). RECORDING_CODEC_H265 is only available on Ultra.

Raises:

  • ValueError –

    If the codec is not a valid blueye.protocol.RecordingCodec type.

  • RuntimeError –

    If the connected drone is running Blunux older than 5.0.0.

Source code in blueye/sdk/camera.py
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
def set_recording_codec(self, codec: blueye.protocol.RecordingCodec):
    """Set the recording video codec.

    Args:
        codec (blueye.protocol.RecordingCodec): Set the recording codec.
            RECORDING_CODEC_UNSPECIFIED uses the platform default (H.264).
            RECORDING_CODEC_H265 is only available on Ultra.

    Raises:
        ValueError: If the codec is not a valid `blueye.protocol.RecordingCodec` type.
        RuntimeError: If the connected drone is running Blunux older than 5.0.0.
    """
    self._parent_drone._verify_required_blunux_version("5.0.0")
    if not isinstance(codec, blueye.protocol.RecordingCodec):
        raise ValueError(f"{codec} is not a valid RecordingCodec type")
    if self._camera_parameters is None:
        self._update_camera_parameters()
    self._camera_parameters.recording_codec = codec
    self._parent_drone._req_rep_client.set_camera_parameters(self._camera_parameters)

set_recording_resolution

set_recording_resolution(resolution: Resolution)

Set the camera recording resolution.

For drones running Blunux version < 4.4.1 this is the same as the set_resolution method.

Parameters:

  • resolution (Resolution) –

    Set the camera recording resolution.

Raises:

  • ValueError –

    If the resolution is not a valid blueye.protocol.Resolution type

Source code in blueye/sdk/camera.py
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
def set_recording_resolution(self, resolution: blueye.protocol.Resolution):
    """Set the camera recording resolution.

    For drones running Blunux version < 4.4.1 this is the same as the
    [`set_resolution`][blueye.sdk.camera.Camera.set_resolution] method.

    Args:
        resolution (blueye.protocol.Resolution): Set the camera recording resolution.

    Raises:
        ValueError: If the resolution is not a valid `blueye.protocol.Resolution` type
    """
    if not isinstance(resolution, blueye.protocol.Resolution):
        raise ValueError(f"{resolution} is not a valid resolution type")
    if self._camera_parameters is None:
        self._update_camera_parameters()
    self._camera_parameters.recording_resolution = resolution
    # If the drone is running Blunux < 4.4 we need to set the resolution field as well.
    self._camera_parameters.resolution = resolution
    self._parent_drone._req_rep_client.set_camera_parameters(self._camera_parameters)

set_resolution

set_resolution(resolution: int)

Set the camera resolution.

Deprecated

Drones running Blunux 4.4 or newer ignore this field when camera parameters are set, so calling this method has no effect on them. Use set_stream_resolution and set_recording_resolution instead.

Parameters:

  • resolution (int) –

    Set the camera in vertical pixels. Valid values are 480, 720, 1080, 1440 or 2160.

Raises:

  • ValueError –

    If the resolution is not one of the valid values.

Source code in blueye/sdk/camera.py
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
def set_resolution(self, resolution: int):
    """Set the camera resolution.

    Deprecated:
        Drones running Blunux 4.4 or newer ignore this field when camera parameters are set,
        so calling this method has no effect on them. Use
        [`set_stream_resolution`][blueye.sdk.camera.Camera.set_stream_resolution] and
        [`set_recording_resolution`][blueye.sdk.camera.Camera.set_recording_resolution]
        instead.

    Args:
        resolution (int): Set the camera in vertical pixels. Valid values are 480, 720, 1080,
            1440 or 2160.

    Raises:
        ValueError: If the resolution is not one of the valid values.
    """
    warnings.warn(
        "`Camera.set_resolution` is deprecated and is ignored by drones running Blunux 4.4 or "
        "newer, use `Camera.set_stream_resolution` or `Camera.set_recording_resolution` "
        "instead",
        DeprecationWarning,
        stacklevel=2,
    )
    if resolution not in _HEIGHT_TO_RESOLUTION:
        raise ValueError(
            f"{resolution} is not a valid resolution. "
            "Valid values are 480, 720, 1080, 1440 or 2160"
        )
    if self._camera_parameters is None:
        self._update_camera_parameters()
    self._camera_parameters.resolution = _HEIGHT_TO_RESOLUTION[resolution]
    self._parent_drone._req_rep_client.set_camera_parameters(self._camera_parameters)

set_saturation

set_saturation(saturation: int)

Set the camera saturation.

Only available on Ultra.

Parameters:

  • saturation (int) –

    Set the saturation (0..50), 8 is the default.

Raises:

  • RuntimeError –

    If the connected drone is running a Blunux version older than 5.0.0.

Source code in blueye/sdk/camera.py
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
def set_saturation(self, saturation: int):
    """Set the camera saturation.

    Only available on Ultra.

    Args:
        saturation (int): Set the saturation (0..50), 8 is the default.

    Raises:
        RuntimeError: If the connected drone is running a Blunux version older than 5.0.0.
    """
    self._parent_drone._verify_required_blunux_version("5.0.0")
    if self._camera_parameters is None:
        self._update_camera_parameters()
    self._camera_parameters.saturation = saturation
    self._parent_drone._req_rep_client.set_camera_parameters(self._camera_parameters)

set_sharpness

set_sharpness(sharpness: int)

Set the camera sharpness.

Only available on Ultra.

Parameters:

  • sharpness (int) –

    Set the sharpness (-20..20), -20 is the default.

Raises:

  • RuntimeError –

    If the connected drone is running a Blunux version older than 5.0.0.

Source code in blueye/sdk/camera.py
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
def set_sharpness(self, sharpness: int):
    """Set the camera sharpness.

    Only available on Ultra.

    Args:
        sharpness (int): Set the sharpness (-20..20), -20 is the default.

    Raises:
        RuntimeError: If the connected drone is running a Blunux version older than 5.0.0.
    """
    self._parent_drone._verify_required_blunux_version("5.0.0")
    if self._camera_parameters is None:
        self._update_camera_parameters()
    self._camera_parameters.sharpness = sharpness
    self._parent_drone._req_rep_client.set_camera_parameters(self._camera_parameters)

set_stream_resolution

set_stream_resolution(resolution: Resolution)

Set the camera stream resolution.

For drones running blunux version < 4.4.1 this is the same as the set_resolution method.

Parameters:

  • resolution (Resolution) –

    Set the camera stream resolution.

Raises:

  • ValueError –

    If the resolution is not a valid blueye.protocol.Resolution type

Source code in blueye/sdk/camera.py
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
def set_stream_resolution(self, resolution: blueye.protocol.Resolution):
    """Set the camera stream resolution.

    For drones running blunux version < 4.4.1 this is the same as the
    [`set_resolution`][blueye.sdk.camera.Camera.set_resolution] method.

    Args:
        resolution (blueye.protocol.Resolution): Set the camera stream resolution.

    Raises:
        ValueError: If the resolution is not a valid `blueye.protocol.Resolution` type
    """
    if not isinstance(resolution, blueye.protocol.Resolution):
        raise ValueError(f"{resolution} is not a valid resolution type")
    if self._camera_parameters is None:
        self._update_camera_parameters()
    self._camera_parameters.stream_resolution = resolution
    # If the drone is running Blunux < 4.4 we need to set the resolution field as well.
    self._camera_parameters.resolution = resolution
    self._parent_drone._req_rep_client.set_camera_parameters(self._camera_parameters)

set_streaming_protocol

set_streaming_protocol(protocol: StreamingProtocol)

Set the streaming protocol (codec used for the RTSP stream).

Parameters:

Raises:

  • ValueError –

    If the protocol is not a valid blueye.protocol.StreamingProtocol type.

Source code in blueye/sdk/camera.py
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
def set_streaming_protocol(self, protocol: blueye.protocol.StreamingProtocol):
    """Set the streaming protocol (codec used for the RTSP stream).

    Args:
        protocol (blueye.protocol.StreamingProtocol): Set the streaming protocol.

    Raises:
        ValueError: If the protocol is not a valid `blueye.protocol.StreamingProtocol` type.
    """
    if not isinstance(protocol, blueye.protocol.StreamingProtocol):
        raise ValueError(f"{protocol} is not a valid StreamingProtocol type")
    if self._camera_parameters is None:
        self._update_camera_parameters()
    self._camera_parameters.streaming_protocol = protocol
    self._parent_drone._req_rep_client.set_camera_parameters(self._camera_parameters)

set_whitebalance

set_whitebalance(white_balance: int)

Set the camera white balance.

Parameters:

  • white_balance (int) –

    Set the camera white balance. Valid values are in the range (2800..9300) or -1 for auto white balance.

Source code in blueye/sdk/camera.py
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
def set_whitebalance(self, white_balance: int):
    """Set the camera white balance.

    Args:
        white_balance (int): Set the camera white balance. Valid values are in the range
                             (2800..9300) or -1 for auto white balance.
    """
    if self._camera_parameters is None:
        self._update_camera_parameters()
    self._camera_parameters.white_balance = white_balance
    self._parent_drone._req_rep_client.set_camera_parameters(self._camera_parameters)

take_picture

take_picture()

Take a still picture and store it locally on the drone.

These pictures can be downloaded with the Blueye App, or by any WebDAV compatible client.

Source code in blueye/sdk/camera.py
1802
1803
1804
1805
1806
1807
def take_picture(self):
    """Take a still picture and store it locally on the drone.

    These pictures can be downloaded with the Blueye App, or by any WebDAV compatible client.
    """
    self._parent_drone._ctrl_client.take_still_picture()

Overlay

Overlay(parent_drone: Drone)

Control the overlay on videos and pictures.

Parameters:

  • parent_drone (Drone) –

    The parent drone instance.

Methods:

Source code in blueye/sdk/camera.py
132
133
134
135
136
137
138
139
def __init__(self, parent_drone: Drone):
    """Initialize the Overlay class.

    Args:
        parent_drone (Drone): The parent drone instance.
    """
    self._parent_drone = parent_drone
    self._overlay_parametres = None
delete_logo(timeout: float = 1.0)

Delete the user uploaded logo from the drone.

Parameters:

  • timeout (float, default: 1.0 ) –

    The timeout for the delete request.

Raises:

  • HTTPError –

    If an error occurs during deletion.

  • ConnectTimeout –

    If unable to create a connection within the specified timeout.

Source code in blueye/sdk/camera.py
816
817
818
819
820
821
822
823
824
825
826
827
828
def delete_logo(self, timeout: float = 1.0):
    """Delete the user uploaded logo from the drone.

    Args:
        timeout (float): The timeout for the delete request.

    Raises:
        requests.exceptions.HTTPError: If an error occurs during deletion.
        requests.exceptions.ConnectTimeout: If unable to create a connection within the
                                            specified timeout.
    """
    response = requests.delete(f"http://{self._parent_drone._ip}/asset/logo", timeout=timeout)
    response.raise_for_status()
download_logo(output_directory='.', timeout: float = 1.0)

Download the original user uploaded logo (PNG or JPG).

Select the download directory with the output_directory parameter.

Parameters:

  • output_directory (str, default: '.' ) –

    The directory to save the downloaded logo.

  • timeout (float, default: 1.0 ) –

    The timeout for the download request.

Raises:

  • HTTPError –

    If no custom logo is uploaded.

  • ConnectTimeout –

    If unable to create a connection within the specified timeout.

Source code in blueye/sdk/camera.py
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
def download_logo(self, output_directory=".", timeout: float = 1.0):
    """Download the original user uploaded logo (PNG or JPG).

    Select the download directory with the output_directory parameter.

    Args:
        output_directory (str): The directory to save the downloaded logo.
        timeout (float): The timeout for the download request.

    Raises:
        requests.exceptions.HTTPError: If no custom logo is uploaded.
        requests.exceptions.ConnectTimeout: If unable to create a connection within the
                                            specified timeout.
    """
    response = requests.get(f"http://{self._parent_drone._ip}/asset/logo", timeout=timeout)
    response.raise_for_status()
    filename = re.findall('filename="(.+)"', response.headers["Content-Disposition"])[0]
    with open(f"{output_directory}/{filename}", "wb") as f:
        f.write(response.content)

enable_altitude

enable_altitude(enable_altitude: bool)

Set the state of the altitude overlay.

Parameters:

  • enable_altitude (bool) –

    True to enable the altitude overlay, False to disable it.

Source code in blueye/sdk/camera.py
393
394
395
396
397
398
399
400
401
402
def enable_altitude(self, enable_altitude: bool):
    """Set the state of the altitude overlay.

    Args:
        enable_altitude (bool): True to enable the altitude overlay, False to disable it.
    """
    if self._overlay_parametres is None:
        self._update_overlay_parameters()
    self._overlay_parametres.altitude_enabled = enable_altitude
    self._parent_drone._req_rep_client.set_overlay_parameters(self._overlay_parametres)

enable_cp_probe

enable_cp_probe(enable_cp_probe: bool)

Set the state of the CP probe overlay.

Parameters:

  • enable_cp_probe (bool) –

    True to enable the CP probe overlay, False to disable it.

Source code in blueye/sdk/camera.py
349
350
351
352
353
354
355
356
357
358
def enable_cp_probe(self, enable_cp_probe: bool):
    """Set the state of the CP probe overlay.

    Args:
        enable_cp_probe (bool): True to enable the CP probe overlay, False to disable it.
    """
    if self._overlay_parametres is None:
        self._update_overlay_parameters()
    self._overlay_parametres.cp_probe_enabled = enable_cp_probe
    self._parent_drone._req_rep_client.set_overlay_parameters(self._overlay_parametres)

enable_date

enable_date(enable_date: bool)

Set the state of the date overlay.

Parameters:

  • enable_date (bool) –

    True to enable the date overlay, False to disable it.

Source code in blueye/sdk/camera.py
243
244
245
246
247
248
249
250
251
252
def enable_date(self, enable_date: bool):
    """Set the state of the date overlay.

    Args:
        enable_date (bool): True to enable the date overlay, False to disable it.
    """
    if self._overlay_parametres is None:
        self._update_overlay_parameters()
    self._overlay_parametres.date_enabled = enable_date
    self._parent_drone._req_rep_client.set_overlay_parameters(self._overlay_parametres)

enable_depth

enable_depth(enable_depth: bool)

Set the state of the depth overlay.

Parameters:

  • enable_depth (bool) –

    True to enable the depth overlay, False to disable it.

Source code in blueye/sdk/camera.py
176
177
178
179
180
181
182
183
184
185
def enable_depth(self, enable_depth: bool):
    """Set the state of the depth overlay.

    Args:
        enable_depth (bool): True to enable the depth overlay, False to disable it.
    """
    if self._overlay_parametres is None:
        self._update_overlay_parameters()
    self._overlay_parametres.depth_enabled = enable_depth
    self._parent_drone._req_rep_client.set_overlay_parameters(self._overlay_parametres)

enable_distance

enable_distance(enable_distance: bool)

Set the state of the distance overlay.

Parameters:

  • enable_distance (bool) –

    True to enable the distance overlay, False to disable it.

Source code in blueye/sdk/camera.py
371
372
373
374
375
376
377
378
379
380
def enable_distance(self, enable_distance: bool):
    """Set the state of the distance overlay.

    Args:
        enable_distance (bool): True to enable the distance overlay, False to disable it.
    """
    if self._overlay_parametres is None:
        self._update_overlay_parameters()
    self._overlay_parametres.distance_enabled = enable_distance
    self._parent_drone._req_rep_client.set_overlay_parameters(self._overlay_parametres)

enable_drone_location

enable_drone_location(enable_drone_location: bool)

Set the state of the drone location overlay.

Parameters:

  • enable_drone_location (bool) –

    True to enable the drone location overlay, False to disable it.

Source code in blueye/sdk/camera.py
465
466
467
468
469
470
471
472
473
474
475
def enable_drone_location(self, enable_drone_location: bool):
    """Set the state of the drone location overlay.

    Args:
        enable_drone_location (bool): True to enable the drone location overlay,
                                      False to disable it.
    """
    if self._overlay_parametres is None:
        self._update_overlay_parameters()
    self._overlay_parametres.drone_location_enabled = enable_drone_location
    self._parent_drone._req_rep_client.set_overlay_parameters(self._overlay_parametres)

enable_gamma_ray_measurement

enable_gamma_ray_measurement(
    enable_gamma_ray_measurement: bool,
)

Set the state of the gamma-ray measurement overlay.

Parameters:

  • enable_gamma_ray_measurement (bool) –

    True to enable the gamma-ray measurement overlay, False to disable it.

Source code in blueye/sdk/camera.py
519
520
521
522
523
524
525
526
527
528
529
def enable_gamma_ray_measurement(self, enable_gamma_ray_measurement: bool):
    """Set the state of the gamma-ray measurement overlay.

    Args:
        enable_gamma_ray_measurement (bool): True to enable the gamma-ray measurement overlay,
                                             False to disable it.
    """
    if self._overlay_parametres is None:
        self._update_overlay_parameters()
    self._overlay_parametres.medusa_enabled = enable_gamma_ray_measurement
    self._parent_drone._req_rep_client.set_overlay_parameters(self._overlay_parametres)

enable_heading

enable_heading(enable_heading: bool)

Set the state of the heading overlay.

Parameters:

  • enable_heading (bool) –

    True to enable the heading overlay, False to disable it.

Source code in blueye/sdk/camera.py
198
199
200
201
202
203
204
205
206
207
def enable_heading(self, enable_heading: bool):
    """Set the state of the heading overlay.

    Args:
        enable_heading (bool): True to enable the heading overlay, False to disable it.
    """
    if self._overlay_parametres is None:
        self._update_overlay_parameters()
    self._overlay_parametres.heading_enabled = enable_heading
    self._parent_drone._req_rep_client.set_overlay_parameters(self._overlay_parametres)

enable_temperature

enable_temperature(enable_temperature: bool)

Set the state of the temperature overlay.

Parameters:

  • enable_temperature (bool) –

    True to enable the temperature overlay, False to disable it.

Source code in blueye/sdk/camera.py
154
155
156
157
158
159
160
161
162
163
def enable_temperature(self, enable_temperature: bool):
    """Set the state of the temperature overlay.

    Args:
        enable_temperature (bool): True to enable the temperature overlay, False to disable it.
    """
    if self._overlay_parametres is None:
        self._update_overlay_parameters()
    self._overlay_parametres.temperature_enabled = enable_temperature
    self._parent_drone._req_rep_client.set_overlay_parameters(self._overlay_parametres)

enable_thickness

enable_thickness(enable_thickness: bool)

Set the state of the thickness overlay.

Parameters:

  • enable_thickness (bool) –

    True to enable the thickness overlay, False to disable it.

Source code in blueye/sdk/camera.py
415
416
417
418
419
420
421
422
423
424
def enable_thickness(self, enable_thickness: bool):
    """Set the state of the thickness overlay.

    Args:
        enable_thickness (bool): True to enable the thickness overlay, False to disable it.
    """
    if self._overlay_parametres is None:
        self._update_overlay_parameters()
    self._overlay_parametres.thickness_enabled = enable_thickness
    self._parent_drone._req_rep_client.set_overlay_parameters(self._overlay_parametres)

enable_tilt

enable_tilt(enable_tilt: bool)

Set the state of the tilt overlay.

Parameters:

  • enable_tilt (bool) –

    True to enable the tilt overlay, False to disable it.

Source code in blueye/sdk/camera.py
220
221
222
223
224
225
226
227
228
229
def enable_tilt(self, enable_tilt: bool):
    """Set the state of the tilt overlay.

    Args:
        enable_tilt (bool): True to enable the tilt overlay, False to disable it.
    """
    if self._overlay_parametres is None:
        self._update_overlay_parameters()
    self._overlay_parametres.tilt_enabled = enable_tilt
    self._parent_drone._req_rep_client.set_overlay_parameters(self._overlay_parametres)

get_date_format

get_date_format() -> str

Get the format string for the time displayed in the overlay.

Returns:

  • str –

    The current date format.

Source code in blueye/sdk/camera.py
728
729
730
731
732
733
734
735
def get_date_format(self) -> str:
    """Get the format string for the time displayed in the overlay.

    Returns:
        The current date format.
    """
    self._update_overlay_parameters()
    return self._overlay_parametres.date_format

get_depth_unit

get_depth_unit() -> DepthUnit

Get the depth unit for the overlay.

Returns:

Source code in blueye/sdk/camera.py
284
285
286
287
288
289
290
291
def get_depth_unit(self) -> blueye.protocol.DepthUnit:
    """Get the depth unit for the overlay.

    Returns:
        The current depth unit.
    """
    self._update_overlay_parameters()
    return self._overlay_parametres.depth_unit

get_font_size

get_font_size() -> FontSize

Get the font size for the overlay.

Returns:

Source code in blueye/sdk/camera.py
619
620
621
622
623
624
625
626
def get_font_size(self) -> blueye.protocol.FontSize:
    """Get the font size for the overlay.

    Returns:
        The current font size.
    """
    self._update_overlay_parameters()
    return self._overlay_parametres.font_size
get_logo() -> LogoType

Get the logo overlay selection.

Returns:

Source code in blueye/sdk/camera.py
256
257
258
259
260
261
262
263
def get_logo(self) -> blueye.protocol.LogoType:
    """Get the logo overlay selection.

    Returns:
        The current logo type.
    """
    self._update_overlay_parameters()
    return self._overlay_parametres.logo_type

get_margin_height

get_margin_height() -> int

Get the margin height for the overlay.

Returns:

  • int –

    The current margin height.

Source code in blueye/sdk/camera.py
589
590
591
592
593
594
595
596
def get_margin_height(self) -> int:
    """Get the margin height for the overlay.

    Returns:
        The current margin height.
    """
    self._update_overlay_parameters()
    return self._overlay_parametres.margin_height

get_margin_width

get_margin_width() -> int

Get the margin width for the overlay.

Returns:

  • int –

    The current margin width.

Source code in blueye/sdk/camera.py
559
560
561
562
563
564
565
566
def get_margin_width(self) -> int:
    """Get the margin width for the overlay.

    Returns:
        The current margin width.
    """
    self._update_overlay_parameters()
    return self._overlay_parametres.margin_width

get_shading

get_shading() -> float

Get the pixel intensity to subtract from text background.

Returns:

  • float –

    The current shading intensity.

Source code in blueye/sdk/camera.py
481
482
483
484
485
486
487
488
def get_shading(self) -> float:
    """Get the pixel intensity to subtract from text background.

    Returns:
        The current shading intensity.
    """
    self._update_overlay_parameters()
    return self._overlay_parametres.shading

get_subtitle

get_subtitle() -> str

Get the subtitle for the overlay.

Returns:

  • str –

    The current subtitle.

Source code in blueye/sdk/camera.py
688
689
690
691
692
693
694
695
def get_subtitle(self) -> str:
    """Get the subtitle for the overlay.

    Returns:
        The current subtitle.
    """
    self._update_overlay_parameters()
    return self._overlay_parametres.subtitle

get_temperature_unit

get_temperature_unit() -> TemperatureUnit

Get the temperature unit for the overlay.

Returns:

Source code in blueye/sdk/camera.py
312
313
314
315
316
317
318
319
def get_temperature_unit(self) -> blueye.protocol.TemperatureUnit:
    """Get the temperature unit for the overlay.

    Returns:
        The current temperature unit.
    """
    self._update_overlay_parameters()
    return self._overlay_parametres.temperature_unit

get_thickness_unit

get_thickness_unit() -> ThicknessUnit

Get the thickness unit for the overlay.

Returns:

Source code in blueye/sdk/camera.py
428
429
430
431
432
433
434
435
def get_thickness_unit(self) -> blueye.protocol.ThicknessUnit:
    """Get the thickness unit for the overlay.

    Returns:
        The current thickness unit.
    """
    self._update_overlay_parameters()
    return self._overlay_parametres.thickness_unit

get_timezone_offset

get_timezone_offset() -> int

Get the timezone offset for the overlay.

Returns:

  • int –

    The current timezone offset.

Source code in blueye/sdk/camera.py
535
536
537
538
539
540
541
542
def get_timezone_offset(self) -> int:
    """Get the timezone offset for the overlay.

    Returns:
        The current timezone offset.
    """
    self._update_overlay_parameters()
    return self._overlay_parametres.timezone_offset

get_title

get_title() -> str

Get the title for the overlay.

Returns:

  • str –

    The current title.

Source code in blueye/sdk/camera.py
649
650
651
652
653
654
655
656
def get_title(self) -> str:
    """Get the title for the overlay.

    Returns:
        The current title.
    """
    self._update_overlay_parameters()
    return self._overlay_parametres.title

is_altitude_enabled

is_altitude_enabled() -> bool

Get the state of the altitude overlay.

Returns:

  • bool –

    The current state of the altitude overlay.

Source code in blueye/sdk/camera.py
384
385
386
387
388
389
390
391
def is_altitude_enabled(self) -> bool:
    """Get the state of the altitude overlay.

    Returns:
        The current state of the altitude overlay.
    """
    self._update_overlay_parameters()
    return self._overlay_parametres.altitude_enabled

is_cp_probe_enabled

is_cp_probe_enabled() -> bool

Get the state of the CP probe overlay.

Returns:

  • bool –

    The current state of the CP probe overlay.

Source code in blueye/sdk/camera.py
340
341
342
343
344
345
346
347
def is_cp_probe_enabled(self) -> bool:
    """Get the state of the CP probe overlay.

    Returns:
        The current state of the CP probe overlay.
    """
    self._update_overlay_parameters()
    return self._overlay_parametres.cp_probe_enabled

is_date_enabled

is_date_enabled() -> bool

Get the state of the date overlay.

Returns:

  • bool –

    The current state of the date overlay.

Source code in blueye/sdk/camera.py
233
234
235
236
237
238
239
240
241
def is_date_enabled(self) -> bool:
    """Get the state of the date overlay.

    Returns:
        The current state of the date overlay.
    """
    if self._overlay_parametres is None:
        self._update_overlay_parameters()
    return self._overlay_parametres.date_enabled

is_depth_enabled

is_depth_enabled() -> bool

Get the state of the depth overlay.

Returns:

  • bool –

    The current state of the depth overlay.

Source code in blueye/sdk/camera.py
167
168
169
170
171
172
173
174
def is_depth_enabled(self) -> bool:
    """Get the state of the depth overlay.

    Returns:
        The current state of the depth overlay.
    """
    self._update_overlay_parameters()
    return self._overlay_parametres.depth_enabled

is_distance_enabled

is_distance_enabled() -> bool

Get the state of the distance overlay.

Returns:

  • bool –

    The current state of the distance overlay.

Source code in blueye/sdk/camera.py
362
363
364
365
366
367
368
369
def is_distance_enabled(self) -> bool:
    """Get the state of the distance overlay.

    Returns:
        The current state of the distance overlay.
    """
    self._update_overlay_parameters()
    return self._overlay_parametres.distance_enabled

is_drone_location_enabled

is_drone_location_enabled() -> bool

Get the state of the drone location overlay.

Returns:

  • bool –

    The current state of the drone location overlay.

Source code in blueye/sdk/camera.py
456
457
458
459
460
461
462
463
def is_drone_location_enabled(self) -> bool:
    """Get the state of the drone location overlay.

    Returns:
        The current state of the drone location overlay.
    """
    self._update_overlay_parameters()
    return self._overlay_parametres.drone_location_enabled

is_gamma_ray_measurement_enabled

is_gamma_ray_measurement_enabled() -> bool

Get the state of the gamma-ray measurement overlay.

Returns:

  • bool –

    The current state of the gamma-ray measurement overlay.

Source code in blueye/sdk/camera.py
510
511
512
513
514
515
516
517
def is_gamma_ray_measurement_enabled(self) -> bool:
    """Get the state of the gamma-ray measurement overlay.

    Returns:
        The current state of the gamma-ray measurement overlay.
    """
    self._update_overlay_parameters()
    return self._overlay_parametres.medusa_enabled

is_heading_enabled

is_heading_enabled() -> bool

Get the state of the heading overlay.

Returns:

  • bool –

    The current state of the heading overlay.

Source code in blueye/sdk/camera.py
189
190
191
192
193
194
195
196
def is_heading_enabled(self) -> bool:
    """Get the state of the heading overlay.

    Returns:
        The current state of the heading overlay.
    """
    self._update_overlay_parameters()
    return self._overlay_parametres.heading_enabled

is_temperature_enabled

is_temperature_enabled() -> bool

Get the state of the temperature overlay.

Returns:

  • bool –

    The current state of the temperature overlay.

Source code in blueye/sdk/camera.py
145
146
147
148
149
150
151
152
def is_temperature_enabled(self) -> bool:
    """Get the state of the temperature overlay.

    Returns:
        The current state of the temperature overlay.
    """
    self._update_overlay_parameters()
    return self._overlay_parametres.temperature_enabled

is_thickness_enabled

is_thickness_enabled() -> bool

Get the state of the thickness overlay.

Returns:

  • bool –

    The current state of the thickness overlay.

Source code in blueye/sdk/camera.py
406
407
408
409
410
411
412
413
def is_thickness_enabled(self) -> bool:
    """Get the state of the thickness overlay.

    Returns:
        The current state of the thickness overlay.
    """
    self._update_overlay_parameters()
    return self._overlay_parametres.thickness_enabled

is_tilt_enabled

is_tilt_enabled() -> bool

Get the state of the tilt overlay.

Returns:

  • bool –

    The current state of the tilt overlay.

Source code in blueye/sdk/camera.py
211
212
213
214
215
216
217
218
def is_tilt_enabled(self) -> bool:
    """Get the state of the tilt overlay.

    Returns:
        The current state of the tilt overlay.
    """
    self._update_overlay_parameters()
    return self._overlay_parametres.tilt_enabled

set_date_format

set_date_format(input_format_str: str)

Set the format string for the time displayed in the overlay.

Must be a string containing only ASCII characters, with a max length of 63 characters.

The format codes are defined by the C89 standard, see https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes for an overview of the available codes.

Parameters:

  • input_format_str (str) –

    The date format string to set.

Warns:

  • RuntimeWarning –

    If the date format is too long or contains non-ASCII characters.

Source code in blueye/sdk/camera.py
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
def set_date_format(self, input_format_str: str):
    """Set the format string for the time displayed in the overlay.

    Must be a string containing only ASCII characters, with a max length of 63 characters.

    The format codes are defined by the C89 standard, see
    https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes for an
    overview of the available codes.

    Args:
        input_format_str (str): The date format string to set.

    Warns:
        RuntimeWarning: If the date format is too long or contains non-ASCII characters.
    """
    format_str = input_format_str
    if len(format_str) > 63:
        warnings.warn(
            "Too long date format string, truncating to 63 characters", RuntimeWarning
        )
        format_str = format_str[:63]
    try:
        bytes(format_str, "ascii")
    except UnicodeEncodeError:
        warnings.warn(
            "Date format string can only contain ASCII characters, ignoring", RuntimeWarning
        )
        return
    if self._overlay_parametres is None:
        self._update_overlay_parameters()
    self._overlay_parametres.date_format = format_str
    self._parent_drone._req_rep_client.set_overlay_parameters(self._overlay_parametres)

set_depth_unit

set_depth_unit(unit: DepthUnit)

Set the depth unit for the overlay.

Parameters:

  • unit (DepthUnit) –

    The depth unit to set.

Warns:

  • RuntimeWarning –

    If the unit is not an instance of blueye.protocol.DepthUnit.

Source code in blueye/sdk/camera.py
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
def set_depth_unit(self, unit: blueye.protocol.DepthUnit):
    """Set the depth unit for the overlay.

    Args:
        unit (blueye.protocol.DepthUnit): The depth unit to set.

    Warns:
        RuntimeWarning: If the unit is not an instance of blueye.protocol.DepthUnit.
    """
    if not isinstance(unit, blueye.protocol.DepthUnit):
        warnings.warn("Invalid depth unit, ignoring", RuntimeWarning)
    else:
        if self._overlay_parametres is None:
            self._update_overlay_parameters()
        self._overlay_parametres.depth_unit = unit
        self._parent_drone._req_rep_client.set_overlay_parameters(self._overlay_parametres)

set_font_size

set_font_size(size: FontSize)

Set the font size for the overlay.

Needs to be an instance of the blueye.protocol.FontSize enum.

Parameters:

  • size (FontSize) –

    The font size to set.

Warns:

  • RuntimeWarning –

    If the font size is not an instance of blueye.protocol.FontSize.

Source code in blueye/sdk/camera.py
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
def set_font_size(self, size: blueye.protocol.FontSize):
    """Set the font size for the overlay.

    Needs to be an instance of the `blueye.protocol.FontSize` enum.

    Args:
        size (blueye.protocol.FontSize): The font size to set.

    Warns:
        RuntimeWarning: If the font size is not an instance of blueye.protocol.FontSize.
    """
    if not isinstance(size, blueye.protocol.FontSize):
        warnings.warn("Invalid font size, ignoring", RuntimeWarning)
    else:
        if self._overlay_parametres is None:
            self._update_overlay_parameters()
        self._overlay_parametres.font_size = size
        self._parent_drone._req_rep_client.set_overlay_parameters(self._overlay_parametres)
set_logo(logo_type: LogoType)

Set the logo overlay selection.

Parameters:

  • logo_type (LogoType) –

    The logo type.

Warns:

  • RuntimeWarning –

    If the logo type is not an instance of blueye.protocol.LogoType.

Source code in blueye/sdk/camera.py
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
def set_logo(self, logo_type: blueye.protocol.LogoType):
    """Set the logo overlay selection.

    Args:
        logo_type (blueye.protocol.LogoType): The logo type.

    Warns:
        RuntimeWarning: If the logo type is not an instance of blueye.protocol.LogoType.
    """
    if not isinstance(logo_type, blueye.protocol.LogoType):
        warnings.warn("Invalid logo type, ignoring", RuntimeWarning)
    else:
        if self._overlay_parametres is None:
            self._update_overlay_parameters()
        self._overlay_parametres.logo_type = logo_type
        self._parent_drone._req_rep_client.set_overlay_parameters(self._overlay_parametres)

set_margin_height

set_margin_height(height: int)

Set the margin height for the overlay.

The amount of pixels to use as margin on the top and bottom side of the overlay.

Parameters:

  • height (int) –

    The margin height to set. Needs to be a positive integer.

Warns:

  • RuntimeWarning –

    If the margin height is not a positive integer.

Source code in blueye/sdk/camera.py
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
def set_margin_height(self, height: int):
    """Set the margin height for the overlay.

    The amount of pixels to use as margin on the top and bottom side of the overlay.

    Args:
        height (int): The margin height to set. Needs to be a positive integer.

    Warns:
        RuntimeWarning: If the margin height is not a positive integer.
    """
    if height < 0:
        warnings.warn("Invalid margin height, ignoring", RuntimeWarning)
    else:
        if self._overlay_parametres is None:
            self._update_overlay_parameters()
        self._overlay_parametres.margin_height = height
        self._parent_drone._req_rep_client.set_overlay_parameters(self._overlay_parametres)

set_margin_width

set_margin_width(width: int)

Set the margin width for the overlay.

The amount of pixels to use as margin on the right and left side of the overlay.

Parameters:

  • width (int) –

    The margin width to set. Needs to be a positive integer.

Warns:

  • RuntimeWarning –

    If the margin width is not a positive integer.

Source code in blueye/sdk/camera.py
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
def set_margin_width(self, width: int):
    """Set the margin width for the overlay.

    The amount of pixels to use as margin on the right and left side of the overlay.

    Args:
        width (int): The margin width to set. Needs to be a positive integer.

    Warns:
        RuntimeWarning: If the margin width is not a positive integer.
    """
    if width < 0:
        warnings.warn("Invalid margin width, ignoring", RuntimeWarning)
    else:
        if self._overlay_parametres is None:
            self._update_overlay_parameters()
        self._overlay_parametres.margin_width = width
        self._parent_drone._req_rep_client.set_overlay_parameters(self._overlay_parametres)

set_shading

set_shading(intensity: float)

Set the pixel intensity to subtract from text background.

Parameters:

  • intensity (float) –

    The shading intensity to set. Valid range is 0.0 to 1.0. 0 is transparent, 1 is black.

Warns:

  • RuntimeWarning –

    If the shading intensity is not a float between 0.0 and 1.0.

Source code in blueye/sdk/camera.py
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
def set_shading(self, intensity: float):
    """Set the pixel intensity to subtract from text background.

    Args:
        intensity (float): The shading intensity to set. Valid range is 0.0 to 1.0.
                           0 is transparent, 1 is black.

    Warns:
        RuntimeWarning: If the shading intensity is not a float between 0.0 and 1.0.
    """
    if intensity < 0.0 or intensity > 1.0:
        warnings.warn("Invalid shading intensity, ignoring", RuntimeWarning)
    else:
        if self._overlay_parametres is None:
            self._update_overlay_parameters()
        self._overlay_parametres.shading = intensity
        self._parent_drone._req_rep_client.set_overlay_parameters(self._overlay_parametres)

set_subtitle

set_subtitle(input_subtitle: str)

Set the subtitle for the overlay.

The subtitle needs to be a string of only ASCII characters with a maximum length of 63 characters.

Set to an empty string to disable the subtitle.

Parameters:

  • input_subtitle (str) –

    The subtitle to set. Set to an empty string to disable. Truncated to 63 characters if longer.

Warns:

  • RuntimeWarning –

    If the subtitle is too long or contains non-ASCII characters.

Source code in blueye/sdk/camera.py
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
def set_subtitle(self, input_subtitle: str):
    """Set the subtitle for the overlay.

    The subtitle needs to be a string of only ASCII characters with a maximum length of 63
    characters.

    Set to an empty string to disable the subtitle.

    Args:
        input_subtitle (str): The subtitle to set. Set to an empty string to disable.
                              Truncated to 63 characters if longer.

    Warns:
        RuntimeWarning: If the subtitle is too long or contains non-ASCII characters.
    """
    new_subtitle = input_subtitle
    if len(input_subtitle) > 63:
        warnings.warn("Too long subtitle, truncating to 63 characters", RuntimeWarning)
        new_subtitle = new_subtitle[:63]
    try:
        bytes(new_subtitle, "ascii")
    except UnicodeEncodeError:
        warnings.warn("Subtitle can only contain ASCII characters, ignoring", RuntimeWarning)
        return
    if self._overlay_parametres is None:
        self._update_overlay_parameters()
    self._overlay_parametres.subtitle = new_subtitle
    self._parent_drone._req_rep_client.set_overlay_parameters(self._overlay_parametres)

set_temperature_unit

set_temperature_unit(unit: TemperatureUnit)

Set the temperature unit for the overlay.

Parameters:

Warns:

  • RuntimeWarning –

    If the unit is not an instance of blueye.protocol.TemperatureUnit.

Source code in blueye/sdk/camera.py
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
def set_temperature_unit(self, unit: blueye.protocol.TemperatureUnit):
    """Set the temperature unit for the overlay.

    Args:
        unit (blueye.protocol.TemperatureUnit): The temperature unit to set.

    Warns:
        RuntimeWarning: If the unit is not an instance of blueye.protocol.TemperatureUnit.
    """
    if not isinstance(unit, blueye.protocol.TemperatureUnit):
        warnings.warn("Invalid temperature unit, ignoring", RuntimeWarning)
    else:
        if self._overlay_parametres is None:
            self._update_overlay_parameters()
        self._overlay_parametres.temperature_unit = unit
        self._parent_drone._req_rep_client.set_overlay_parameters(self._overlay_parametres)

set_thickness_unit

set_thickness_unit(unit: ThicknessUnit)

Set the thickness unit for the overlay.

Parameters:

Warns:

  • RuntimeWarning –

    If the unit is not an instance of blueye.protocol.ThicknessUnit.

Source code in blueye/sdk/camera.py
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
def set_thickness_unit(self, unit: blueye.protocol.ThicknessUnit):
    """Set the thickness unit for the overlay.

    Args:
        unit (blueye.protocol.ThicknessUnit): The thickness unit to set.

    Warns:
        RuntimeWarning: If the unit is not an instance of blueye.protocol.ThicknessUnit.
    """
    if not isinstance(unit, blueye.protocol.ThicknessUnit):
        warnings.warn("Invalid thickness unit, ignoring", RuntimeWarning)
    else:
        if self._overlay_parametres is None:
            self._update_overlay_parameters()
        self._overlay_parametres.thickness_unit = unit
        self._parent_drone._req_rep_client.set_overlay_parameters(self._overlay_parametres)

set_timezone_offset

set_timezone_offset(offset: int)

Set the timezone offset for the overlay.

Set to the number of minutes (either positive or negative) the timestamp should be offset.

Parameters:

  • offset (int) –

    The timezone offset to set.

Source code in blueye/sdk/camera.py
544
545
546
547
548
549
550
551
552
553
554
555
def set_timezone_offset(self, offset: int):
    """Set the timezone offset for the overlay.

    Set to the number of minutes (either positive or negative) the timestamp should be offset.

    Args:
        offset (int): The timezone offset to set.
    """
    if self._overlay_parametres is None:
        self._update_overlay_parameters()
    self._overlay_parametres.timezone_offset = offset
    self._parent_drone._req_rep_client.set_overlay_parameters(self._overlay_parametres)

set_title

set_title(input_title: str)

Set the title for the overlay.

The title needs to be a string of only ASCII characters with a maximum length of 63 characters.

Set to an empty string to disable title.

Parameters:

  • input_title (str) –

    The title to set. Truncated to 63 characters if longer.

Warns:

  • RuntimeWarning –

    If the title is too long or contains non-ASCII characters.

Source code in blueye/sdk/camera.py
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
def set_title(self, input_title: str):
    """Set the title for the overlay.

    The title needs to be a string of only ASCII characters with a maximum length of 63
    characters.

    Set to an empty string to disable title.

    Args:
        input_title (str): The title to set. Truncated to 63 characters if longer.

    Warns:
        RuntimeWarning: If the title is too long or contains non-ASCII characters.
    """
    new_title = input_title
    if len(input_title) > 63:
        warnings.warn("Too long title, truncating to 63 characters", RuntimeWarning)
        new_title = new_title[:63]
    try:
        bytes(new_title, "ascii")
    except UnicodeEncodeError:
        warnings.warn("Title can only contain ASCII characters, ignoring", RuntimeWarning)
        return
    if self._overlay_parametres is None:
        self._update_overlay_parameters()
    self._overlay_parametres.title = new_title
    self._parent_drone._req_rep_client.set_overlay_parameters(self._overlay_parametres)
upload_logo(path_to_logo: str, timeout: float = 1.0)

Upload user selectable logo for watermarking videos and pictures.

Set the logo-property to blueye.protocol.LogoType.LOG_TYPE_CUSTOM to enable this logo.

Allowed filetype: JPG or PNG. Max resolution: 2000 px. Max file size: 5 MB.

Parameters:

  • path_to_logo (str) –

    The path to the logo file.

  • timeout (float, default: 1.0 ) –

    The timeout for the upload request.

Raises:

  • HTTPError –

    If the file is invalid (status code 400).

  • ConnectTimeout –

    If unable to create a connection within the specified timeout.

Source code in blueye/sdk/camera.py
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
def upload_logo(self, path_to_logo: str, timeout: float = 1.0):
    """Upload user selectable logo for watermarking videos and pictures.

    Set the logo-property to `blueye.protocol.LogoType.LOG_TYPE_CUSTOM` to enable this logo.

    Allowed filetype: JPG or PNG.
    Max resolution: 2000 px.
    Max file size: 5 MB.

    Args:
        path_to_logo (str): The path to the logo file.
        timeout (float, optional): The timeout for the upload request.

    Raises:
        requests.exceptions.HTTPError: If the file is invalid (status code 400).
        requests.exceptions.ConnectTimeout: If unable to create a connection within the
                                            specified timeout.
    """
    with open(path_to_logo, "rb") as f:
        url = f"http://{self._parent_drone._ip}/asset/logo"
        files = {"image": f}
        response = requests.post(url, files=files, timeout=timeout)
    response.raise_for_status()

Tilt

Tilt(parent_drone: Drone)

Handles the camera tilt functionality for the Blueye drone.

Parameters:

  • parent_drone (Drone) –

    The parent drone instance.

Methods:

Source code in blueye/sdk/camera.py
51
52
53
54
55
56
57
def __init__(self, parent_drone: Drone):
    """Initialize the Tilt class.

    Args:
        parent_drone (Drone): The parent drone instance.
    """
    self._parent_drone = parent_drone

enable_stabilization

enable_stabilization(enabled: bool)

Set the state of active camera stabilization.

Parameters:

  • enabled (bool) –

    True to turn stabilization on, False to turn it off.

Raises:

  • RuntimeError –

    If the connected drone does not have the tilt option.

Source code in blueye/sdk/camera.py
114
115
116
117
118
119
120
121
122
123
124
def enable_stabilization(self, enabled: bool):
    """Set the state of active camera stabilization.

    Args:
        enabled (bool): True to turn stabilization on, False to turn it off.

    Raises:
        RuntimeError: If the connected drone does not have the tilt option.
    """
    self._verify_tilt_in_features()
    self._parent_drone._ctrl_client.set_tilt_stabilization(enabled)

get_angle

get_angle() -> Optional[float]

Return the current angle of the camera tilt.

Returns:

  • Optional[float] –

    The current angle of the camera tilt.

Raises:

  • RuntimeError –

    If the connected drone does not have the tilt option.

Source code in blueye/sdk/camera.py
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
def get_angle(self) -> Optional[float]:
    """Return the current angle of the camera tilt.

    Returns:
        The current angle of the camera tilt.

    Raises:
        RuntimeError: If the connected drone does not have the tilt option.
    """
    self._verify_tilt_in_features()
    tilt_angle_tel = self._parent_drone.telemetry.get(blueye.protocol.TiltAngleTel)
    if tilt_angle_tel is not None:
        return tilt_angle_tel.angle.value
    else:
        return None

is_stabilization_enabled

is_stabilization_enabled() -> Optional[bool]

Get the state of active camera stabilization.

Returns:

  • Optional[bool] –

    The current state of active camera stabilization.

Raises:

  • RuntimeError –

    If the connected drone does not have the tilt option.

Source code in blueye/sdk/camera.py
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
def is_stabilization_enabled(self) -> Optional[bool]:
    """Get the state of active camera stabilization.

    Returns:
        The current state of active camera stabilization.

    Raises:
        RuntimeError: If the connected drone does not have the tilt option.
    """
    self._verify_tilt_in_features()
    tilt_stab_tel = self._parent_drone.telemetry.get(blueye.protocol.TiltStabilizationTel)
    if tilt_stab_tel is not None:
        return tilt_stab_tel.state.enabled
    else:
        return None

set_velocity

set_velocity(velocity: float)

Set the speed and direction of the camera tilt.

Parameters:

  • velocity (float) –

    Speed and direction of the tilt. 1 is max speed up, -1 is max speed down.

Raises:

  • RuntimeError –

    If the connected drone does not have the tilt option.

Source code in blueye/sdk/camera.py
68
69
70
71
72
73
74
75
76
77
78
def set_velocity(self, velocity: float):
    """Set the speed and direction of the camera tilt.

    Args:
        velocity: Speed and direction of the tilt. 1 is max speed up, -1 is max speed down.

    Raises:
        RuntimeError: If the connected drone does not have the tilt option.
    """
    self._verify_tilt_in_features()
    self._parent_drone._ctrl_client.set_tilt_velocity(velocity)