I am working on a project to realize virtual makeup. I have a problem implementing the eyeliner part.
How should I change the alpha value(alpha_s, alpha_l)? in Python?
I want to adjust the alpha value so that the eyeliner on the face image may not be visible, it may look blurry, or I want to see it clearly.
Face image source is YouTube '뽐뽐뽐' (Apink's Bomi)
Below is python code, height and width of face, img are the same.
face = cv2.imread('./image/ex1.png')
img = cv2.imread('./result_3.png',-1) ## It is shaped like a left eyeliner and has a transparent background.
x_offset = y_offset = 0
alpha_s = img[:, :, 3] / 255.0
alpha_l = 1.0 - alpha_s
for c in range(0, 3):
face[y_offset:y_offset+img.shape[0], x_offset:x_offset+img.shape[1], c] = \
(alpha_s * img[:, :, c] + alpha_l * face[y_offset:y_offset+img.shape[0],
x_offset:x_offset+img.shape[1], c])
cv2.imshow('result', face)
cv2.waitKey(0)
cv2.destroyAllWindows()
'result_3.png' image looks like this.-> enter image description here
Some of the code result images(left eye) -> enter image description here
Please help me.