dongchangxi 6 months ago
parent
commit
5a95811433
  1. 4
      apps/auto_convert3d_new.py
  2. 9
      apps/white_purification_v3.py

4
apps/auto_convert3d_new.py

@ -3,7 +3,7 @@ import os, oss2, time, redis, requests, shutil, sys, subprocess, json, platform
from PIL import Image, ImageDraw, ImageFont from PIL import Image, ImageDraw, ImageFont
from retrying import retry from retrying import retry
import atexit,platform import atexit,platform
import white_purification_v2,white_purification import white_purification_v3,white_purification
if platform.system() == 'Windows': if platform.system() == 'Windows':
sys.path.append('e:\\libs\\') sys.path.append('e:\\libs\\')
import common import common
@ -152,7 +152,7 @@ def team_check(r):
imagePath = os.path.join(workdir, 'print', pid,pid+"Tex1.jpg") imagePath = os.path.join(workdir, 'print', pid,pid+"Tex1.jpg")
print("开始处理白色提纯") print("开始处理白色提纯")
#white_purification.white_purification_utils(imagePath) #white_purification.white_purification_utils(imagePath)
os.system(f'python D:\\make2\\apps\white_purification_v2.py -i {imagePath}') os.system(f'python D:\\make2\\apps\white_purification_v3.py -i {imagePath}')
print("贴图文件白色提纯完成",imagePath) print("贴图文件白色提纯完成",imagePath)
#提纯完重新上传提纯图片 #提纯完重新上传提纯图片

9
apps/white_purification_v3.py

@ -124,13 +124,17 @@ def correct_texture_image(input_path,image_result_dir,output_path):
} }
image_cache_dir= os.path.join(image_result_dir,"cache") image_cache_dir= os.path.join(image_result_dir,"cache")
os.makedirs(image_cache_dir, exist_ok=True) os.makedirs(image_cache_dir, exist_ok=True)
image_light_down_fix_up_path = remove_gray_and_sharpening(input_path, image_cache_dir) out_put_path = os.path.join(image_cache_dir, image_name)
shadow_up_path = out_put_path.replace(".jpg", "_shadow_up.jpg")
photoshop_actions_emulation(input_path, shadow_up_path)
image_light_down_fix_up_path = remove_gray_and_sharpening(shadow_up_path, image_cache_dir)
output_light_up_path = image_light_down_fix_up_path.replace(".jpg", "_light_down.jpg") output_light_up_path = image_light_down_fix_up_path.replace(".jpg", "_light_down.jpg")
process_image(image_light_down_fix_up_path, output_light_up_path, **params) process_image(image_light_down_fix_up_path, output_light_up_path, **params)
output_result_image_path=correct_light_again_hsv(output_light_up_path) output_result_image_path=correct_light_again_hsv(output_light_up_path)
shutil.copy(output_result_image_path,output_path) shutil.copy(output_result_image_path,output_path)
time.sleep(1) time.sleep(1)
try: try:
os.remove(shadow_up_path)
os.remove(image_light_down_fix_up_path) os.remove(image_light_down_fix_up_path)
os.remove(output_light_up_path) os.remove(output_light_up_path)
os.remove(output_result_image_path) os.remove(output_result_image_path)
@ -153,5 +157,4 @@ if __name__ == "__main__":
print(f"处理成功,耗时 {total_time} 秒,") print(f"处理成功,耗时 {total_time} 秒,")
""" """
1暗部提亮->白色提纯(220)->高光压暗->二次亮度调整 1暗部提亮->白色提纯(220)->高光压暗->二次亮度调整
""" """
Loading…
Cancel
Save