feat(新功能): fix(修复bug): : refactor(重构): test(增加测试):
This commit is contained in:
@@ -35,7 +35,7 @@ class PrintPainting:
|
|||||||
result['gray'] = cv2.resize(result['gray'], (new_width, new_height))
|
result['gray'] = cv2.resize(result['gray'], (new_width, new_height))
|
||||||
|
|
||||||
if overall_print['print_path_list']:
|
if overall_print['print_path_list']:
|
||||||
overall_print['location'][0] = [x * y for x, y in zip(overall_print['location'][0], result['resize_scale'])]
|
overall_print['location'][0] = [x * y for x, y in zip(overall_print['location'][0], result['resize_scale'])]
|
||||||
painting_dict = {'dim_image_h': result['pattern_image'].shape[0], 'dim_image_w': result['pattern_image'].shape[1]}
|
painting_dict = {'dim_image_h': result['pattern_image'].shape[0], 'dim_image_w': result['pattern_image'].shape[1]}
|
||||||
result['print_image'] = result['pattern_image']
|
result['print_image'] = result['pattern_image']
|
||||||
if "print_angle_list" in overall_print.keys() and overall_print['print_angle_list'][0] != 0:
|
if "print_angle_list" in overall_print.keys() and overall_print['print_angle_list'][0] != 0:
|
||||||
@@ -151,11 +151,7 @@ class PrintPainting:
|
|||||||
img_bg = cv2.bitwise_and(result['pattern_image'], result['pattern_image'], mask=cv2.bitwise_not(print_mask))
|
img_bg = cv2.bitwise_and(result['pattern_image'], result['pattern_image'], mask=cv2.bitwise_not(print_mask))
|
||||||
mask_mo = np.expand_dims(print_mask, axis=2).repeat(3, axis=2)
|
mask_mo = np.expand_dims(print_mask, axis=2).repeat(3, axis=2)
|
||||||
gray_mo = np.expand_dims(result['gray'], axis=2).repeat(3, axis=2)
|
gray_mo = np.expand_dims(result['gray'], axis=2).repeat(3, axis=2)
|
||||||
# img_fg = (img_fg * (mask_mo / 255) * (gray_mo / 255)).astype(np.uint8)
|
img_fg = (img_fg * (mask_mo / 255) * (gray_mo / 255)).astype(np.uint8) # 当sketch 图像为灰色时(非纯白) , 印花*灰度图像会导致印花在sketch上颜色变暗
|
||||||
# img_fg = (img_fg * (gray_mo / 255)).astype(np.uint8) # 只保留gray影响 - 无效
|
|
||||||
img_fg = (img_fg * (mask_mo / 255) * (1.5 * gray_mo / 255)).astype(np.uint8) # 增加系数权重,减轻变暗效果
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
result['final_image'] = cv2.add(img_bg, img_fg)
|
result['final_image'] = cv2.add(img_bg, img_fg)
|
||||||
canvas = np.full_like(result['final_image'], 255)
|
canvas = np.full_like(result['final_image'], 255)
|
||||||
|
|||||||
Reference in New Issue
Block a user