:py:mod:`macrobot.segmentation` =============================== .. py:module:: macrobot.segmentation Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: macrobot.segmentation.segment_lanes_rgb macrobot.segmentation.segment_lanes_binary macrobot.segmentation.segment_leaf_binary .. py:function:: segment_lanes_rgb(rgb_image, image_backlight, image_tresholded) 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. :param rgb_image: 3-channel RGB image to extract the lanes. :type rgb_image: numpy array. :param image_backlight: The backlight image. :type image_backlight: numpy array. :param image_tresholded: The threshold image we use as source to find the frames. :type image_tresholded: numpy array. :return: Two list with contains the RGB and backlight lanes and their positions as tuple(image, position). :rtype: list .. py:function:: 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. :param lanes_roi_backlight: The lanes of the backlight image as list of tuple(image, position). :type lanes_roi_backlight: list :return: Two list with contains the backlight lanes as binary image and it's positions as tuple(image, position). :rtype: list .. py:function:: 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. :param lanes_roi_binary: The lanes of the binary image as list of tuple(image, position). :type lanes_roi_backlight: list :param lanes_roi_rgb: The lanes of the RGB image as list of tuple(image, position). :type lanes_roi_rgb: list :param plate_id: The plate ID. :type plate_id: str :param leaves_per_lane: maximum leaves per lane. :type leaves_per_lane: int :param predicted_lanes: The lanes of the predicted image as list of tuple(image, position). :type predicted_lanes: list :param destination_path: The path to store the final result images and csv file. :type destination_path: str :param y_position: Y Position for the leaves. :type y_position: int :param experiment: The experiment name. :type experiment: str :param dai: Days after inoculation. :type dai: str :param file_results: The CSV file for each experiments which contains the pathogen prediction per leaf. :type file_results: file object :return: Two list with contains the backlight lanes as binary image and it's positions as tuple(image, position). :rtype: list