Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions plantcv/plantcv/filters/eccentricity.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from skimage.measure import label, regionprops
from plantcv.plantcv import params
from plantcv.plantcv._debug import _debug
from plantcv.plantcv.deprecation_warning import deprecation_warning


def eccentricity(bin_img, ecc_thresh=0):
Expand All @@ -13,17 +14,20 @@ def eccentricity(bin_img, ecc_thresh=0):
The closer the value to 0 the closer the shape is to a circle.

Inputs:
bin_img = Binary image containing the connected regions to consider
ecc_thresh = Eccentricity threshold below which a region is kept

bin_img = numpy.ndarray,
Binary image containing the connected regions to consider
ecc_thresh = float,
Eccentricity threshold below which a region is kept

Returns:
discs_mask = Binary image that contains only the detected discs

:param bin_img: numpy.ndarray
:param ecc_thresh: float
:return discs_mask: numpy.ndarray
--------
discs_mask = numpy.ndarray,
Binary image that contains only the detected discs
"""
deprecation_warning(
"plantcv.plantcv.filters.eccentricity is superceded by " +
"plantcv.plantcv.filteres.obj_props(..., regprop='eccentricity') and will be removed in v5"
)
params.device += 1
# label connected regions
labeled_img = label(bin_img)
Expand Down