darrenlafreniere / lafarren-image-completer

Implementation of the research titled: "Image Completion Using Efficient Belief Propagation via Priority Scheduling and Dynamic Pruning"
http://www.lafarren.com/image-completer/
GNU General Public License v3.0
32 stars 18 forks source link

Energy sum normalization #61

Open daviddoria opened 13 years ago

daviddoria commented 13 years ago

I don't see a normalization for how many pixels were unknown in the sum of squared differences calculation. I.e. if both patches are entirely known and, say they are constant valued patches, every pixel is 1 different from its corresponding pixel, the energy would be N (the number of pixels). If one of the patches has half of its pixels unknown, the energy would be N/2, but the patches are equally as "similar" to each other. Should the energy be divided by the number of known pixels that were compared?

darrenlafreniere commented 13 years ago

Patches are made entirely of known pixels.

darrenlafreniere commented 13 years ago

Rather, labels are made entirely of known pixels. Only when comparing a label against the input image directly might a patch have unknown pixels. This is handled by the masking in the calculator itself.

daviddoria commented 13 years ago

Ok, I'm getting there.

Could PolicyMaskA be renamed PolicyBoundary and PolicyNoMask be renamed PolicyInterior?

darrenlafreniere commented 13 years ago

Hmm, not sure I understand those names. Can you clarify?

daviddoria commented 13 years ago

If I've understood your recent explanations correctly:

1) A label consists of only known pixels. 2) The PolicyNoMask is used when comparing labels to labels, which is done on the interior of the region to fill. 3) Likewise, the PolicyMaskA is used when comparing a label to some of the known region, which I was calling the "boundary" of the region to fill.

So the choice of these policies is exclusively decided by whether or not we are totally inside the region to fill (comparing two unknown patches) or if we are on the boundary of the hole to fill (comparing a partially known patch to an unknown patch/label).

Is that more clear? (and I suppose is it correct?)

I'm mostly just concerned that PolicyMaskA is very non-descriptive.

darrenlafreniere commented 13 years ago

PolicyNoMask is used when comparing labels to labels for the purposes of message sending, when comparing a node's labels with a neighboring node's labels, even for a node on a boundary. Maybe that's incorrect, I'll have to check the paper later.