diff --git a/docs/transform_auto_correct_color.md b/docs/transform_auto_correct_color.md index 23f38fc7f..8f3a10080 100644 --- a/docs/transform_auto_correct_color.md +++ b/docs/transform_auto_correct_color.md @@ -5,13 +5,12 @@ in the RGB space after automatic detection of a color card within the image. A o [plantcv.transform.detect_color_card](transform_detect_color_card.md), [plantcv.transform.std_color_matrix](std_color_matrix.md), [plantcv.transform.get_color_matrix](get_color_matrix.md), and [plantcv.transform.affine_color_correction](transform_affine_color_correction.md). -**plantcv.transform.auto_correct_color**(*rgb_img, label=None, color_chip_size=None, roi=None, \*\*kwargs*) +**plantcv.transform.auto_correct_color**(*rgb_img, color_chip_size=None, roi=None, \*\*kwargs*) **returns** corrected_img - **Parameters** - rgb_img - Input RGB image data containing a color card. - - label - Optional label parameter, modifies the variable name of observations recorded. (default = `pcv.params.sample_label`) - color_chip_size - Type of color card to be detected, (case insensitive, either "classic", "passport", "nano", or "cameratrax", by default `None`). Or provide `(width, height)` of your specific color card in millimeters. If set then size scalings parameters `pcv.params.unit`, `pcv.params.px_width`, and `pcv.params.px_height` are automatically set, and utilized throughout linear and area type measurements stored to `Outputs`. - roi - Optional rectangular ROI as returned by [`pcv.roi.rectangle`](roi_rectangle.md) within which to look for the color card. (default = None) - **kwargs - Other keyword arguments passed to `cv2.adaptiveThreshold` and `cv2.circle`. diff --git a/docs/updating.md b/docs/updating.md index 885758b6f..cc7edbcd6 100644 --- a/docs/updating.md +++ b/docs/updating.md @@ -59,15 +59,20 @@ automatically. Alternatively, you can run `pip install -e .` to reinstall the pa ### Breaking changes between v4 and v5 -#### plantcv.report_size_marker_area +#### plantcv.spectral_index.egi + +Renamed the input parameter `rgb_img` to `img` to reflect the flexibility of using the [EGI index function](spectral_index.md) +with RGB and hyperspectral data. + +#### plantcv.transform.auto_correct_color Removed `label` parameter since size marker data is now stored as metadata in the [`Outputs` class](outputs.md) and does not need to be labeled per sample. -#### plantcv.spectral_index.egi +#### plantcv.transform.detect_color_card -Renamed the input parameter `rgb_img` to `img` to reflect the flexibility of using the [EGI index function](spectral_index.md) -with RGB and hyperspectral data. +Removed `label` parameter since size marker data is now stored as metadata in the +[`Outputs` class](outputs.md) and does not need to be labeled per sample. #### plantcv.visualize.time_lapse_video @@ -1266,6 +1271,7 @@ pages for more details on the input and output variable types. * pre v4.6: NA * post v4.6: corrected_img = **plantcv.transform.auto_correct_color**(*rgb_img, label=None, \*\*kwargs*) * post v4.9: corrected_img = **plantcv.transform.auto_correct_color**(*rgb_img, label=None, color_chip_size=None, roi=None, \*\*kwargs*) +* post v5.0: corrected_img = **plantcv.transform.auto_correct_color**(*rgb_img, color_chip_size=None, roi=None, \*\*kwargs*) #### plantcv.transform.correct_color diff --git a/plantcv/plantcv/transform/auto_correct_color.py b/plantcv/plantcv/transform/auto_correct_color.py index e5c95b71f..90e89c4bb 100644 --- a/plantcv/plantcv/transform/auto_correct_color.py +++ b/plantcv/plantcv/transform/auto_correct_color.py @@ -1,18 +1,14 @@ # Automatically detect a color card and color correct to standard chip values - -from plantcv.plantcv import params, deprecation_warning from plantcv.plantcv.transform.detect_color_card import detect_color_card from plantcv.plantcv.transform.color_correction import get_color_matrix, std_color_matrix, affine_color_correction -def auto_correct_color(rgb_img, label=None, color_chip_size=None, roi=None, **kwargs): +def auto_correct_color(rgb_img, color_chip_size=None, roi=None, **kwargs): """Automatically detect a color card. Parameters ---------- rgb_img : numpy.ndarray Input RGB image data containing a color card. - label : str, optional - modifies the variable name of observations recorded (default = pcv.params.sample_label). color_chip_size: str, tuple, optional "passport", "classic", "cameratrax"; or tuple formatted (width, height) in millimeters (default = None) @@ -32,13 +28,6 @@ def auto_correct_color(rgb_img, label=None, color_chip_size=None, roi=None, **kw numpy.ndarray Color corrected image """ - # Set label to params.sample_label if None - if label is None: - label = params.sample_label - deprecation_warning( - "The 'label' parameter is no longer utilized, since color chip size is now metadata. " - "It will be removed in PlantCV v5.0." - ) labeled_mask = detect_color_card(rgb_img=rgb_img, color_chip_size=color_chip_size, roi=roi, **kwargs) _, card_matrix = get_color_matrix(rgb_img=rgb_img, mask=labeled_mask) std_matrix = std_color_matrix(pos=3)