Skip to content

Commit

Permalink
Merge branch 'main' into read-images-http
Browse files Browse the repository at this point in the history
  • Loading branch information
nfahlgren authored Jun 13, 2024
2 parents 856c05d + f25882c commit e3aa323
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 e3aa323

Please sign in to comment.