Skip to content

Commit

Permalink
Merge pull request #1533 from danforthcenter/affine_color_docs_typo
Browse files Browse the repository at this point in the history
`affine_color_correct` docs - code example calling wrong function
  • Loading branch information
nfahlgren authored Jun 13, 2024
2 parents 5bc5535 + 80706f9 commit f25882c
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions docs/transform_affine_color_correction.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
- 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)

Expand All @@ -34,14 +34,15 @@ 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.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)

```

Expand Down

0 comments on commit f25882c

Please sign in to comment.