Skip to content

Commit

Permalink
Merge pull request #1415 from danforthcenter/updated_color_correction…
Browse files Browse the repository at this point in the history
…_tutorial

Updated color correction tutorial
  • Loading branch information
nfahlgren committed Jan 8, 2024
2 parents 7c7b4ec + c476da5 commit 5bd2e14
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 22 deletions.
2 changes: 1 addition & 1 deletion docs/analyze_grayscale.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ the values out to the [Outputs class](outputs.md). Can also return/plot/print ou
- **Example use:**
* [Grayscale Image Tutorial](tutorials/grayscale_tutorial.md)

- **Output data stored:** Data ('gray_frequencies', 'gray_mean', 'gray_median', 'nir_stdev') automatically gets stored to
- **Output data stored:** Data ('gray_frequencies', 'gray_mean', 'gray_median', 'gray_stdev') automatically gets stored to
the [`Outputs` class](outputs.md) when this function is ran. These data can always get accessed during a workflow (example
below). For more detail about data output see [Summary of Output Observations](output_measurements.md#summary-of-output-observations)

Expand Down
2 changes: 1 addition & 1 deletion docs/get_color_matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Computes the average *R*, *G*, *B* values for each region in the RGB image denot

- **Parameters**
- rgb_img - RGB image with color chips visualized
- mask - a gray-scale img with unique values for each segmented space, representing unique, discrete color chips.
- mask - a gray-scale img with unique values for each segmented space, representing unique, discrete color chips. Likely created with [`pcv.transform.detect_color_card`](transform_detect_color_card.md).

- **Returns**
- color_matrix - a *n* x 4 matrix containing the average red value, average green value, and average blue value for each color chip.
Expand Down
41 changes: 22 additions & 19 deletions docs/output_measurements.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,32 +147,35 @@ suggestions for additional metadata we should track that would be useful to you,

Functions that automatically store data to the [`Outputs` class](outputs.md) are
[analyze.bound_horizontal](analyze_bound_horizontal2.md),
[analyze.bound_vertical](analyze_bound_vertical2.md),
[analyze.color](analyze_color2.md),
[analyze.grayscale](analyze_grayscale.md),
[analyze.size](analyze_size.md),
[analyze.spectral_index](analyze_spectral_index.md),
[analyze.spectral_reflectance](analyze_spectral_reflectance.md),
[analyze.thermal](analyze_thermal.md),
[analyze.bound_vertical](analyze_bound_vertical2.md),
[analyze.color](analyze_color2.md),
[analyze.grayscale](analyze_grayscale.md),
[analyze.size](analyze_size.md),
[analyze.spectral_index](analyze_spectral_index.md),
[analyze.spectral_reflectance](analyze_spectral_reflectance.md),
[analyze.thermal](analyze_thermal.md),
[analyze.yii](analyze_yii.md),
[analyze.npq](analyze_npq.md),
[homology.landmark_reference_pt_dist](homology_landmark_reference_pt_dist.md),
[analyze.npq](analyze_npq.md),
[homology.acute](homology_landmark_reference_pt_dist.md),
[homology.landmark_reference_pt_dist](homology_landmark_reference_pt_dist.md),
[homology.x_axis_pseudolandmarks](homology_x_axis_pseudolandmarks.md),
[homology.y_axis_pseudolandmarks](homology_y_axis_pseudolandmarks.md),
[morphology.check_cycles](check_cycles.md),
[homology.y_axis_pseudolandmarks](homology_y_axis_pseudolandmarks.md),
[morphology.analyze_stem](analyze_stem.md),
[morphology.check_cycles](check_cycles.md),
[morphology.fill_segments](fill_segments.md),
[morphology.find_tips](find_tips.md),
[morphology.find_tips](find_tips.md),
[morphology.find_branch_pts](find_branch_pts.md),
[morphology.segment_angle](segment_angle.md),
[morphology.segment_angle](segment_angle.md),
[morphology.segment_curvature](segment_curvature.md),
[morphology.segment_euclidean_length](segment_euclidean_length.md),
[morphology.segment_euclidean_length](segment_euclidean_length.md),
[morphology.segment_insertion_angle](segment_insertion_angle.md),
[morphology.segment_path_length](segment_pathlength.md),
[morphology.segment_tangent_angle](segment_tangent_angle.md),
[report_size_marker_area](report_size_marker.md),
[transform.find_color_card](find_color_card.md),
[morphology.segment_path_length](segment_pathlength.md),
[morphology.segment_tangent_angle](segment_tangent_angle.md),
[report_size_marker_area](report_size_marker.md),
[transform.find_color_card](find_color_card.md),
[transform.detect_color_card](transform_detect_color_card.md)
[watershed_segmentation](watershed.md), and
[within_frame](within_frame.md)
[within_frame](within_frame.md).

All of these functions include an optional `label` parameter
that allows users to append custom prefixes to the unique variable identifier.
Expand Down
3 changes: 2 additions & 1 deletion docs/transform_affine_color_correction.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ Euclidean distance between the transformed source color values and the target co
- 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

- **Example use:**
- [Color Correction Tutorial](tutorials/transform_color_correction_tutorial.md)

**Reference Images**

Expand Down
4 changes: 4 additions & 0 deletions docs/transform_detect_color_card.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Automatically detects a color card and creates a labeled mask.
- radius - Radius of circle to make the color card labeled mask (default = 20).
- **Returns**
- labeled_mask - Labeled color card mask (useful downstream of this step in `pcv.transform.get_color_matrix` and `pcv.transform.correct_color`)
- **Example use:**
- [Color Correction Tutorial](tutorials/transform_color_correction_tutorial.md)

!!! note
Color chip size can only be used reasonably as a scaling factor (converting pixels to a known real world scale like cms)
Expand All @@ -31,6 +33,8 @@ rgb_img, path, filename = pcv.readimage("target_img.png")
cc_mask = pcv.transform.detect_color_card(rgb_img=rgb_img)

avg_chip_size = pcv.outputs.observations['default']['median_color_chip_size']['value']
avg_chip_w = pcv.outputs.observations['default']['median_color_chip_width']['value']
avg_chip_h = pcv.outputs.observations['default']['median_color_chip_height']['value']

```

Expand Down
1 change: 1 addition & 0 deletions plantcv/plantcv/photosynthesis/reassign_frame_labels.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""Reassign PSII frame labels based on induction curve"""
import numpy as np
from plantcv.plantcv import fatal_error
from plantcv.plantcv.classes import PSII_data
Expand Down

0 comments on commit 5bd2e14

Please sign in to comment.