Skip to content
Python implement of Total Variation Image Segmentation
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc
images
.gitignore
CutUI.py
GraphMaker.py
GraphMaker_kmeans.py
LICENSE
README.md
demo.py
notes.pdf
utils.py

README.md

TV_Segmentation

This is an implement of binary image segmentation based on total variation. For more details in algorithm, please see in here.

Dependencies

Python3.x (Tested with 3.5)
opencv
PyQt4
scikit-learn

Installation

To use this code, please do:

  1. Clone the repo:

    git clone https://github.com/jfzhang95/TV_Segmentation
    cd TV_Segmentation
  2. Install dependencies:

    pip install opencv matplotlib scikit-learn pyqt4
  3. To try the demo code, please run:

    python demo.py

If installed correctly, the result should look like this: results

Usage

Note that in demo.py, we only use very simple unary term. More advanced unary terms are implemented in GraphMaker.py and GraphMaker_kmeans.py, they need user input to build prior knowledge. CutUI.py is a GUI implemented for User Interactivation.

The primal dual total variation optimization method is implemented in utils.py

License

MIT

You can’t perform that action at this time.