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.
Functions:
-
scale_calibration–Scale a camera calibration to another image resolution.
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:
-
configure–Return a context manager for batching camera parameter changes.
-
enable_ehdr–Enable or disable the eHDR mode.
-
get_backlight_compensation–Get the camera backlight compensation.
-
get_bitrate–Get the video stream bitrate.
-
get_bitrate_still_picture–Get the bitrate for the still picture stream.
-
get_brightness–Get the camera brightness.
-
get_calibration–Get the intrinsic calibration of the camera.
-
get_color_correction–Get the color correction filter settings of the main camera.
-
get_contrast–Get the camera contrast.
-
get_denoise–Get the camera noise reduction.
-
get_ehdr_exposure_max_number–Get the maximum number of eHDR frames.
-
get_ehdr_exposure_min_number–Get the minimum number of eHDR frames.
-
get_exposure–Get the camera exposure.
-
get_framerate–Get the camera frame rate.
-
get_gain–Get the camera gain.
-
get_gamma–Get the camera gamma.
-
get_hue–Get the camera hue.
-
get_mtu_size–Get the network MTU size used for video streaming.
-
get_pan_tilt_zoom–Get the digital pan, tilt and zoom state of the main camera.
-
get_record_time–Get the duration of the current camera recording.
-
get_recording_bitrate–Get the recording bitrate in bits per second.
-
get_recording_codec–Get the recording video codec.
-
get_recording_resolution–Get the camera recording resolution.
-
get_resolution–Get the camera resolution.
-
get_saturation–Get the camera saturation.
-
get_scaled_calibration–Get the camera calibration scaled to a video resolution.
-
get_sharpness–Get the camera sharpness.
-
get_stream_resolution–Get the camera stream resolution.
-
get_stream_url–Get the RTSP URL of this camera's live stream.
-
get_streaming_protocol–Get the streaming protocol (codec used for the RTSP stream).
-
get_turbidity_filter–Get the turbidity filter settings of the main camera.
-
get_whitebalance–Get the camera white balance.
-
is_ehdr_enabled–Get the state of the eHDR mode.
-
is_recording_active–Get the camera recording state.
-
set_backlight_compensation–Set the camera backlight compensation.
-
set_bitrate–Set the video stream bitrate.
-
set_bitrate_still_picture–Set the bitrate for the still picture stream.
-
set_brightness–Set the camera brightness.
-
set_color_correction–Set the color correction filter on the main camera.
-
set_contrast–Set the camera contrast.
-
set_denoise–Set the camera noise reduction.
-
set_ehdr_exposure_max_number–Set the maximum number of eHDR frames.
-
set_ehdr_exposure_min_number–Set the minimum number of eHDR frames.
-
set_exposure–Set the camera exposure.
-
set_framerate–Set the camera frame rate.
-
set_gain–Set the camera gain.
-
set_gamma–Set the camera gamma.
-
set_hue–Set the camera hue.
-
set_mtu_size–Set the network MTU size used for video streaming.
-
set_pan_tilt_zoom–Set the digital pan, tilt and zoom of the main camera.
-
set_recording–Set the camera recording state.
-
set_recording_bitrate–Set the recording bitrate in bits per second.
-
set_recording_codec–Set the recording video codec.
-
set_recording_resolution–Set the camera recording resolution.
-
set_resolution–Set the camera resolution.
-
set_saturation–Set the camera saturation.
-
set_sharpness–Set the camera sharpness.
-
set_stream_resolution–Set the camera stream resolution.
-
set_streaming_protocol–Set the streaming protocol (codec used for the RTSP stream).
-
set_turbidity_filter–Set the turbidity filter on the main camera.
-
set_whitebalance–Set the camera white balance.
-
take_picture–Take a still picture and store it locally on the drone.
Source code in blueye/sdk/camera.py
1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 | |
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
1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 | |
enable_ehdr
enable_ehdr(enable_ehdr: bool)
Enable or disable the eHDR mode.
Only available on the X3 Ultra and X7.
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
1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 | |
get_backlight_compensation
get_backlight_compensation() -> int
Get the camera backlight compensation.
Only available on the X3 Ultra and X7.
Returns:
-
int–The camera backlight compensation.
Source code in blueye/sdk/camera.py
1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 | |
get_bitrate
get_bitrate() -> int
Get the video stream bitrate.
Returns:
-
int–The H264 video stream bitrate.
Source code in blueye/sdk/camera.py
1124 1125 1126 1127 1128 1129 1130 1131 | |
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
1147 1148 1149 1150 1151 1152 1153 1154 | |
get_brightness
get_brightness() -> int
Get the camera brightness.
Only available on the X3 Ultra and X7.
Returns:
-
int–The camera brightness.
Source code in blueye/sdk/camera.py
1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 | |
get_calibration
get_calibration() -> Optional[CameraCalibration]
Get the intrinsic calibration of the camera.
The X3 Ultra and X7 publish the main camera calibration (pinhole model with OpenCV
distortion coefficients) in the DroneInfoTel telemetry message. The values are in
pixels at the resolution the calibration was computed at, see
get_scaled_calibration for a version
matching the video resolution. is_default is set when the drone reports the model's
built-in calibration rather than one measured for this particular drone.
Older models and the guestport camera do not publish a calibration.
Returns:
-
Optional[CameraCalibration]–The camera calibration, or None if the drone has not published one.
Source code in blueye/sdk/camera.py
1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 | |
get_color_correction
get_color_correction() -> Optional[FilterMessage]
Get the color correction filter settings of the main camera.
The color correction filter restores the red and blue balance that water absorbs with depth, driven by the depth and the scene. Only available on the X3 Ultra and X7.
The drone publishes ColorCorrectionTel when the settings change rather than at a fixed
rate. The value is the last change seen since connecting, and the drone is asked for its
current settings if there has been none.
Returns:
-
Optional[FilterMessage]–The filter settings with
enabledandintensity(0..1), or None if the drone has not reported any, as is the case for older models and the guestport camera.
Source code in blueye/sdk/camera.py
2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 | |
get_contrast
get_contrast() -> int
Get the camera contrast.
Only available on the X3 Ultra and X7.
Returns:
-
int–The camera contrast.
Source code in blueye/sdk/camera.py
1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 | |
get_denoise
get_denoise() -> int
Get the camera noise reduction.
Only available on the X3 Ultra and X7.
Returns:
-
int–The camera noise reduction.
Source code in blueye/sdk/camera.py
1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 | |
get_ehdr_exposure_max_number
get_ehdr_exposure_max_number() -> int
Get the maximum number of eHDR frames.
Only available on the X3 Ultra and X7.
Returns:
-
int–The maximum number of eHDR frames.
Source code in blueye/sdk/camera.py
1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 | |
get_ehdr_exposure_min_number
get_ehdr_exposure_min_number() -> int
Get the minimum number of eHDR frames.
Only available on the X3 Ultra and X7.
Returns:
-
int–The minimum number of eHDR frames.
Source code in blueye/sdk/camera.py
1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 | |
get_exposure
get_exposure() -> int
Get the camera exposure.
Returns:
-
int–The camera exposure.
Source code in blueye/sdk/camera.py
1172 1173 1174 1175 1176 1177 1178 1179 | |
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
1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 | |
get_gain
get_gain() -> float
Get the camera gain.
On the X3 Ultra and X7 the drone reports -1 while auto exposure owns the gain, that is whenever the exposure is automatic or no manual gain has been set.
Returns:
-
float–The camera ISO gain (0..1), or -1 when the drone controls it.
Source code in blueye/sdk/camera.py
1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 | |
get_gamma
get_gamma() -> int
Get the camera gamma.
Only available on the X3 Ultra and X7.
Returns:
-
int–The camera gamma.
Source code in blueye/sdk/camera.py
1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 | |
get_hue
get_hue() -> int
Get the camera hue.
Only available on Pioneer/Pro/X1/X3, the 4K camera in the X3 Ultra and X7 has no hue control.
Returns:
-
int–The camera hue.
Source code in blueye/sdk/camera.py
1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 | |
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
1853 1854 1855 1856 1857 1858 1859 1860 | |
get_pan_tilt_zoom
get_pan_tilt_zoom() -> Optional[CameraPanTiltZoom]
Get the digital pan, tilt and zoom state of the main camera.
The 4K camera in the X3 Ultra and X7 can crop and scale its sensor image, which gives a
digital pan, tilt and zoom with no moving parts. The drone reports the state it has
applied in CameraPanTiltZoomTel, published when the state changes.
Returns:
-
Optional[CameraPanTiltZoom]–The state with
pan(-1..1),tilt(-1..1) andzoom(0..1), where 0 is centred and not zoomed, or None if the drone has not reported any, as is the case for older models and the guestport camera.
Source code in blueye/sdk/camera.py
2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 | |
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
1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 | |
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
1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 | |
get_recording_codec
get_recording_codec() -> RecordingCodec
Get the recording video codec.
Returns:
-
RecordingCodec–The current recording codec setting.
Source code in blueye/sdk/camera.py
1763 1764 1765 1766 1767 1768 1769 1770 | |
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:
-
Resolution–The camera recording resolution.
Source code in blueye/sdk/camera.py
1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 | |
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
1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 | |
get_saturation
get_saturation() -> int
Get the camera saturation.
Only available on the X3 Ultra and X7.
Returns:
-
int–The camera saturation.
Source code in blueye/sdk/camera.py
1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 | |
get_scaled_calibration
get_scaled_calibration(
resolution: Union[
Resolution, Tuple[int, int], None
] = None,
) -> Optional[CameraCalibration]
Get the camera calibration scaled to a video resolution.
See scale_calibration for how the values are
scaled.
Parameters:
-
resolution(Resolution | tuple[int, int], default:None) –The resolution to scale the calibration to, either as a
blueye.protocol.Resolutionor as a(width, height)tuple in pixels. AResolutionmaps to the frame size the drone's video pipeline produces for it: 640x480 for 480p and 16:9 for the others. Defaults to the current stream resolution.
Raises:
-
ValueError–If the resolution is not a
blueye.protocol.Resolutionor a(width, height)tuple of positive integers. -
RuntimeError–If the drone reports a stream resolution the SDK does not recognize.
Returns:
-
Optional[CameraCalibration]–The scaled calibration, or None if the drone has not published one.
Source code in blueye/sdk/camera.py
1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 | |
get_sharpness
get_sharpness() -> int
Get the camera sharpness.
Only available on the X3 Ultra and X7.
Returns:
-
int–The camera sharpness.
Source code in blueye/sdk/camera.py
1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 | |
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:
-
Resolution–The camera stream resolution
Source code in blueye/sdk/camera.py
1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 | |
get_stream_url
get_stream_url() -> str
Get the RTSP URL of this camera's live stream.
The URL comes from the stream list the drone reports in its drone info, addressed to the
IP this Drone connects to. Without a stream list, on older drones or before connecting,
the default is returned: port 8554 for the main camera and 8555 for a guest port camera.
The drone streams over UDP only, see Live video streams for players and limits.
Returns:
-
str–The stream URL, such as
"rtsp://192.168.1.101:8554/test".
Source code in blueye/sdk/camera.py
2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 | |
get_streaming_protocol
get_streaming_protocol() -> StreamingProtocol
Get the streaming protocol (codec used for the RTSP stream).
Returns:
-
StreamingProtocol–The current streaming protocol.
Source code in blueye/sdk/camera.py
1826 1827 1828 1829 1830 1831 1832 1833 | |
get_turbidity_filter
get_turbidity_filter() -> Optional[FilterMessage]
Get the turbidity filter settings of the main camera.
The turbidity filter runs contrast limited adaptive histogram equalisation (CLAHE) on the video, which brings out detail in turbid water. Only available on the X3 Ultra and X7.
The drone publishes TurbidityFilterTel when the settings change rather than at a fixed
rate. The value is the last change seen since connecting, and the drone is asked for its
current settings if there has been none.
Returns:
-
Optional[FilterMessage]–The filter settings with
enabledandintensity(0..1), or None if the drone has not reported any, as is the case for older models and the guestport camera.
Source code in blueye/sdk/camera.py
1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 | |
get_whitebalance
get_whitebalance() -> int
Get the camera white balance.
Returns:
-
int–The camera white balance.
Source code in blueye/sdk/camera.py
1199 1200 1201 1202 1203 1204 1205 1206 | |
is_ehdr_enabled
is_ehdr_enabled() -> bool
Get the state of the eHDR mode.
Only available on the X3 Ultra and X7.
Returns:
-
bool–The current state of the eHDR mode.
Source code in blueye/sdk/camera.py
1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 | |
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
1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 | |
set_backlight_compensation
set_backlight_compensation(compensation: int)
Set the camera backlight compensation.
Only available on the X3 Ultra and X7.
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
1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 | |
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
1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 | |
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
1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 | |
set_brightness
set_brightness(brightness: int)
Set the camera brightness.
Only available on the X3 Ultra and X7.
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
1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 | |
set_color_correction
set_color_correction(enabled: bool, intensity: float)
Set the color correction filter on the main camera.
See get_color_correction for what the
filter does.
Parameters:
-
enabled(bool) –Whether the filter is enabled.
-
intensity(float) –How much of the correction is applied, 0 leaves the image as is and 1 applies the full correction.
Raises:
-
ValueError–If the intensity is outside 0..1.
-
RuntimeError–If this is the guestport camera, the drone runs Blunux older than 5.0.0, or the drone is neither an X3 Ultra nor an X7.
Source code in blueye/sdk/camera.py
2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 | |
set_contrast
set_contrast(contrast: int)
Set the camera contrast.
Only available on the X3 Ultra and X7.
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
1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 | |
set_denoise
set_denoise(denoise: int)
Set the camera noise reduction.
Only available on the X3 Ultra and X7.
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
1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 | |
set_ehdr_exposure_max_number
set_ehdr_exposure_max_number(number: int)
Set the maximum number of eHDR frames.
Only available on the X3 Ultra and X7.
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
1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 | |
set_ehdr_exposure_min_number
set_ehdr_exposure_min_number(number: int)
Set the minimum number of eHDR frames.
Only available on the X3 Ultra and X7.
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
1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 | |
set_exposure
set_exposure(exposure: int)
Set the camera exposure.
On the X3 Ultra and X7 a shutter time longer than one frame at the current frame rate
is shortened to the frame period, 333 at 30 fps, and
get_exposure reports the shortened value.
Parameters:
-
exposure(int) –Shutter time in units of 1/10000 s (100 µs), so 100 = 10 ms. Valid values are in the range (1..5000) or -1 for auto exposure.
Source code in blueye/sdk/camera.py
1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 | |
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 X3 Ultra and X7 at 1440p or lower. If the requested frame rate is not supported at the current resolution the drone reduces it while respecting the resolution. On the X3 Ultra and X7 the live stream is limited to 30 fps: at 60 fps it carries every other frame, and recordings keep the full rate.
Raises:
-
ValueError–If the frame rate is not 25, 30 or 60.
Source code in blueye/sdk/camera.py
1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 | |
set_gain
set_gain(gain: float)
Set the camera gain.
On the X3 Ultra and X7 a manual gain only takes effect together with a manual exposure
(see set_exposure). With auto exposure, or
with a gain of -1, the drone's auto exposure controls the gain. On Pioneer/Pro/X1/X3 a
value of -1 leaves the gain unchanged.
Parameters:
-
gain(float) –Set the ISO gain (0..1), or -1 to let the drone control it.
Source code in blueye/sdk/camera.py
1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 | |
set_gamma
set_gamma(gamma: int)
Set the camera gamma.
Only available on the X3 Ultra and X7.
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
1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 | |
set_hue
set_hue(hue: int)
Set the camera hue.
Only available on Pioneer/Pro/X1/X3, the 4K camera in the X3 Ultra and X7 has no hue control.
Parameters:
-
hue(int) –Set the camera hue. Valid values are in the range (-40..40).
Source code in blueye/sdk/camera.py
1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 | |
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
1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 | |
set_pan_tilt_zoom
set_pan_tilt_zoom(
pan: Optional[float] = None,
tilt: Optional[float] = None,
zoom: Optional[float] = None,
)
Set the digital pan, tilt and zoom of the main camera.
The three values are sent together in one message. An argument that is left out keeps the value this object last sent. Before the first call it keeps the value the drone last reported, or 0 if it has not reported one. The drone reports a change about 0.1 s after the command, which is why the last sent values are used rather than the report: two calls in a row would otherwise undo each other. A change made by another client after the last call from this object is not picked up; pass all three values to be sure. Pan and tilt only have an effect while zoomed in, since at zoom 0 the whole sensor image is already shown.
Laser dot tracking works on the full, unzoomed image, so
enable_tracking resets pan, tilt and
zoom to 0 when it starts, as the Blueye app does.
Parameters:
-
pan(float, default:None) –Horizontal pan (-1..1), 0 is centred.
-
tilt(float, default:None) –Vertical tilt (-1..1), 0 is centred.
-
zoom(float, default:None) –Zoom level (0..1), 0 is no zoom.
Raises:
-
ValueError–If pan or tilt is outside -1..1, or zoom is outside 0..1.
-
RuntimeError–If this is the guestport camera, the drone runs Blunux older than 5.0.0, or the drone is neither an X3 Ultra nor an X7.
Source code in blueye/sdk/camera.py
2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 | |
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.
Raises:
-
RuntimeError–If a recording is started while the drone's storage settings have videos switched off, in which case the drone would not record.
Source code in blueye/sdk/camera.py
1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 | |
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
1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 | |
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 the X3 Ultra and X7.
Raises:
-
ValueError–If the codec is not a valid
blueye.protocol.RecordingCodectype. -
RuntimeError–If the connected drone is running Blunux older than 5.0.0.
Source code in blueye/sdk/camera.py
1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 | |
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.Resolutiontype
Source code in blueye/sdk/camera.py
1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 | |
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
1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 | |
set_saturation
set_saturation(saturation: int)
Set the camera saturation.
Only available on the X3 Ultra and X7.
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
1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 | |
set_sharpness
set_sharpness(sharpness: int)
Set the camera sharpness.
Only available on the X3 Ultra and X7.
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
1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 | |
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.Resolutiontype
Source code in blueye/sdk/camera.py
1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 | |
set_streaming_protocol
set_streaming_protocol(protocol: StreamingProtocol)
Set the streaming protocol (codec used for the RTSP stream).
Parameters:
-
protocol(StreamingProtocol) –Set the streaming protocol.
Raises:
-
ValueError–If the protocol is not a valid
blueye.protocol.StreamingProtocoltype.
Source code in blueye/sdk/camera.py
1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 | |
set_turbidity_filter
set_turbidity_filter(enabled: bool, intensity: float)
Set the turbidity filter on the main camera.
See get_turbidity_filter for what the
filter does.
Parameters:
-
enabled(bool) –Whether the filter is enabled.
-
intensity(float) –How strongly the filter is applied (0..1).
Raises:
-
ValueError–If the intensity is outside 0..1.
-
RuntimeError–If this is the guestport camera, the drone runs Blunux older than 5.0.0, or the drone is neither an X3 Ultra nor an X7.
Source code in blueye/sdk/camera.py
2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 | |
set_whitebalance
set_whitebalance(white_balance: int)
Set the camera white balance.
Parameters:
-
white_balance(int) –Colour temperature in kelvin. Valid values are in the range (2800..9300) on Pioneer/Pro/X1/X3 and (2300..15000) on the X3 Ultra and X7, or -1 for auto white balance.
Source code in blueye/sdk/camera.py
1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 | |
take_picture
take_picture()
Take a still picture and store it locally on the drone.
The picture command has no camera selector: the drone captures from the main camera and,
if a guest port camera is attached, from that camera too, whichever Camera object the
call is made on. See Recording video and taking
pictures.
These pictures can be downloaded with the Blueye App, or by any WebDAV compatible client.
Raises:
-
RuntimeError–If the drone's storage settings have images switched off, in which case the drone would drop the picture.
Source code in blueye/sdk/camera.py
2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 | |
Overlay
Overlay(parent_drone: Drone)
Control the overlay on videos and pictures.
Parameters:
-
parent_drone(Drone) –The parent drone instance.
Methods:
-
delete_logo–Delete the user uploaded logo from the drone.
-
download_logo–Download the original user uploaded logo (PNG or JPG).
-
enable_altitude–Set the state of the altitude overlay.
-
enable_cp_probe–Set the state of the CP probe overlay.
-
enable_date–Set the state of the date overlay.
-
enable_depth–Set the state of the depth overlay.
-
enable_distance–Set the state of the distance overlay.
-
enable_drone_location–Set the state of the drone location overlay.
-
enable_gamma_ray_measurement–Set the state of the gamma-ray measurement overlay.
-
enable_heading–Set the state of the heading overlay.
-
enable_temperature–Set the state of the temperature overlay.
-
enable_thickness–Set the state of the thickness overlay.
-
enable_tilt–Set the state of the tilt overlay.
-
get_date_format–Get the format string for the time displayed in the overlay.
-
get_depth_unit–Get the depth unit for the overlay.
-
get_font_size–Get the font size for the overlay.
-
get_logo–Get the logo overlay selection.
-
get_margin_height–Get the margin height for the overlay.
-
get_margin_width–Get the margin width for the overlay.
-
get_shading–Get the pixel intensity to subtract from text background.
-
get_subtitle–Get the subtitle for the overlay.
-
get_temperature_unit–Get the temperature unit for the overlay.
-
get_thickness_unit–Get the thickness unit for the overlay.
-
get_timezone_offset–Get the timezone offset for the overlay.
-
get_title–Get the title for the overlay.
-
is_altitude_enabled–Get the state of the altitude overlay.
-
is_cp_probe_enabled–Get the state of the CP probe overlay.
-
is_date_enabled–Get the state of the date overlay.
-
is_depth_enabled–Get the state of the depth overlay.
-
is_distance_enabled–Get the state of the distance overlay.
-
is_drone_location_enabled–Get the state of the drone location overlay.
-
is_gamma_ray_measurement_enabled–Get the state of the gamma-ray measurement overlay.
-
is_heading_enabled–Get the state of the heading overlay.
-
is_temperature_enabled–Get the state of the temperature overlay.
-
is_thickness_enabled–Get the state of the thickness overlay.
-
is_tilt_enabled–Get the state of the tilt overlay.
-
set_date_format–Set the format string for the time displayed in the overlay.
-
set_depth_unit–Set the depth unit for the overlay.
-
set_font_size–Set the font size for the overlay.
-
set_logo–Set the logo overlay selection.
-
set_margin_height–Set the margin height for the overlay.
-
set_margin_width–Set the margin width for the overlay.
-
set_shading–Set the pixel intensity to subtract from text background.
-
set_subtitle–Set the subtitle for the overlay.
-
set_temperature_unit–Set the temperature unit for the overlay.
-
set_thickness_unit–Set the thickness unit for the overlay.
-
set_timezone_offset–Set the timezone offset for the overlay.
-
set_title–Set the title for the overlay.
-
upload_logo–Upload user selectable logo for watermarking videos and pictures.
Source code in blueye/sdk/camera.py
181 182 183 184 185 186 187 188 | |
delete_logo
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
866 867 868 869 870 871 872 873 874 875 876 877 878 | |
download_logo
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
846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 | |
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
442 443 444 445 446 447 448 449 450 451 | |
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
398 399 400 401 402 403 404 405 406 407 | |
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
292 293 294 295 296 297 298 299 300 301 | |
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
225 226 227 228 229 230 231 232 233 234 | |
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
420 421 422 423 424 425 426 427 428 429 | |
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
514 515 516 517 518 519 520 521 522 523 524 | |
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
568 569 570 571 572 573 574 575 576 577 578 | |
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
247 248 249 250 251 252 253 254 255 256 | |
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
203 204 205 206 207 208 209 210 211 212 | |
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
464 465 466 467 468 469 470 471 472 473 | |
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
269 270 271 272 273 274 275 276 277 278 | |
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
777 778 779 780 781 782 783 784 | |
get_depth_unit
get_depth_unit() -> DepthUnit
Get the depth unit for the overlay.
Returns:
-
DepthUnit–The current depth unit.
Source code in blueye/sdk/camera.py
333 334 335 336 337 338 339 340 | |
get_font_size
get_font_size() -> FontSize
Get the font size for the overlay.
Returns:
-
FontSize–The current font size.
Source code in blueye/sdk/camera.py
668 669 670 671 672 673 674 675 | |
get_logo
get_logo() -> LogoType
Get the logo overlay selection.
Returns:
-
LogoType–The current logo type.
Source code in blueye/sdk/camera.py
305 306 307 308 309 310 311 312 | |
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
638 639 640 641 642 643 644 645 | |
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
608 609 610 611 612 613 614 615 | |
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
530 531 532 533 534 535 536 537 | |
get_subtitle
get_subtitle() -> str
Get the subtitle for the overlay.
Returns:
-
str–The current subtitle.
Source code in blueye/sdk/camera.py
737 738 739 740 741 742 743 744 | |
get_temperature_unit
get_temperature_unit() -> TemperatureUnit
Get the temperature unit for the overlay.
Returns:
-
TemperatureUnit–The current temperature unit.
Source code in blueye/sdk/camera.py
361 362 363 364 365 366 367 368 | |
get_thickness_unit
get_thickness_unit() -> ThicknessUnit
Get the thickness unit for the overlay.
Returns:
-
ThicknessUnit–The current thickness unit.
Source code in blueye/sdk/camera.py
477 478 479 480 481 482 483 484 | |
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
584 585 586 587 588 589 590 591 | |
get_title
get_title() -> str
Get the title for the overlay.
Returns:
-
str–The current title.
Source code in blueye/sdk/camera.py
698 699 700 701 702 703 704 705 | |
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
433 434 435 436 437 438 439 440 | |
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
389 390 391 392 393 394 395 396 | |
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
282 283 284 285 286 287 288 289 290 | |
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
216 217 218 219 220 221 222 223 | |
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
411 412 413 414 415 416 417 418 | |
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
505 506 507 508 509 510 511 512 | |
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
559 560 561 562 563 564 565 566 | |
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
238 239 240 241 242 243 244 245 | |
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
194 195 196 197 198 199 200 201 | |
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
455 456 457 458 459 460 461 462 | |
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
260 261 262 263 264 265 266 267 | |
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
786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 | |
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
342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 | |
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
677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 | |
set_logo
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
314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 | |
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
647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 | |
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
617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 | |
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
539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 | |
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
746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 | |
set_temperature_unit
set_temperature_unit(unit: TemperatureUnit)
Set the temperature unit for the overlay.
Parameters:
-
unit(TemperatureUnit) –The temperature unit to set.
Warns:
-
RuntimeWarning–If the unit is not an instance of blueye.protocol.TemperatureUnit.
Source code in blueye/sdk/camera.py
370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 | |
set_thickness_unit
set_thickness_unit(unit: ThicknessUnit)
Set the thickness unit for the overlay.
Parameters:
-
unit(ThicknessUnit) –The thickness unit to set.
Warns:
-
RuntimeWarning–If the unit is not an instance of blueye.protocol.ThicknessUnit.
Source code in blueye/sdk/camera.py
486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 | |
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
593 594 595 596 597 598 599 600 601 602 603 604 | |
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
707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 | |
upload_logo
upload_logo(path_to_logo: str, timeout: float = 1.0)
Upload user selectable logo for watermarking videos and pictures.
Call set_logo with
blueye.protocol.LogoType.LOGO_TYPE_CUSTOM to show it.
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
821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 | |
Tilt
Tilt(parent_drone: Drone)
Handles the camera tilt functionality for the Blueye drone.
Every model except the original Pioneer can tilt its camera. The Pro, X1, X3 and X3 Ultra
tilt from -30 to +30 degrees and the X7 from -90 to +90 degrees. The methods raise
RuntimeError on a drone without "tilt" in Drone.features.
Parameters:
-
parent_drone(Drone) –The parent drone instance.
Methods:
-
enable_stabilization–Set the state of active camera stabilization.
-
get_angle–Return the current angle of the camera tilt.
-
is_stabilization_enabled–Get the state of active camera stabilization.
-
set_velocity–Set the speed and direction of the camera tilt.
Source code in blueye/sdk/camera.py
90 91 92 93 94 95 96 | |
enable_stabilization
enable_stabilization(enabled: bool)
Set the state of active camera stabilization.
Stabilization tilts the camera against the drone's pitch. The X7 accepts and reports the setting, but its tilt servo does not compensate.
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
160 161 162 163 164 165 166 167 168 169 170 171 172 173 | |
get_angle
get_angle() -> Optional[float]
Return the current angle of the camera tilt.
Returns:
-
Optional[float]–The current angle of the camera tilt in degrees, positive up. None if no telemetry has been received.
Raises:
-
RuntimeError–If the connected drone does not have the tilt option.
Source code in blueye/sdk/camera.py
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | |
is_stabilization_enabled
is_stabilization_enabled() -> Optional[bool]
Get the state of active camera stabilization.
On the X7 this reports the setting, which the drone does not act on, see
enable_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
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | |
set_velocity
set_velocity(velocity: float)
Set the speed and direction of the camera tilt.
The drone keeps the last velocity until it gets a new one, so the tilt runs to its end stop unless the velocity is set back to 0.
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
107 108 109 110 111 112 113 114 115 116 117 118 119 120 | |
scale_calibration
scale_calibration(
calibration: CameraCalibration, width: int, height: int
) -> CameraCalibration
Scale a camera calibration to another image resolution.
The focal lengths and principal point are expressed in pixels at the resolution the
calibration was computed at, so they have to be scaled before they can be used on an image
of a different size. fx and cx scale with the width ratio, fy and cy with the height
ratio, and the distortion coefficients are resolution independent.
Parameters:
-
calibration(CameraCalibration) –The calibration to scale.
-
width(int) –The width in pixels of the image the calibration will be used on.
-
height(int) –The height in pixels of the image the calibration will be used on.
Raises:
-
ValueError–If the calibration has no resolution, or the target resolution is not positive.
Returns:
-
CameraCalibration–A new calibration with
image_widthandimage_heightset to the target resolution.
Source code in blueye/sdk/camera.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | |