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_dataset.create_dataset(results_with_time: list, name: str, conf: dict) tuple

Creates a dataset with various thermal features.

Parameters:
  • results_with_time (list) – List of tuples containing results and corresponding time.

  • name (str) – The name of the dataset.

  • conf (dict) – Configuration dictionary with ‘maxi’ and ‘mini’ temperature values.

Returns:

A tuple containing data_pix (pandas.DataFrame), data (pandas.DataFrame), and d.

Return type:

tuple

robotic_sdk.data_processing.thermal_dataset.get_boiling_temp(result: tuple, conf: dict) float

Calculates the boiling temperature from the thermal results.

Parameters:
  • result (tuple) – A tuple containing the thermal results.

  • conf (dict) – Configuration dictionary with ‘maxi’ and ‘mini’ temperature values.

Returns:

The calculated boiling temperature.

Return type:

float

robotic_sdk.data_processing.thermal_dataset.get_thermal_features(data: DataFrame) DataFrame

Selects features for the thermal model.

Parameters:

data (pandas.DataFrame) – The input data containing thermal measurements.

Returns:

The selected features for the model.

Return type:

pandas.DataFrame

robotic_sdk.data_processing.thermal_dataset.plot_distribution(data_pix_to_plot: DataFrame)

Plots a distribution of pixels for each mask.

Parameters:

data_pix_to_plot (pandas.DataFrame) – DataFrame containing pixel data to plot.

robotic_sdk.data_processing.thermal_dataset.val_to_temp(tv: float, maxi: float, mini: float) float

Converts a thermal value to temperature.

Parameters:
  • tv (float) – The thermal value.

  • maxi (float) – The maximum temperature.

  • mini (float) – The minimum temperature.

Returns:

The corresponding temperature.

Return type:

float

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, preds: list = 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)

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

robotic_sdk.data_processing.transformation module

Module contents