Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add deprecation warning about label from the detect color card function #1664

Merged
merged 14 commits into from
Feb 5, 2025
Merged
7 changes: 5 additions & 2 deletions plantcv/plantcv/transform/auto_correct_color.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Automatically detect a color card and color correct to standard chip values

from plantcv.plantcv import params
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

Expand Down Expand Up @@ -28,7 +28,10 @@ def auto_correct_color(rgb_img, label=None, **kwargs):
# Set lable 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."
)
# Get keyword arguments and set defaults if not set
labeled_mask = detect_color_card(rgb_img=rgb_img, min_size=kwargs.get("min_size", 1000),
radius=kwargs.get("radius", 20),
Expand Down
7 changes: 5 additions & 2 deletions plantcv/plantcv/transform/detect_color_card.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import cv2
import math
import numpy as np
from plantcv.plantcv import params, outputs, fatal_error
from plantcv.plantcv import params, outputs, fatal_error, deprecation_warning
from plantcv.plantcv._debug import _debug


Expand Down Expand Up @@ -108,7 +108,10 @@ def detect_color_card(rgb_img, label=None, **kwargs):
# Set lable 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."
)
# Get keyword arguments and set defaults if not set
min_size = kwargs.get("min_size", 1000) # Minimum size for _is_square chip filtering
radius = kwargs.get("radius", 20) # Radius of circles to draw on the color chips
Expand Down
Loading