macrobot.segmentation

Module Contents

Functions

segment_lanes_rgb(rgb_image, image_backlight, ...)

Extraction the lanes between the white frames.

segment_lanes_binary(lanes_roi_backlight)

Threshold the lanes by Otsu method to get a binary image for leaf segmentation.

segment_leaf_binary(lanes_roi_binary, lanes_roi_rgb, ...)

Threshold the leaves by finding and filtering the contours of the binary lane image.

macrobot.segmentation.segment_lanes_rgb(rgb_image, image_backlight, image_tresholded, experiment, plate_id)

Extraction the lanes between the white frames. First we find and filter the contours of the threshold image to find the frames. Then we extract a rectangle inside the white frames and oder the position from left to right.

Parameters
  • rgb_image (numpy array.) – 3-channel RGB image to extract the lanes.

  • image_backlight (numpy array.) – The backlight image.

  • image_tresholded (numpy array.) – The threshold image we use as source to find the frames.

Returns

Two list with contains the RGB and backlight lanes and their positions as tuple(image, position).

Return type

list

macrobot.segmentation.segment_lanes_binary(lanes_roi_backlight)

Threshold the lanes by Otsu method to get a binary image for leaf segmentation. The backlight image is used for this step.

Parameters

lanes_roi_backlight (list) – The lanes of the backlight image as list of tuple(image, position).

Returns

Two list with contains the backlight lanes as binary image and it’s positions as tuple(image, position).

Return type

list

macrobot.segmentation.segment_leaf_binary(lanes_roi_binary, lanes_roi_rgb, plate_id, leaves_per_lane, predicted_lanes, destination_path, y_position, experiment, dai, file_results, store_leaf_path, report_path, report=True)

Threshold the leaves by finding and filtering the contours of the binary lane image.

Parameters
  • lanes_roi_binary – The lanes of the binary image as list of tuple(image, position).

  • lanes_roi_rgb (list) – The lanes of the RGB image as list of tuple(image, position).

  • plate_id (str) – The plate ID.

  • leaves_per_lane (int) – maximum leaves per lane.

  • predicted_lanes (list) – The lanes of the predicted image as list of tuple(image, position).

  • destination_path (str) – The path to store the final result images and csv file.

  • y_position (int) – Y Position for the leaves.

  • experiment (str) – The experiment name.

  • dai (str) – Days after inoculation.

  • file_results (file object) – The CSV file for each experiments which contains the pathogen prediction per leaf.

Returns

Two list with contains the backlight lanes as binary image and it’s positions as tuple(image, position).

Return type

list