nppiGraphCut image segmentation - data/smoothness term modeling problem

Hi all,

I’ve been trying to use a good cost function for segmenting retinal layers using nppiGraphCut, so I’ve explored the following data term equations:

dataterm using probability (i.e. histogram) of background and foreground.
smoothness term using:
diffterm=-(temp_img(fromx(i), fromy(i)) - temp_img(tox(i), toy(i)))^2;
bottom(tox(i), toy(i))= 255exp(diffterm/(2sigma*sigma));

And I also tried to use the cost function in Sina Farisu’s paper.

Can someone direct me to a paper that explains good modeling cost function for accurate segmentation of boundaries?