ranger101
ranger101

Reputation: 1194

Finding Mincuts / max flow for a graph

I have generated a graph from an image and the algorithm I am working on demands finding the min cut in the graph. But as per my understanding some nodes - source and sink, needs to be attached to the graph before applying any standard algorithm for finding the same.On what basis should I attach them and where??....I have done lot of reading on this but none specifies about this.

thanks.

Upvotes: 2

Views: 418

Answers (1)

alexisrozhkov
alexisrozhkov

Reputation: 1632

I am not sure what have you read, but usually authors clearly specify what should be treated as source and sink.

Consider binary segmentation. (image taken from here, more information can also be found there) enter image description here

O and B stand for object and background respectively, so you can think of correspondence between terminals and labels.

To clarify further:

  • image pixels are represented by nodes
  • links can be of 2 types - terminal links and neighbour links
  • terminal links have a cost that shows how similar are nodes(pixels) to terminal(label model)
  • neighbour links show how nodes(pixels) are similar to nodes(pixels), that are connected with this link.

This is only one example of applying graph cut to images, there are more: multi-level segmentation, depthmap estimation, etc, where nodes and edges may have different meanings. I strongly suggest you to get more familiar with literature first, since it will help you to adapt the approaches you want to use to your needs.

Upvotes: 2

Related Questions