亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

將具有透明背景的圖像混合到普通圖像(非透明背景)后,如何調整 alpha 值?

將具有透明背景的圖像混合到普通圖像(非透明背景)后,如何調整 alpha 值?

慕俠2389804 2023-04-18 16:12:56
我正在做一個實現虛擬化妝的項目。我在實施眼線筆部分時遇到問題。我應該如何更改 alpha 值(alpha_s,alpha_l)?在 Python 中?我想調整 alpha 值,使人臉圖像上的眼線可能不可見,可能看起來模糊,或者我想看清楚。面部圖像來源是 YouTube 'Bom Bom Bom Bom'(Apink 的 Bomi)下面是python代碼,人臉的高度和寬度,img是一樣的。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 = 0alpha_s = img[:, :, 3] / 255.0alpha_l = 1.0 - alpha_sfor 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”圖像看起來像這樣。->在此處輸入圖像描述部分代碼結果圖片(左眼)-> enter image description here請幫我。
查看完整描述

目前暫無任何回答

  • 0 回答
  • 0 關注
  • 71 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號