diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index 6a67c1355..914e31a45 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -33,7 +33,11 @@ jobs: deploy: needs: build runs-on: ubuntu-latest - + environment: + name: pypi + url: https://pypi.org/p/plantcv + permissions: + id-token: write steps: - uses: actions/checkout@main with: @@ -46,10 +50,8 @@ jobs: run: | python -m pip install --upgrade pip pip install setuptools wheel twine - - name: Build and publish - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + - name: Build run: | python setup.py sdist bdist_wheel - twine upload dist/* + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/docs/analyze_grayscale.md b/docs/analyze_grayscale.md index 82a986a94..90f093999 100644 --- a/docs/analyze_grayscale.md +++ b/docs/analyze_grayscale.md @@ -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) diff --git a/docs/annotate_click_count.md b/docs/annotate_click_count.md new file mode 100644 index 000000000..bcc64c907 --- /dev/null +++ b/docs/annotate_click_count.md @@ -0,0 +1,208 @@ +## Click and count objects + +`ClickCount` is a class that allows users to interactively count objects and other annotation tasks. + +*class* **plantcv.annotate.ClickCount**(*img*, *figsize*=(12, 6)) + +- img - Image data +- figsize - Interactive plot figure size (default = (12,6)) + +### Attributes +**img**: input image. + +**points**: a dictionary of coordinates for every class. + +**colors**: a dictionary of colors for every class. + +**counts**: a dictionary of count for every class. + +**figsize**: figure size. + +**events**: a list of events. + +**label**: current label. + +**color**: current color. + +**view_all**: a flag indicating whether or not view all labels. + +**fig**: matplotlib figure. + +**ax**: matplotlib axis. + +**p_not_current**: a list of matplotlib patches that are not current label. + +--- +### Methods +--- +**view(*label*="total", *color*="c", *view_all*=False)** + +View marked image, and update markers/annotations if needed. + +- Parameters: + - label - class label to show on the marked image. By default `label="total`. + - color - desired color to show the class. By default `color="c"`. + - view_all - a flag indicating whether to show markers for all classes or not. +--- +**import_coords(*coords*, *label*="total")** + +Import coordinates from a list of coordinates. + +- Parameters: + - coords - a list of available coordintes. + - label - class label for imported coordinates. By default `label="total`. +--- +**file_import**(*filename*) + +Import coordinates from file to a ClickCount object instance + +- **Parameters:** + - filename - path to a coordinates file +- **Context:** + - Loads coordinates from a file (probably created with the `.save_coords` method) to ClickCount object instance +--- +**save_coords(*filename*)** + +Save the collected coordinates to a JSON file. + +- Parameters: + - filename - (json) file name to save the coordinates of collected points. +--- +**correct**(*bin_img*, *bin_img_recover*, *coords*) + +Make corrections to annotations + +**returns** recovered image + +- **Parameters:** + - bin_img - binary image, image with selected objects (e.g. mask output of [`pcv.annotate.detect_discs`](annotate_detect_discs.md)) + - bin_img_recover - binary image, image with all potential objects (binary image to recover objects from) + - coords - list of coordinates of 'auto' detected points (e.g. coordinate output of `pcv.annotate.detect_discs`) +- **Context:** + - Make corrections to the number of objects in a binary image with information from the ClickCount class object instance (both remove and recover objects). Also corrects the ClickCount object instance with coordinates at the center of each object (rather than click location). +--- +**create_labels**(*gray_img*, *label='default'*) + +Label ClickCount Objects after they have been segmented + +**returns** labeled object image, labeled class image, ordered list of names, number of objects + +- **Parameters:** + - gray_img - gray image with objects uniquely labeled (e.g. output of [pcv.watershed_segmentation](watershed.md)) + - label - option to put in list of labels, defaults to 'default' if not included +- **Context:** + - Labels each object with a class ID (e.g. germinated, and/or total) that matches classes from ClickCount, returns a list of names for input into analyze steps, renumbers objects to equal the total number of objects, and stores coordinates to `Outputs`. +- **Output data stored:** Data ('count') for each ClickCount category automatically gets stored to the [`Outputs` class](outputs.md) when this function is +run. These data can be accessed during a workflow (example below). For more detail about data output see +[Summary of Output Observations](output_measurements.md#summary-of-output-observations) +--- +### Pollen Annotation Example +- **Note**: used in Jupyter notebook. +```python +# Include the line of code below to allow interactive activities +%matplotlib widget + +# Import packages +from plantcv import plantcv as pcv +import os + +# Define workflow inputs +args = WorkflowInputs(images=["rgb_pollen_image.jpg", + names="image1", + result="imgID_results.json", + outdir=".", + writeimg=True, + debug="plot") +# Set global debug behavior to "plot" (Jupyter Notebooks or X11) +pcv.params.debug = args.debug + +# Read image +img, path, fname = pcv.readimage(filename=args.image1) +``` +**Original RGB image** + +![Screenshot](img/documentation_images/annotate_clickcount_label/crop_pollen.png) + +```python +# Segmentation, this might include many clean up functions +gray = pcv.rgb2gray_lab(img, channel='l') +mask = pcv.threshold.mean(gray_img=gray, ksize=201, offset=20, object_type='dark') + +# Discard objects that are not circular +discs, coords = pcv.annotate.detect_discs(img_l_post, ecc_thresh=0.5) +``` + +**Detect Disc mask output** + +![Screenshot](img/documentation_images/annotate_clickcount_correct/pollen_detectdisc_mask.png) + +```python +# ClickCount Initialization +counter = pcv.annotate.ClickCount(img) + +# Click on the plotted image to annotate +counter.view(label="total", color="r", view_all=False) +``` +**View and Update ClickCount Coordinates** + +![screen-gif](img/documentation_images/annotate_click_count/clickcount_view.gif) + +```python +# Save out ClickCount coordinates file +counter.save_coords(os.path.join(args.outdir, str(args.result) + '.coords')) + +# OPTIONALLY, import coordinates to ClickCount object +# (e.g. pick up where you left off) +file = os.path.join(args.outdir, str(args.result) + ".coords") +counter.file_import(img=img, filename=file) +# View "total" class +counter.view(label="total", color="r", view_all=False) + +print(f"There are {counter.count['total']} selected objects") + +# Launch interactive tool to select objects with a different class +counter.view(label="germinated", color="b", view_all=False) + +print(f"There are {counter.count['germinated']} selected objects") + +# Associate a unique label to each grain for segmentation, +# recover the missing grains, and create a complete mask +completed_mask = counter.correct(bin_img=discs, bin_img_recover=mask, coords=coords) +``` + +**Recovered (after `.correct`) Objects Image** + +![Screenshot](img/documentation_images/annotate_clickcount_correct/Figure-4.png) + +```python +# Watershed egmentation to separate touching grains +seg = pcv.watershed_segmentation(rgb_img=img, mask=completed_mask, distance=1) +``` + +**Output of Watershed Segementation** + +![Screenshot](img/documentation_images/annotate_clickcount_label/Figure6.png) + +```python +# Assign a single label to each grain & store to outputs +class_label, class_count_dict, class_list, num = counter.create_labels(gray_img=seg, label="total") +``` +**Labeled Objects Image** + +![Screenshot](img/documentation_images/annotate_clickcount_label/Figure7.png) +![Screenshot](img/documentation_images/annotate_clickcount_label/Figure8.png) + +```python +# Optional, run additional trait analysis +shape_img = pcv.analyze.size(img=img, labeled_mask=class_label, n_labels=num, label=class_list) + +# Save the results with "long" format. If using analyze.color this might get too long. +pcv.outputs.save_results(filename=os.path.join(args.outdir, args.result + ".csv"), outformat="csv") +pcv.outputs.clear() +``` + +**Size Analysis debug image** + +![Screenshot](img/documentation_images/annotate_click_count/pollen_shape_annotations.png) + +**Source Code:** [Here](https://github.com/danforthcenter/plantcv/blob/main/plantcv/plantcv/annotate/classes.py) diff --git a/docs/annotate_get_centroids.md b/docs/annotate_get_centroids.md new file mode 100644 index 000000000..126dba145 --- /dev/null +++ b/docs/annotate_get_centroids.md @@ -0,0 +1,46 @@ +## Get centroids + +Get the coordinates (row, column) of the centroid of each connected region +in a binary image. + +**plantcv.annotate.get_centroids**(*bin_img*) + +**returns** list containing coordinates of centroids + +- **Parameters:** + - bin_img - Binary image containing the connected regions to consider +- **Context:** + - Given an arbitrary mask of the objects of interest, `get_centroids` + returns a list of coordinates that can the be imported into the annotation classes + [ClickCount](annotate_click_count.md) and [Points](annotate_points.md). + +- **Example use:** + - Below + +**Binary image** + +![count_img](img/documentation_images/annotate_detect_discs/discs_mask_scaled.png) + +```python + +from plantcv import plantcv as pcv + +# Set global debug behavior to None (default), "print" (to file), +# or "plot" +pcv.params.debug = "plot" + +# Apply get centroids to the binary image +coords = pcv.annotate.get_centroids(bin_img=binary_img) +print(coords) +# [[1902, 600], [1839, 1363], [1837, 383], [1669, 1977], [1631, 1889], [1590, 1372], [1550, 1525], +# [1538, 1633], [1522, 1131], [1494, 2396], [1482, 1917], [1446, 1808], [1425, 726], [1418, 2392], +# [1389, 198], [1358, 1712], [1288, 522], [1289, 406], [1279, 368], [1262, 1376], [1244, 1795], +# [1224, 1327], [1201, 624], [1181, 725], [1062, 85], [999, 840], [885, 399], [740, 324], [728, 224], +# [697, 860], [660, 650], [638, 2390], [622, 1565], [577, 497], [572, 2179], [550, 2230], [547, 1826], +# [537, 892], [538, 481], [524, 2144], [521, 2336], [497, 201], [385, 1141], [342, 683], [342, 102], +# [332, 1700], [295, 646], [271, 60], [269, 1626], [210, 1694], [189, 878], [178, 1570], [171, 2307], +# [61, 286], [28, 2342]] + +``` + +**Source Code:** [Here](https://github.com/danforthcenter/plantcv/blob/main/plantcv/plantcv/annotate/get_centroids.py) diff --git a/docs/Points.md b/docs/annotate_points.md similarity index 60% rename from docs/Points.md rename to docs/annotate_points.md index cca4c602d..458dcaed7 100644 --- a/docs/Points.md +++ b/docs/annotate_points.md @@ -1,18 +1,27 @@ ## Interactive Point Annotation Tool -Using [Jupyter Notebooks](jupyter.md) it is possible to interactively click to collect coordinates from an image, which can be used in various downstream applications. Left click on the image to collect a point. Right click removes the +Using [Jupyter Notebooks](jupyter.md) it is possible to interactively click to collect coordinates from an image, +which can be used in various downstream applications. Left click on the image to collect a point. Right click removes the closest collected point. -**plantcv.Points**(*img, figsize=(12, 6)*) +*class* **plantcv.annotate.Points**(*img, figsize=(12, 6)*) -**returns** interactive image class +- img - Image data +- figsize - Interactive plot figure size (default = (12,6)) -- **Parameters:** - - img - Image data - - figsize - Interactive plot figure size (default = (12,6)) +### Attributes +**points**: a dictionary of coordinates for every class. -- **Attributes:** - - points - Coordinates (x,y) of the collected points as a list of tuples +**fig**: matplotlib figure. + +**ax**: matplotlib axis. + +**events**: a list of events. + +### Methods +**onclick(*event*)** + +Handles mouse click events. - **Context:** - Used to define a list of coordinates of interest. @@ -23,10 +32,16 @@ closest collected point. ```python +%matplotlib widget + from plantcv import plantcv as pcv +# Set global debug behavior to None (default), "print" (to file), +# or "plot" +pcv.params.debug = "plot" + # Create an instance of the Points class -marker = pcv.Points(img=img, figsize=(12,6)) +marker = pcv.annotate.Points(img=img, figsize=(12,6)) # Click on the plotted image to collect coordinates @@ -44,4 +59,4 @@ roi1 = pcv.roi.custom(img=img, vertices=marker.points) ![Screenshot](img/documentation_images/annotate_Points/custom_roi.jpg) -**Source Code:** [Here](https://github.com/danforthcenter/plantcv/blob/master/plantcv/plantcv/classes.py) +**Source Code:** [Here](https://github.com/danforthcenter/plantcv/blob/main/plantcv/plantcv/annotate/classes.py) diff --git a/docs/detect_discs.md b/docs/detect_discs.md new file mode 100644 index 000000000..59b5694db --- /dev/null +++ b/docs/detect_discs.md @@ -0,0 +1,50 @@ +## Detect discs + +Detects disc-shaped regions in a binary image based on eccentricity. +A value of eccentricity between 0 and 1 corresponds to an ellipse. +The closer the value to 0 the closer the shape is to a circle. + +**plantcv.detect_discs**(*bin_img, ecc_thresh=0*) + +**returns** mask + +- **Parameters:** + - bin_img - Binary image containing the connected regions to consider + - ecc_thresh - Eccentricity threshold below which a region is detected +- **Context:** + - Used to isolate disc-shaped objects of interest in a binary image. The output mask can be used for further analysis. +- **Example use:** + - Below + +**Original image** + +![ori_img](img/documentation_images/annotate_click_count/count_img.jpg) + +**Mask generated using binary threshold in the blue channel** +![bin_img](img/documentation_images/annotate_detect_discs/discs_pre_scaled.png) + +```python + +from plantcv import plantcv as pcv + +# Set global debug behavior to None (default), "print" (to file), +# or "plot" +pcv.params.debug = "plot" + +# Apply detect discs to the binary image with an +# eccentricity threshold of 0.9 +discs_mask_9 = pcv.detect_discs(bin_img=binary_img, ecc_thresh=0.9) + +# Apply detect discs to the binary image with an +# eccentricity threshold of 0.5 +discs_mask_5 = pcv.detect_discs(bin_img=binary_img, ecc_thresh=0.5) + +``` + +**Mask of detected objects with eccentricity threshold of 0.9** +![count_img](img/documentation_images/annotate_click_count/count_mask.png) + +**Mask of detected objects with eccentricity threshold of 0.5** +![count_img](img/documentation_images/detect_discs/discs_mask_scaled.png) + +**Source Code:** [Here](https://github.com/danforthcenter/plantcv/blob/main/plantcv/plantcv/annotate/detect_discs.py) diff --git a/docs/get_color_matrix.md b/docs/get_color_matrix.md index 8a15b70e4..6cac913e0 100644 --- a/docs/get_color_matrix.md +++ b/docs/get_color_matrix.md @@ -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. diff --git a/docs/img/documentation_images/annotate_click_count/clickcount_view.gif b/docs/img/documentation_images/annotate_click_count/clickcount_view.gif new file mode 100644 index 000000000..8f15a6ade Binary files /dev/null and b/docs/img/documentation_images/annotate_click_count/clickcount_view.gif differ diff --git a/docs/img/documentation_images/annotate_click_count/count_img.jpg b/docs/img/documentation_images/annotate_click_count/count_img.jpg new file mode 100644 index 000000000..0153f7f22 Binary files /dev/null and b/docs/img/documentation_images/annotate_click_count/count_img.jpg differ diff --git a/docs/img/documentation_images/annotate_click_count/count_mask.png b/docs/img/documentation_images/annotate_click_count/count_mask.png new file mode 100644 index 000000000..dee8a9d49 Binary files /dev/null and b/docs/img/documentation_images/annotate_click_count/count_mask.png differ diff --git a/docs/img/documentation_images/annotate_click_count/pollen_shape_annotations.png b/docs/img/documentation_images/annotate_click_count/pollen_shape_annotations.png new file mode 100644 index 000000000..e090116d2 Binary files /dev/null and b/docs/img/documentation_images/annotate_click_count/pollen_shape_annotations.png differ diff --git a/docs/img/documentation_images/annotate_click_count/with_clickc1.png b/docs/img/documentation_images/annotate_click_count/with_clickc1.png new file mode 100644 index 000000000..0f86e0223 Binary files /dev/null and b/docs/img/documentation_images/annotate_click_count/with_clickc1.png differ diff --git a/docs/img/documentation_images/annotate_click_count/with_totalmask.png b/docs/img/documentation_images/annotate_click_count/with_totalmask.png new file mode 100644 index 000000000..e0541d70f Binary files /dev/null and b/docs/img/documentation_images/annotate_click_count/with_totalmask.png differ diff --git a/docs/img/documentation_images/annotate_clickcount_correct/Figure-4.png b/docs/img/documentation_images/annotate_clickcount_correct/Figure-4.png new file mode 100644 index 000000000..a00043304 Binary files /dev/null and b/docs/img/documentation_images/annotate_clickcount_correct/Figure-4.png differ diff --git a/docs/img/documentation_images/annotate_clickcount_correct/crop_pollen.png b/docs/img/documentation_images/annotate_clickcount_correct/crop_pollen.png new file mode 100644 index 000000000..c176b1cd2 Binary files /dev/null and b/docs/img/documentation_images/annotate_clickcount_correct/crop_pollen.png differ diff --git a/docs/img/documentation_images/annotate_clickcount_correct/pollen_all_mask.png b/docs/img/documentation_images/annotate_clickcount_correct/pollen_all_mask.png new file mode 100644 index 000000000..c5b7d1a13 Binary files /dev/null and b/docs/img/documentation_images/annotate_clickcount_correct/pollen_all_mask.png differ diff --git a/docs/img/documentation_images/annotate_clickcount_correct/pollen_detectdisc_mask.png b/docs/img/documentation_images/annotate_clickcount_correct/pollen_detectdisc_mask.png new file mode 100644 index 000000000..4290bb3e2 Binary files /dev/null and b/docs/img/documentation_images/annotate_clickcount_correct/pollen_detectdisc_mask.png differ diff --git a/docs/img/documentation_images/annotate_clickcount_label/Figure6.png b/docs/img/documentation_images/annotate_clickcount_label/Figure6.png new file mode 100644 index 000000000..55687f74d Binary files /dev/null and b/docs/img/documentation_images/annotate_clickcount_label/Figure6.png differ diff --git a/docs/img/documentation_images/annotate_clickcount_label/Figure7.png b/docs/img/documentation_images/annotate_clickcount_label/Figure7.png new file mode 100644 index 000000000..8e37df632 Binary files /dev/null and b/docs/img/documentation_images/annotate_clickcount_label/Figure7.png differ diff --git a/docs/img/documentation_images/annotate_clickcount_label/Figure8.png b/docs/img/documentation_images/annotate_clickcount_label/Figure8.png new file mode 100644 index 000000000..965b27cd8 Binary files /dev/null and b/docs/img/documentation_images/annotate_clickcount_label/Figure8.png differ diff --git a/docs/img/documentation_images/annotate_clickcount_label/crop_pollen.png b/docs/img/documentation_images/annotate_clickcount_label/crop_pollen.png new file mode 100644 index 000000000..b6910ae43 Binary files /dev/null and b/docs/img/documentation_images/annotate_clickcount_label/crop_pollen.png differ diff --git a/docs/img/documentation_images/annotate_clickcount_label/pollen_watershed.png b/docs/img/documentation_images/annotate_clickcount_label/pollen_watershed.png new file mode 100644 index 000000000..41f82a38e Binary files /dev/null and b/docs/img/documentation_images/annotate_clickcount_label/pollen_watershed.png differ diff --git a/docs/img/documentation_images/detect_discs/discs_mask_scaled.png b/docs/img/documentation_images/detect_discs/discs_mask_scaled.png new file mode 100644 index 000000000..357fc236a Binary files /dev/null and b/docs/img/documentation_images/detect_discs/discs_mask_scaled.png differ diff --git a/docs/img/documentation_images/detect_discs/discs_pre_scaled.png b/docs/img/documentation_images/detect_discs/discs_pre_scaled.png new file mode 100644 index 000000000..e6dcf3e2f Binary files /dev/null and b/docs/img/documentation_images/detect_discs/discs_pre_scaled.png differ diff --git a/docs/img/documentation_images/watershed/watershed-labels.png b/docs/img/documentation_images/watershed/watershed-labels.png new file mode 100644 index 000000000..f016a0937 Binary files /dev/null and b/docs/img/documentation_images/watershed/watershed-labels.png differ diff --git a/docs/output_measurements.md b/docs/output_measurements.md index f15c0016d..92dde927b 100644 --- a/docs/output_measurements.md +++ b/docs/output_measurements.md @@ -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. diff --git a/docs/transform_affine_color_correction.md b/docs/transform_affine_color_correction.md index 6320e64af..3ccfb5b11 100644 --- a/docs/transform_affine_color_correction.md +++ b/docs/transform_affine_color_correction.md @@ -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** diff --git a/docs/transform_detect_color_card.md b/docs/transform_detect_color_card.md index e57d34744..0bc669979 100644 --- a/docs/transform_detect_color_card.md +++ b/docs/transform_detect_color_card.md @@ -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) @@ -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'] ``` diff --git a/docs/tutorials.md b/docs/tutorials.md index 71e95958c..3d199c9da 100644 --- a/docs/tutorials.md +++ b/docs/tutorials.md @@ -278,6 +278,19 @@ + +
+ + Interactive Seed Count tutorial + +
+
Interactive Seed Count Tutorial
+
+
+ Tags: seed, seed analysis, human-in-the-loop, RGB, seed count, camilina +
+
+