- install necessary libraries
pip install -r requirements.txt- Print the calibration file and scan before each leaf scanning You can modify the markers_list.json to customise the cultivars scanned.
cd markers
python generate_markers.py -o <output dir> -j <json filepath>- Prepare a directory with the leaf scans, and a separate directory for the calibration scans. See ./data/leaves and ./data/calibration for an example.
- Set the area to crop out in data/calibration.yaml
python crop_and_threshold.py -d ./data/leaves -o ./data- Run calibration with the calibration dir to create calib.txt
python calibration_board_one_dir.py \
-c ./data/calibration \
-o ./data \
--calib_fp data/calibration.yaml- (optional) Run vegetation masks. You can manually correct this mask if required.
mkdir ./data/vis_vm
python generate_veg_mask.py \
--img_dir ./data/leaves \
--calib_fp ./data/calibration.yaml \
--out_dir ./data/vis_vm- Process leaves images to obtain leaf areas
python process_images.py -d data/leaves --is_vis --vm_dir ./data/vis_vm/labeller/semanticsYou may need to adjust the tracker configuration in ./data/tracker_hyps.cfg to match your setup.
By adding the --is_vis flag, you can check the visualisation of the tracker in ./data/test_dbg and ./data/vis_frame.
- Check the leaf area csv (la.csv) We encode further information in the csv as follows:
- stddev=-1 means long leaf, so no repeated measurements for stddev calculations
- stddev=-2 means the leaf could not be fully seen (e.g. was placed too high or low in camera FOV)