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

Bug: Only known pixels should be averaged during scaling #50

Closed daviddoria closed 13 years ago

daviddoria commented 13 years ago

(Please find images mentioned below here: http://www.rpi.edu/~doriad/Upload/bug/)

1) Original input file = catDepth.png 2) Mask file = mask.png 3) I filled the image using ImageCompleter -ii catDepth.png -im mask.png -io catDepthFilled.png -sp auto

4) I replaced the pixels under the mask in catDepth.png with 255 and called it catDepthMasked.png 5) I then ran ImageCompleter -ii catDepthMasked.png -im mask.png -io catDepthMaskedFilled.png -sp auto

Things to check for sanity: 1) That I changed only masked pixels in the input images

Things to check for the bug: 1) Is the masked pixel being used in the blending? Or in the filling? Perhaps making the blending optional first and retrying this demo would be a good idea. If the results are different with blending off, then the problem is with the filling.

darrenlafreniere commented 13 years ago

Possibly related to:

https://github.com/darrenlafreniere/lafarren-image-completer/issues/#issue/48

darrenlafreniere commented 13 years ago

I wonder if this is related to -sp auto. When the completer is in-place scaling down an image, it always collapses 2x2 pixel blocks down to 1x1 for the lower resolution, regardless of whether the pixel is masked at the higher resolution.

daviddoria commented 13 years ago

Confirmed by Darren - fix should be to only average pixels which are known during scaling.

darrenlafreniere commented 13 years ago

Fixed, https://github.com/darrenlafreniere/lafarren-image-completer/commit/b346efbf77d239f238c9347000c62a5c52ce92f3