Invert¶
Invert a binary image. This is a wrapper for the OpenCV function bitwise_not
plantcv.invert(gray_img)
returns inverted image
-
Parameters:
- img - Grayscale image data
-
Context:
- Invert image values. Useful for inverting an image mask.
- Example use:
Input binary image
from plantcv import plantcv as pcv
# Set global debug behavior to None (default), "print" (to file), or "plot" (Jupyter Notebooks or X11)
pcv.params.debug = "print"
# Invert a binary mask.
inverted_img = pcv.invert(img)
Inverted image