pmneila / PyMaxflow

Python library for creating flow networks and computing the maxflow/mincut (aka graph-cuts for Python)
http://pmneila.github.io/PyMaxflow/
246 stars 59 forks source link

Tutorial for maxflow.fastmin #67

Open Cq5616 opened 6 days ago

Cq5616 commented 6 days ago

I am trying to solve a multi-label problem using the alpha-expansion move algorithm implemented in maxflow.fastmin.aexpansion_grid(D, V, max_cycles=None, labels=None) I didn't quite understand the definitions of arrays D and V.

For instance, If i have a 5*5 grid and consider 4 labels, what should the sizes of D and V be? It would really help if you had a tutorial or an example on this function. Thank you so much!! image