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

two problems. #22

Closed
PapaMadeleine2022 opened this issue Apr 17, 2020 · 3 comments
Closed

two problems. #22

PapaMadeleine2022 opened this issue Apr 17, 2020 · 3 comments

Comments

@PapaMadeleine2022
Copy link

PapaMadeleine2022 commented Apr 17, 2020

  1. I do not understand why we need to erode the mask for dst_points here .

2.Without other op , simplely using seamlessClone op for blending two face image like cv2.seamlessClone(src_img, dst_img, src_mask, center, cv2.NORMAL_CLONE), I test 3 cases:

a) When I use all white mask for src_mask, there will be some white bright parts on the some edges of result face.
b) When I use the same-sized face white mask of src_img for src_mask, there will be some bigger white bright parts on the some edges of result face.
c) When I use the eroded face white mask of src_img for src_mask, there will be some black parts on the some edges of result face.

I can not find the causes and can not fix it. Can you give some advises?

Thanks.
Looking forward to your reply.

@wuhuikai
Copy link
Owner

  1. Smaller face brings better visual quality.
  2. Do you have any visual result?

@PapaMadeleine2022
Copy link
Author

@wuhuikai Thanks for your reply.

Got 1. For q2:

This a simple demo code:

import cv2
import numpy as np

ori_img = cv2.imread("xxx/ori_img1.png")
img2 = cv2.imread("xxx/img2.png")

# Poisson Blending
h, w = img2.shape[:2]
center = (102 + int(w / 2), 120 + int(h / 2))
face_mask = 255 * np.ones(img2.shape, img2.dtype)  # Create an all white mask
result = cv2.seamlessClone(img2, ori_img, face_mask, center, cv2.NORMAL_CLONE)

After poisson Blending, I find that there is a little white part on the upper right corner of result face.

ori_img.png
im2.png
result.png

@wuhuikai
Copy link
Owner

That's the issue of Poisson Image Editing, please try another blending algos such as drag and drop.

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

2 participants