BradLarson / GPUImage

An open source iOS framework for GPU-based image and video processing
http://www.sunsetlakesoftware.com/2012/02/12/introducing-gpuimage-framework
BSD 3-Clause "New" or "Revised" License
20.25k stars 4.61k forks source link

GPUImagePoissonBlendFilter: no mask? #2275

Open rawmean opened 8 years ago

rawmean commented 8 years ago

Poisson Blending usually has three inputs: source image, target image and a mask that indicates where the source image is to be blended with the target image.

GPUImagePoissonBlendFilter does not take a mask as input. How do I specify a mask?

erickingxu commented 8 years ago

Why need three inputs? target image is also mask one in gpu shader processing....

rawmean commented 8 years ago

The third input would be a binary mask that specifies the region in the target image that the source image needs to be blended in (as described in the paper). Having looked at the code more carefully, I think the mask is assumed to be the alpha channel of the image.

BradLarson commented 8 years ago

This filter was contributed by someone else, and I have no idea how it works. You'll have to ask them.

rawmean commented 8 years ago

I understand what the code does now. It’s using an iterative approach to solve the Poisson equation which is relatively slow and doesn’t have good convergence properties. The proper way to solve it is using DFT. OpenCV has a good implementation of it (seamlessCloning())

On Jun 8, 2016, at 9:44 AM, Brad Larson notifications@github.com wrote:

This filter was contributed by someone else, and I have no idea how it works. You'll have to ask them.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/BradLarson/GPUImage/issues/2275#issuecomment-224651831, or mute the thread https://github.com/notifications/unsubscribe/ABOjryasGVpAcLwKViVz5Ay-SUrlMCjEks5qJvFVgaJpZM4ITIuy.