pseudocolor function in visualization does not behave as expected #737
Replies: 2 comments 4 replies
-
After testing several potential solutions, I figured out one solution that (hopefully) addresses the issues. But before I include it into my current PR #569 , I would like to share the code here because it might me some not trivia changes. Feel free to direct your self here: /shares/mgehan_share/hsheng/projects/test_plantcv/threshold_mask_bad/mask_bad_visualize/pseudocolor_update.ipynb But in brief, the ideas are:
If
|
Beta Was this translation helpful? Give feedback.
-
I get something different, though still not working correctly. Plotting on the background image works: ps = pcv.visualize.pseudocolor(gray_img=gray_img, min_value=30, max_value=200,
mask=bin_clean, background="image", cmap="viridis") But the "white" or "black" background both show up black for me: ps = pcv.visualize.pseudocolor(gray_img=gray_img, min_value=30, max_value=200,
mask=bin_clean, background="image", cmap="white") |
Beta Was this translation helpful? Give feedback.
-
I was trying to update the pseudocolor function by including the "showing bad mask" feature. However when I test on the current version of pseudocolor, the behavior is not as expected. Specifically, I tested:
# Pseudocolor the same image but include the mask and limit the range of values pseudo_img_masked = pcv.visualize.pseudocolor(gray_img=img, obj=None, mask=mask, background="white", cmap='viridis', min_value=30, max_value=200)
which is in our documentation, and a visualization of the pseudocolored plant in the mask area would be shown, with the background being white:
But what I actually got is this:
I am not sure if it is related to some Matplotlib backend settings. I also tried to use the source code of
pcv.visualize.pseudocolor
but it seemed that the it did not behave as expected.Beta Was this translation helpful? Give feedback.
All reactions