Advanced algorithm design and analysis course assignment The idea of maximum flow and minimum cut set is used to segment the image
require python 3.8
All dependencies are enlisted in requirements.txt
pip install -r requirements.txt
Note:
Extension need not be png
Runtime Commands
fast_seg.py The main code used to produce the segmentation results. command-line arguments
- -i / --img : -i
- -a / --algo : values “bk”/”ff”
- “bk” - used to perform segmentation using boykov kolmogorov algorithm
- “ff” - used to perform segmentation using ford fulkerson algorithm
Example: python fast_seg.py -i ./images/bunny.png -a bk
The Marking process can be roughly marked, only need to draw some lines.
- Press the "o" key on your keyboard to start marking an object.
- Press the "b" key on your keyboard to start marking the background.
- When you have finished marking, press the esc key on your keyboard.