Skip to content

Commit

Permalink
style: rgba reminder
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeyi-Lin committed Sep 14, 2024
1 parent 10c2703 commit d5a2728
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion hivision/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,13 @@ def add_background(input_image, bgr=(0, 0, 0), mode="pure_color"):
:return: output: 合成好的输出图像
"""
height, width = input_image.shape[0], input_image.shape[1]
b, g, r, a = cv2.split(input_image)
try:
b, g, r, a = cv2.split(input_image)
except ValueError:
raise ValueError(
"The input image must have 4 channels. 输入图像必须有4个通道,即透明图像。"
)

a_cal = a / 255
if mode == "pure_color":
# 纯色填充
Expand Down

0 comments on commit d5a2728

Please sign in to comment.