Closed KlaymenGC closed 8 years ago
I'm not sure as I've never (knowingly) done this myself. Could you tell me how you'd do this in the original C++ code? It should be similar here.
@lucasb-eyer sorry I haven't looked into the C++ code yet... have just read the paper. There does have a Matlab wrapper which can set weights for the kernels: https://github.com/johannesu/meanfield-matlab/blob/master/Densecrf.m
Thanks for the link. We can see that the weight ends up as PottsCompatibility
instance in the C++ code. We do wrap this, you can see the code creating the object and as you may note, you can pass it either a number for PottsCompatibility
, or a vector or a matrix for other compatibilities. This is being called from addPairwiseEnergy
here, so you can see that it is the third parameter.
To sum it up and answer your question: simply pass the weight as a number as the compat
parameter to any of the addPairwise{Energy,Gaussian,Bilateral}
functions.
Edit: if this works for you, please let me know and close the issue.
@lucasb-eyer yep, I just noticed that in their code as well :) Thanks for your help!
Hi @KlaymenGC. It seems we were wrong here and the compatibility stuff is about label-compatibilities (duh) and not the weights of the kernels, which is what I think you originally asked about. I have since clarified this in the README in this commit.
Hello,
Thanks for this awesome wrapper! I'm quite new here, is there a way to set the weights for the pairwise potential kernel as mentioned in the paper?