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

Absorb PolicyMaskA into PolicyMask? #59

Open daviddoria opened 13 years ago

daviddoria commented 13 years ago

There was originally a PolicyMask superclass because there was a PolicyMaskA and a PolicyMaskB. PolicyMaskB was removed because it was never used (why is this?). I suppose it depends on the answer to the previous question, but would it make sense to simply have one class called PolicyMask?

Also, what is the idea of OnPreLoop and OnARow?

daviddoria commented 13 years ago

Since there is only a PolicyMaskA, does this mean that masked pixels in patch B are being compared to their corresponding pixel in patch A? No masked pixels should every be compared right? Because of that, I actually don't understand why there is ever a non-masked policy used?

darrenlafreniere commented 13 years ago

If the classes are absorbed, they should be absorbed into a class called PolicyMaskA.

If you search that file for OnPreLoop and OnARow you should get a sense for what they do (let the policy prepare data). If there's still a OnBRow, it can be removed.

Patch Bs are always overlaid on patch A, which may have a mask. IIRC, the mask is used when overlaying patches onto the masked input image for testing against the known data, but not when overlaying neighbor patches for determining messages.

daviddoria commented 13 years ago

So are patch B's always completely known? I.e. are patch B's always source patches? and are source patches always completely valid?

Should there be an assert to ensure unknown pixels are never compared?

There is an OnBRow, but it look like it's only definitions are {}