Point cloud files (.ply) from EasyDCP_Creation step
GIMP, Photoshop or equivalent software
Known height of container (mm) or ground offset height.
- GIMP or equivalent software.
- Source image files from image acquisition
Use GIMP to create training data:
See example fore.png and back.png in \example\training_data\
.
- Use Free Select Tool to select plant parts only - Use a representative sample. Maybe 3 different plants is enough to represent them all e.g. one light green, one dark green, different light conditions, etc.
- Deselect "Antialiasing" in Free Select settings pane
- Select "'1. Pixel (3 x 3)" in Brushes tab
- Copy the selection and create a new file, PNG with transparency
- Under Advanced Options in "Create a New Image" dialog, select Fill with: Transparency
- Save as "fore.png"
- Repeat steps 1-3 with background samples and save as "back.png"
- Folder containing .ply point cloud files output by previous step, EasyDCP_Creation
- See example
ply
folder in step 5 of EasyDCP_Creation
- See example
- training data created in previous step: "(a) Setup"
- Python script to control EasyDCP_Analysis package,
example/analysis.py
Control EasyDCP_Analysis via API using python script in your python 3 environment as described in Installation.
We have provided analysis.py
in \example\
as a starter script to control EasyDCP_Analysis. Most users should be able to run analysis.py
with very little modification. To do: Complete API documentation for details on controlling EasyDCP_Analysis via python.
name | description |
---|---|
easydcp.Classifier() |
Create a Classifier object using training data |
easydcp.Plot() |
Create a Plot object using input .ply file and Classifier object. |
easydcp.Plot.remove_noise() |
Filter out noise points on Plot object. |
easydcp.Plot.dbscan_segment() |
Run segmentation using DBSCAN algorithm. |
easydcp.Plot.kmeans_split() |
Separate plant point clouds and noise point clouds by point number. |
easydcp.Plot.rank_split() |
Alternative to kmeans_split . Discard noise point clouds by passing known numer of plants as a parameter. |
easydcp.Plot.sort_order() |
Sort Plant ID in order of increasing x-axis of plant center. Needed when using dbscan_segment or kmeans_split . |
easydcp.Plot.xaxis_segment() |
Alternative to dbscan_segment . Segment the Plot object into plants by passing the number of segments (plants) as a parameter. This function assumes plants are of approximately equal size and evenly spaced. |
easydcp.Plot.get_traits() |
Calculate traits for all segments (plants) within the Plot object. |
Key Parameters:
name | default | affects | notes | |
---|---|---|---|---|
percentile |
98 | plant height | adjust parameter in line 718 of base.py , __init__() :self.get_percentile_height(container_ht, ground_ht, percentile=95) 98 should give a near-maximum plant height in most cases. For a measurement closer to the true maximum plant height (highest plant point), increase to 99 , 99.5 , etc. A lower-quality point cloud (e.g., produced from an image set with low overlap or resolution, or low settings used by EasyDCP_Creation) may contain some noise points above the true plant top and could cause overestimation bias. In this case, consider decreasing to 95 or 90 . |
|
eps_points |
10 | segmentation | Set parameter when calling dbscan_segment Higher value may be used if segmentation fails, such as one plant being wrongly divided into two segments. In such case, we recommend trying 12 ,13 ,14 . Higher eps_points value will increase processing time significantly. |
- Configure EasyDCP_Analysis before launching:
- Ensure your .py script points to correct training data and point clouds. Ensure
container_ht
is correctly set. - Training data is called aslist
inClassifier()
function,path_list
parameter. Vegetation file must be listed before background file. - Point clouds are loaded byplot_path
andplot_set
variables - Setplot_path
to the folder containing .ply files from EasyDCP_Creation step 5. - Important! Use/
in your file path, not\
-container_ht
parameter is passed withinget_traits()
function. Default:0.12
(meters, 12 cm)- Ensure to
import __init__
beforeimport easydcp
. This is already done inanalysis.py
.
import __init__ import easydcp as dcp
- Ensure to
- Execute your .py script using python, with EasyDCP root folder as working directory:
-
Using Anaconda, open a terminal and navigate to your EasyDCP folder: `cd D:\Program\EasyDCP``
(easydcp37) D:\Program\EasyDCP>python example\analysis.py
- Outputs will be saved in the EasyDCP directory.
- A folder will be created in the EasyDCP directory for each .ply file processed by EasyDCP. It will contain several intermediary .ply files (output by the classification, remove noise and segmentation steps) and a .png file is for each
Plant
object measured by the calculation step. The .png file contains an image of the plant point cloud, and visualization of phenotypic traits. - A folder called
data_out
will be created in the EasyDCP directory. It will contain:- Segmentation results. Each input .ply file will have a corresponding .png image file, showing an overhead view of the plant points and their segmentation results. (See Figure 1)
traits.csv
, containing per-plant traits and metadata. This file can be read by a variety of softwares including Excel and R and used for data analysis. (See Figure 2)
- The output locations may be adjusted using parameters of their respective functions, except the intermediary .ply files which can only be disabled via the
write_ply
parameter.
- A folder will be created in the EasyDCP directory for each .ply file processed by EasyDCP. It will contain several intermediary .ply files (output by the classification, remove noise and segmentation steps) and a .png file is for each
We strongly recommend to move your output data out of the EasyDCP directory. Data loss may occur when re-running the script, as folders will be re-created in the working directory, and may overwrite previous output folders.
Figure 1: Segmentation results
Figure 2: Traits