Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improving mask edges #327

Open
jb-apps opened this issue Aug 24, 2021 · 0 comments
Open

Improving mask edges #327

jb-apps opened this issue Aug 24, 2021 · 0 comments

Comments

@jb-apps
Copy link

jb-apps commented Aug 24, 2021

Hi everyone 👋, amazing framework GPUImage!

I am very new to image processing, sorry if I mix up things.

I am working on a segmentation problem for macOS, I get a mask of size 320x320 that I need to scale up to the original image size then I can applied the mask against it.

The problem I am facing is when scaling up using Lanczos resampling I get very smooth edges in the scaled mask, then when getting the segmented image I can see the background, (this is very noticeable in the hair).

Original image Segmented image Small mask LanczosResampling
original image result small mask Scaled

For masking I am just doing:

let maskedImageRef = originalImageCGImage.masking(cgImageMask)
let maskedImage = NSImage(cgImage: maskedImageRef, size: size)
        
return maskedImage.drawImage()

Any advice on how can I improve make the edges?

Thank you! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant