:py:mod:`macrobot.prediction` ============================= .. py:module:: macrobot.prediction Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: macrobot.prediction.predict_min_rgb macrobot.prediction.predict_max_rgb macrobot.prediction.predict_saturation macrobot.prediction.predict_leaf .. py:function:: predict_min_rgb(minrgb_image, backlight_image, rgb_image) Predict the pathogen by thresholding the minRGB image. Used for BGT. :param minrgb_image: The min RGB feature image. :type minrgb_image: numpy array. :param backlight_image: The backlight image used for necrosis detection. :type backlight_image: numpy array. :param rgb_image: The RGB image. :type rgb_image: numpy array. :return: The predicted image after thresholding. 255 = pathogen, 0 = background :rtype: numpy array .. py:function:: predict_max_rgb(maxrgb_image, backlight_image, rgb_image) Predict the pathogen by thresholding the maxRGB image. Used for BGT. :param maxrgb_image: The max RGB feature image. :type maxrgb_image: numpy array. :param backlight_image: The backlight image used for necrosis detection. :type backlight_image: numpy array. :param rgb_image: The RGB image. :type rgb_image: numpy array. :return: The predicted image after thresholding. 255 = pathogen, 0 = background :rtype: numpy array .. py:function:: predict_saturation(image_saturation, image_backlight) Predict the pathogen by thresholding the saturation image. Used for Rust. :param image_saturation: The saturation feature image of HSV color space. :type image_saturation: numpy array. :param image_backlight: The backlight image used for necrosis detection. :type image_backlight: numpy array. :return: The predicted image after thresholding. 255 = pathogen, 0 = background :rtype: numpy array .. py:function:: predict_leaf(predicted_image, leaf_binary_image) Predict the pathogen per leaf. :param predicted_image: The predicted image with the pathogen. 255 = pathogen, 0 = background :type predicted_image: numpy array. :param leaf_binary_image: The binary leaf image to extract the leaf. :type leaf_binary_image: numpy array. :return: The infected area in percent. black_pixels * 100 / white_pixels :rtype: numpy array