plantcv
plantcv copied to clipboard
add a function to visualize instances in an image
Is your feature request related to a problem? Please describe. For the project I am working on, one image is segmented into several instances, i.e. leaves. I am wondering do we want a "visualize_instances" function with inputs of the original image and segmentation masks, where the number of masks equals the number of segmented instances?
Previously this function was built inside the "time-series linking" function (inside the time-series subpackage). But I found it would be useful if it is independent of the time-series subpackage so that I can use it on cases having nothing to do with time-series linking.
Describe the solution you'd like
Attached is an example of how this visualization would look like. Different colors represent different indices, the texts on them represent the indices of them. Users also have the choice to specify the color to use as well as the captions to display. Users also have the option to not showing the boxes, nor the texts.
Additional context This function was initially found in the mrcnn tool, but I made it independent of the mrcnn environment and made some changes to better fit our application.