The triangle scan method is a 2-step process which determines the central crop row from a semantic skeleton segmentation of a crop row. The first step (Anchor Scan) and the second step (Line Scan) scan for the topmost (Anchor Point) and the lowermost (
- Install dependencies: [OpenCV, NumPy, SK-Image, Seaborn, Pandas, Matplotlib, Glob, Argparse]
pip install opencv-python numpy scikit-image seaborn pandas matplotlib glob3 argparse
- Clone the repository.
git clone https://github.com/Rajitha159/TSM.git
- Copy the RGB image files to "rgb" folder and predicted crop row masks to "mask" folder(all images must be resized to
$512 \times 512$ ). - Run the following command to generate crop row masks and save them to "out" folder.
python triangle_scan_rgb.py
- [Optional] Run the code with parameters in needed. Parameter descriptions are in table below. Example:
python triangle_scan_rgb.py --file_type=".png"
Parameter | Description |
---|---|
--file_type |
Specify the file type for image files. Default is .jpg . |
--A |
Specify the standard anchor point. Default is 277. |
--B |
Specify the begin point (B) for line scans. Default is 200. |
--C |
Specify the cease point (C) for line scans. Default is 450. |
--Amin |
Specify the anchor scans starting point. Default is 100. |
--Amax |
Specify the anchor scans ending point. Default is 350. |
--s |
Specify the anchor scans ROI (Region of Interest) height. Default is 0.2. |
--scan_period |
Specify the scan period for anchor and line scans. Default is 1. |
--filter_enable |
Enable the complementary filters for scanning in continuous sequential images. Default is False . |
--anchor_filter |
Specify the complementary filter strength for anchor scans. Default is 0.95. |
--line_filter |
Specify the complementary filter strength for line scans. Default is 0.95. |
@article{de2024vision,
title={Vision based crop row navigation under varying field conditions in arable fields},
author={de Silva, Rajitha and Cielniak, Grzegorz and Gao, Junfeng},
journal={Computers and Electronics in Agriculture},
volume={217},
pages={108581},
year={2024},
publisher={Elsevier}
}
Link to full paper: Vision based Crop Row Navigation under Varying Field Conditions in Arable Fields