Replies: 1 comment 1 reply
-
Hi @EdwinP503!
We have a few approaches for this kind of problem (summarized in this tutorial: https://plantcv.readthedocs.io/en/stable/tutorials/multi-plant_tutorial/).
This is usually what I do also. I loop over the ROIs and within that loop run We don't currently have a way to join disconnected stem segments unfortunately and those will cause an issue.
We also do not have a method for this yet. The most common case we have is when two secondary segments overlap and create a cycle with the primary stem. We have discussed some potential options for disambiguating the cross-over junction but have not implemented anything yet.
I will have to check into this. It is likely caused by either a division by zero or a calculation with an infinity value. This should be mostly harmless (it is only a warning) and would only affect the outputs of isolated pixels (wherever a valid value of K cannot be calculated). |
Beta Was this translation helpful? Give feedback.
-
Good evening guys!
There is a workflow I am currently working on that requires me to analyze a collection of images with multiple trees in a fixed background. I created a binary mask where I isolate the objects using the CMYK color space ('K' channel works the best to threshold the image and keep the targeted objects), but now I need to identify each individually and run shape analysis on them. A rectangular ROI along the fixed background would be ideal and roi_objects to select the trees with the 'partial' option. Looking at the seed-analysis and multi-plant workflows I'd say I would create a list of id for each object and loop through them to do morphology analysis for each of them.
My questions are:
1- Do I need to create a ROI grid? if so, how can I automate the number of columns based on the number of trees? or if I set the value to be 6 for example, the grid will be created as long as there are <6 objects?
2- I'm thinking of creating a conditional loop that continues to run as long as there are not more than 6 objects detected; which variable saves the number of objects in the ROI? There is a chance some branches are cut off and could be considered a separate object, is it possible to join those pieces to the main stem or can I apply
skeletonize
andprune
to all the objects in the image at once?3- There are cases where some branches from different trees overlap, is there a function from PlantCV or OpenCV used to tell what branches belong to the main stem?
4- The CMYK color space I believe was added recently, and it gives me the following warning when I run it for the first time in the kernel.
/Users/Edwin_Polanco/opt/anaconda3/lib/python3.8/site-packages/plantcv/plantcv/rgb2gray_cmyk.py:44: RuntimeWarning: invalid value encountered in true_divide
Could this affect the overall purpose of the workflow? The warning was constantly showing when running the workflow but I was able to avoid this to happen by ignoring the warning and reset it after the function, but if there is a different way I can improve it I welcome any suggestions.
ignore_divide = np.seterr(divide='ignore', invalid='ignore')
k_channel = pcv.rgb2gray_cmyk(rgb_img=balanced_img, channel='K')
reset_divide = np.seterr(divide='warn', invalid='warn')
The project is a work-in-progress, and any information is greatly appreciated!
Cheers,
Edwin Polanco
Beta Was this translation helpful? Give feedback.
All reactions