macrobot.prediction

Module Contents

Functions

predict_min_rgb(minrgb_image, backlight_image, rgb_image)

Predict the pathogen by thresholding the minRGB image. Used for BGT.

predict_max_rgb(maxrgb_image, backlight_image, rgb_image)

Predict the pathogen by thresholding the maxRGB image. Used for BGT.

predict_saturation(image_saturation, image_backlight)

Predict the pathogen by thresholding the saturation image. Used for Rust.

predict_leaf(predicted_image, leaf_binary_image)

Predict the pathogen per leaf.

macrobot.prediction.predict_min_rgb(minrgb_image, backlight_image, rgb_image)

Predict the pathogen by thresholding the minRGB image. Used for BGT.

Parameters
  • minrgb_image (numpy array.) – The min RGB feature image.

  • backlight_image (numpy array.) – The backlight image used for necrosis detection.

  • rgb_image (numpy array.) – The RGB image.

Returns

The predicted image after thresholding. 255 = pathogen, 0 = background

Return type

numpy array

macrobot.prediction.predict_max_rgb(maxrgb_image, backlight_image, rgb_image)

Predict the pathogen by thresholding the maxRGB image. Used for BGT.

Parameters
  • maxrgb_image (numpy array.) – The max RGB feature image.

  • backlight_image (numpy array.) – The backlight image used for necrosis detection.

  • rgb_image (numpy array.) – The RGB image.

Returns

The predicted image after thresholding. 255 = pathogen, 0 = background

Return type

numpy array

macrobot.prediction.predict_saturation(image_saturation, image_backlight)

Predict the pathogen by thresholding the saturation image. Used for Rust.

Parameters
  • image_saturation (numpy array.) – The saturation feature image of HSV color space.

  • image_backlight (numpy array.) – The backlight image used for necrosis detection.

Returns

The predicted image after thresholding. 255 = pathogen, 0 = background

Return type

numpy array

macrobot.prediction.predict_leaf(predicted_image, leaf_binary_image)

Predict the pathogen per leaf.

Parameters
  • predicted_image (numpy array.) – The predicted image with the pathogen. 255 = pathogen, 0 = background

  • leaf_binary_image (numpy array.) – The binary leaf image to extract the leaf.

Returns

The infected area in percent. black_pixels * 100 / white_pixels

Return type

numpy array