You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
To the best of my knowledge currently the roi.filter only provides the option to either cut objects at the defined border of the roi or include objects that overlap the roi. There is no option to exclude objects that overlap the border of the roi.
In the images I am using, the roi borders are defined as the border of the image. Objects that touch the roi border are not fully in the image.
Describe the solution you'd like
An additional option for the roi_type that would exclude objects touching the roi border.
Describe alternatives you've considered
Shrinking the roi, works in some cases, but not all.
Taking the image at a greater height to include more objects of interest in the image, (so the roi can be significantly shrunk without sacrificing # of objects) - however the height at which I can take an image above the plants is a constraint.
-auto_grid, however the objects are not spaced consistently across images so roi_filter works much better than auto_grid
Additional context
Attached a photo
If there's a way to do this that I've missed or haven't thought of (I'm pretty new to plantcv, opencv, etc...), would really appreciate your insight! ty!!
The text was updated successfully, but these errors were encountered:
Thanks @jksshack for opening this issue. This sounds like a helpful addition to ROI filtering options.
We do have a within_frame quality control type function that tests whether objects are touching the border, but doesn't currently have an option to remove them for downstream workflow steps such as auto_grid.
In the short term, I would approach filtering like this with reverse approach (using image data from the multi plant tutorial as an example):
# Detect objects at the top border
roi1 = pcv.roi.rectangle(img=img, x=0, y=0, h=300, w=img.shape[1])
removed_obs = pcv.roi.filter(mask=a_fill, roi=roi1, roi_type='partial')
# lower border
roi2 = pcv.roi.rectangle(img=img, x=0, y=(img.shape[0] - 500), h=500, w=img.shape[1])
removed_obs2 = pcv.roi.filter(mask=a_fill, roi=roi2, roi_type='partial')
# Combine mask of things to remove
removed = removed_obs + removed_obs2
# Filter from the plant mask
filtered_mask = a_fill - removed
pcv.plot_image(filtered_mask)
Is your feature request related to a problem? Please describe.
To the best of my knowledge currently the roi.filter only provides the option to either cut objects at the defined border of the roi or include objects that overlap the roi. There is no option to exclude objects that overlap the border of the roi.
In the images I am using, the roi borders are defined as the border of the image. Objects that touch the roi border are not fully in the image.
Describe the solution you'd like
An additional option for the roi_type that would exclude objects touching the roi border.
Describe alternatives you've considered
Shrinking the roi, works in some cases, but not all.
Taking the image at a greater height to include more objects of interest in the image, (so the roi can be significantly shrunk without sacrificing # of objects) - however the height at which I can take an image above the plants is a constraint.
-auto_grid, however the objects are not spaced consistently across images so roi_filter works much better than auto_grid
Additional context
Attached a photo
If there's a way to do this that I've missed or haven't thought of (I'm pretty new to plantcv, opencv, etc...), would really appreciate your insight! ty!!
The text was updated successfully, but these errors were encountered: