robotic_sdk.data_processing package
Submodules
robotic_sdk.data_processing.plotting module
- robotic_sdk.data_processing.plotting.plot_mask(d: list, size=(480, 640, 3))
Plots masks on an image.
- Parameters:
d (list) – List of mask data.
robotic_sdk.data_processing.thermal_alignment module
- robotic_sdk.data_processing.thermal_alignment.calculate_fixed(visual: ndarray, thermal: ndarray, M: ndarray, vis: bool = True)
Calculates the perspective transformation of the thermal image and optionally overlays it on the visual image.
- Parameters:
visual (numpy.ndarray) – The visual image.
thermal (numpy.ndarray) – The thermal image.
M (numpy.ndarray) – The transformation matrix.
vis (bool, optional) – Whether to overlay the transformed thermal image on the visual image. Defaults to True.
- Returns:
A tuple containing the transformed thermal image and the visual image with the overlay (if vis is True).
- Return type:
tuple
- robotic_sdk.data_processing.thermal_alignment.get_mock_M(name: str)
Retrieves a mock transformation matrix for the given name.
- Parameters:
name (str) – The name of the mock transformation matrix to retrieve.
- Returns:
The mock transformation matrix.
- Return type:
numpy.ndarray
- robotic_sdk.data_processing.thermal_alignment.rgb_thermal_alignment_mock_up(visual: ndarray, thermal: ndarray, name: str)
Aligns the thermal image with the visual image using a mock transformation matrix.
- Parameters:
visual (numpy.ndarray) – The visual image.
thermal (numpy.ndarray) – The thermal image.
name (str) – The name of the mock transformation matrix to use.
- Returns:
A tuple containing the transformed thermal image and the visual image with the overlay.
- Return type:
tuple
robotic_sdk.data_processing.thermal_dataset module
robotic_sdk.data_processing.thermal_plotting module
- robotic_sdk.data_processing.thermal_plotting.add_text(img: ndarray, t: int, x: int, y: int)
Adds text to an image at the specified coordinates.
- Parameters:
img (np.ndarray) – The image to add text to.
t (str) – The text to add.
x (int) – The x-coordinate for the text position.
y (int) – The y-coordinate for the text position.
- robotic_sdk.data_processing.thermal_plotting.draw_segmentation_prediction(image_bgr: ndarray, thermal_bgr: ndarray, dets: list, thermal_vals: list | None = None, preds: list | None = None)
Draws segmentation on the image. If predictions are given, draws text with median temperatures and white rectangles for negative predictions.
- Parameters:
image_bgr (np.ndarray) – The image in BGR format.
thermal_bgr (np.ndarray) – The thermal image in BGR format.
dets (list) – The list of detections.
thermal_vals (list, optional) – The list of thermal values. Defaults to None.
preds (list, optional) – The list of predictions. Defaults to None.
- Returns:
The image with the drawn segmentation and predictions.
- Return type:
np.ndarray
- robotic_sdk.data_processing.thermal_plotting.get_thermal_values(thermal_bgr: ndarray, dets: list | None = None)
Gets thermal values of pixels given the detections.
- Parameters:
thermal_bgr (np.ndarray) – The thermal image in BGR format.
dets (list, optional) – The list of detections. Defaults to None.
- Returns:
A tuple containing the detections, thermal values, and all thermal values.
- Return type:
tuple
- robotic_sdk.data_processing.thermal_plotting.thermal_value(thermal: ndarray, mask: ndarray)
Get the thermal values of pixels given a mask.
- Parameters:
thermal (np.ndarray) – The thermal image.
mask (np.ndarray) – The mask to apply on the thermal image.
- Returns:
A tuple containing the median thermal value and the array of thermal values.
- Return type:
tuple