lucasb-eyer / pydensecrf

Python wrapper to Philipp Krähenbühl's dense (fully connected) CRFs with gaussian edge potentials.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Kernel Weights

ctensmeyer opened this issue · comments

I have an idea on how kernel weights might be set in the code. You have a note on the README asking for explanations.

In the 2011 paper (Eq. 2), the label compatibility matrix appears outside the sum over kernel responses. However, both the addPairwiseGaussian() and addPairwiseBilateral() functions in the code accept an arbitrary label compatibility matrix. By controlling the relative magnitude of the matrices, you can effectively set the kernel weights.

Based on your understanding of Philipp's code, is this correct?

Thanks @waldol1!

I don't have the time to actually try it out currently, but your idea sounds very reasonable. I have added a link to this issue from the README so that people who want to investigate this further will see your reasoning.