From e375a1a2fd34770d7bb66eda0fb4f4f0df637956 Mon Sep 17 00:00:00 2001 From: HaleySchuhl Date: Fri, 17 May 2024 17:11:54 -0500 Subject: [PATCH 1/5] code example calling wrong function --- docs/transform_affine_color_correction.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/transform_affine_color_correction.md b/docs/transform_affine_color_correction.md index 3ccfb5b11..6ad7c8508 100644 --- a/docs/transform_affine_color_correction.md +++ b/docs/transform_affine_color_correction.md @@ -13,7 +13,7 @@ Euclidean distance between the transformed source color values and the target co - **Parameters:** - rgb_img - an RGB image with color chips visualized - - source_matrix - array of RGB color values (intensity in the range [0-1]) from the image to be corrected where each row is one color reference and the columns are organized as index,R,G,B + - source_matrix - array of RGB color values (intensity in the range [0-1]) from the image to be corrected where each row is one color reference and the columns are organized as index,R,G,B (likely created with [plantcv.transform.create_color_card_mask](create_color_card_mask.md) or [plantcv.transform.detect_color_card](transform_detect_color_card.md)). - target_matrix - array of target RGB color values (intensity in the range [0-1]) where each row is one color reference and the columns are organized as index,R,G,B - **Example use:** - [Color Correction Tutorial](tutorials/transform_color_correction_tutorial.md) @@ -39,9 +39,9 @@ pcv.params.debug = 'plot' # using standard color values for the color card tgt_matrix = pcv.transform.std_color_matrix(pos=2) -corrected_img = pcv.transform.correct_color(rgb_img=img, - source_matrix=src_matrix, - target_matrix=tgt_matrix) +corrected_img = pcv.transform.affine_correct_color(rgb_img=img, + source_matrix=src_matrix, + target_matrix=tgt_matrix) ``` From 72f7ca4a0acf09f4cd0e5b80131871117eea920a Mon Sep 17 00:00:00 2001 From: HaleySchuhl Date: Mon, 20 May 2024 08:42:51 -0500 Subject: [PATCH 2/5] update based on actual function name oops --- docs/transform_affine_color_correction.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/transform_affine_color_correction.md b/docs/transform_affine_color_correction.md index 6ad7c8508..7f8294336 100644 --- a/docs/transform_affine_color_correction.md +++ b/docs/transform_affine_color_correction.md @@ -39,9 +39,9 @@ pcv.params.debug = 'plot' # using standard color values for the color card tgt_matrix = pcv.transform.std_color_matrix(pos=2) -corrected_img = pcv.transform.affine_correct_color(rgb_img=img, - source_matrix=src_matrix, - target_matrix=tgt_matrix) +corrected_img = pcv.transform.affine_color_correction(rgb_img=img, + source_matrix=src_matrix, + target_matrix=tgt_matrix) ``` From 4e7f7420f422f6fcb2b6b8d47480bdfa2f284c3a Mon Sep 17 00:00:00 2001 From: HaleySchuhl Date: Mon, 20 May 2024 09:42:50 -0500 Subject: [PATCH 3/5] clarification from Noah's comment --- docs/transform_affine_color_correction.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/transform_affine_color_correction.md b/docs/transform_affine_color_correction.md index 7f8294336..20f87e30e 100644 --- a/docs/transform_affine_color_correction.md +++ b/docs/transform_affine_color_correction.md @@ -13,8 +13,8 @@ Euclidean distance between the transformed source color values and the target co - **Parameters:** - rgb_img - an RGB image with color chips visualized - - source_matrix - array of RGB color values (intensity in the range [0-1]) from the image to be corrected where each row is one color reference and the columns are organized as index,R,G,B (likely created with [plantcv.transform.create_color_card_mask](create_color_card_mask.md) or [plantcv.transform.detect_color_card](transform_detect_color_card.md)). - - target_matrix - array of target RGB color values (intensity in the range [0-1]) where each row is one color reference and the columns are organized as index,R,G,B + - source_matrix - array of RGB color values (intensity in the range [0-1]) from the image to be corrected where each row is one color reference and the columns are organized as index,R,G,B + - target_matrix - array of target RGB color values (intensity in the range [0-1]) where each row is one color reference and the columns are organized as index,R,G,B (likely created with [plantcv.transform.create_color_card_mask](create_color_card_mask.md) or [plantcv.transform.detect_color_card](transform_detect_color_card.md)). - **Example use:** - [Color Correction Tutorial](tutorials/transform_color_correction_tutorial.md) From 89fc51d525a8154e44df777d90dfcc66bc0c7df1 Mon Sep 17 00:00:00 2001 From: HaleySchuhl Date: Mon, 20 May 2024 09:48:33 -0500 Subject: [PATCH 4/5] double check function names and doc page links --- docs/transform_affine_color_correction.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/transform_affine_color_correction.md b/docs/transform_affine_color_correction.md index 20f87e30e..9be835109 100644 --- a/docs/transform_affine_color_correction.md +++ b/docs/transform_affine_color_correction.md @@ -13,8 +13,8 @@ Euclidean distance between the transformed source color values and the target co - **Parameters:** - rgb_img - an RGB image with color chips visualized - - source_matrix - array of RGB color values (intensity in the range [0-1]) from the image to be corrected where each row is one color reference and the columns are organized as index,R,G,B - - target_matrix - array of target RGB color values (intensity in the range [0-1]) where each row is one color reference and the columns are organized as index,R,G,B (likely created with [plantcv.transform.create_color_card_mask](create_color_card_mask.md) or [plantcv.transform.detect_color_card](transform_detect_color_card.md)). + - source_matrix - array of RGB color values (intensity in the range [0-1]) from the image to be corrected where each row is one color reference and the columns are organized as index,R,G,B; likely created with [plantcv.transform.get_color_matrix](get_color_matrix.md) or [plantcv.transform.detect_color_card](transform_detect_color_card.md)). + - target_matrix - array of target RGB color values (intensity in the range [0-1]) where each row is one color reference and the columns are organized as index,R,G,B; likely created with [plantcv.transform.std_color_matrix](std_color_matrix.md). - **Example use:** - [Color Correction Tutorial](tutorials/transform_color_correction_tutorial.md) From 80706f95ab76d62f9d94ff482ff9ed096526839d Mon Sep 17 00:00:00 2001 From: Haley Schuhl <44006936+HaleySchuhl@users.noreply.github.com> Date: Mon, 20 May 2024 10:09:42 -0500 Subject: [PATCH 5/5] more tweaking transform_affine_color_correction.md --- docs/transform_affine_color_correction.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/transform_affine_color_correction.md b/docs/transform_affine_color_correction.md index 9be835109..ca452931c 100644 --- a/docs/transform_affine_color_correction.md +++ b/docs/transform_affine_color_correction.md @@ -13,7 +13,7 @@ Euclidean distance between the transformed source color values and the target co - **Parameters:** - rgb_img - an RGB image with color chips visualized - - source_matrix - array of RGB color values (intensity in the range [0-1]) from the image to be corrected where each row is one color reference and the columns are organized as index,R,G,B; likely created with [plantcv.transform.get_color_matrix](get_color_matrix.md) or [plantcv.transform.detect_color_card](transform_detect_color_card.md)). + - source_matrix - array of RGB color values (intensity in the range [0-1]) from the image to be corrected where each row is one color reference and the columns are organized as index,R,G,B; likely created with [plantcv.transform.get_color_matrix](get_color_matrix.md). - target_matrix - array of target RGB color values (intensity in the range [0-1]) where each row is one color reference and the columns are organized as index,R,G,B; likely created with [plantcv.transform.std_color_matrix](std_color_matrix.md). - **Example use:** - [Color Correction Tutorial](tutorials/transform_color_correction_tutorial.md) @@ -34,9 +34,10 @@ from plantcv import plantcv as pcv pcv.params.debug = 'plot' # the source matrix needs to be computed form the RGB image, see the functions -# plantcv.transform.create_color_card_mask and plantcv.transform.get_color_matrix +# plantcv.transform.detect_color_card to make a mask and +# plantcv.transform.get_color_matrix to make a matrix from that mask -# using standard color values for the color card +# using standard color values for the target tgt_matrix = pcv.transform.std_color_matrix(pos=2) corrected_img = pcv.transform.affine_color_correction(rgb_img=img,