Version 7, 10-31-23
Develop a model to measure leaf morphometrics from photos taken outside in field books and test if accuracy is comparable to images taken in a photo booth.
Measure height, width, leaf area, serration count, and leaflet count. Once accuracy is found to be acceptable, experiment with other morphometrics such as individual leaflet widths.
Leaf morphometrics tools uses packages that can be installed by package manager Anaconda to accomplish analyses. For questions or help with Anaconda, read the following: Getting started with conda — conda 23.9.1.dev37 documentation
- Create and activate a conda environment using leaf_morphometrics_tools:
- This is best accomplished through Mamba rather than Conda, as Mamba is much quicker. If installing Mamba is difficult, conda works fine, just slower. Miniconda/Minimamba works as well and can save room on your local computer.
- Conda: Installation — Anaconda documentation
- Mamba: Installation — documentation
- If using mamba, replace all ‘conda’ calls in your prompt with ‘mamba’
- Once Conda/Mamba/Miniconda/Minimamba is installed and operational, type the following to create the environment to create the environment:
- This is best accomplished through Mamba rather than Conda, as Mamba is much quicker. If installing Mamba is difficult, conda works fine, just slower. Miniconda/Minimamba works as well and can save room on your local computer.
conda env create -f /my/path/to/leaf_morphometrics_tools/leaf_morphometrics_tools.yml
replace /my/path/to/ with the path to leaf_morphometrics_tools/leaf_mophometrics_tools.yml on your local computer
- Type the following to activate the leaf_morphometrics_tools environment:
- conda activate leaf_morphometrics-env
- The pipeline was made to use parallel computing to be run over a folder that includes all images taken within a study. To accomplish this, run the following from the command line prompt:
python /my/path/to/leaf_morphometrics_tools/leaf_morphoV6_12x16.py
To use the pipeline for 12x12in templates type the following:
python /my/path/to/leaf_morphometrics_tools/leaf_morphoV6_12x12.py
- Entering the above code into a command line prompt will spawn a guided intro for running the pipeline over a collection of images.
- An image with the word ‘calibrate’ in the filename is required for each pool of images. This image calibrates the expected pixels per inch in every image, helping to ID the red size markers on templates in various lighting conditions. This image should be of a blank template (no leaves), in good lighting, and should be taken by the camera the observer intends to use to capture images.
- Examples of calibrate image filenames:
- calibrate.jpg
- NY1234_calibrate.jpg
- calibrate_IA999.png
- 1234_SC_calibrate.nef
- Examples of calibrate image filenames:
Leaf morphometrics tools can take a variety of optional arguments for running leaf analyses. Most of these are requested for input in the guided intro, but can be manually input following the Python call:
-h, --help show this help message and exit
-i INPUT_DIR, --input_dir INPUT_DIR
Path to input directory of images to be analyzed.
-t TOOLS_DIR, --tools_dir TOOLS_DIR
Path to leaf_morpho_tools file.
-o OUTPUT_DIR, --output_dir OUTPUT_DIR
Path to output directory for resulting images.
-r RESULTS_PATH, --results_path RESULTS_PATH
Desired path and file name for results.
-w WORKERS, --workers WORKERS
Number of worker processes to use, if nothing is
specified half of all available workers will be used.
python /my/path/to/leaf_morphometrics_tools/leaf_morphoV7.py -i /my/path/to/inputImages -t my/path/to/leaf_morpho_tools -o /my/path/to/imageOutput -r /my/path/to/theseAreMyResults.csv -w 12
python /my/path/to/leaf_morphometrics_tools/leaf_morphoV7.py -h