Newer
Older
<!--
<p align="center">
<img src="https://github.com///raw/main/docs/source/logo.png" height="150">
</p>
-->
<h1 align="center">
</h1>
## 💪 Getting Started
Compute fcover from 4P phenoscript output and using a DL model
## 🚀 Installation
#### Install from git:
```bash
pip install git+https://forgemia.inra.fr/ue-apc/modules/vegetationcoverfraction
```
#### Installation in development mode:
```bash
git clone https://forgemia.inra.fr/ue-apc/modules/vegetationcoverfraction
cd vegetationcoverfraction
pip install .
```
#### Command Line Interface
vegetationcoverfraction have a CLI writting with [Typer](https://typer.tiangolo.com/). The command to call in shell is fcover_rgb_drone. Call help to have all options:
WARNING: If you change the cli.py script you have to reinstall vegetationcoverfraction to see the update the CLI typer application.
## 👐 Contributing
To ask for a modificatioins, bug fix or improvement proposal please add an issue on the project if you have access rights or contact maintainers:
* Jordan Bernigaud Samatan (jordan.bernigaud-samatan@inrae.fr).
## Authors
* Jordan Bernigaud Samatan (Jordan Bernigaud Samatan)
### ⚖️ License
The code in this package is licensed under the MIT License.
# Method
## Global segmentation
We perform vegetation (including weed) segmentation via deep learning and using VegAnn model.

## Remove out of ranks
The post processing RemoveOutofRanks (required : number of ranks to find) works according to the following steps
### Detect lines in binary mask
We use the Hough transfor to infer the ranks localisation.

We then extract the median angle of all lines and rotate the image so the lines are horizontal if it's not the case.
### Get rank width
Project mask on y axis, perform smoothing of the signal, perform background removal and peak extraction. For peak extraction we keep peaks that have value >= 0.5 * max peak (tunable parameter)



We then estimate the width of the rank as the width corresponding to 0.8 * peak height (this parameter is tunable).
Finally the width is multiplied by 1 (tunable parameter).
We finally obtain the ranks bands

which is then combined to the semantic mask.
Here we use voluntarily a very hard and contaminated plot.
But on an easier image :
