diff --git a/app/core/config.py b/app/core/config.py index a01a2c0..73ac0d1 100644 --- a/app/core/config.py +++ b/app/core/config.py @@ -30,14 +30,14 @@ else: CATEGORY_PATH = "app/service/attribute/config/descriptor/category/category_dis.csv" # FACE_CLASSIFIER = 'app/service/generate_image/utils/haarcascade_frontalface_alt.xml' -# RABBITMQ_ENV = "" # 生产环境 +RABBITMQ_ENV = "" # 生产环境 # RABBITMQ_ENV = "-dev" # 开发环境 -RABBITMQ_ENV = "-local" # 本地测试环境 +# RABBITMQ_ENV = "-local" # 本地测试环境 settings = Settings() # minio 配置 -MINIO_URL = "www.minio.aida.com.hk:9000" +MINIO_URL = "www.minio.aida.com.hk:12024" MINIO_ACCESS = 'vXKFLSJkYeEq2DrSZvkB' MINIO_SECRET = 'uKTZT3x7C43WvPN9QTc99DiRkwddWZrG9Uh3JVlR' MINIO_SECURE = True diff --git a/app/service/generate_image/utils/adjust_contrast.py b/app/service/generate_image/utils/adjust_contrast.py index 2af8969..4ed110e 100644 --- a/app/service/generate_image/utils/adjust_contrast.py +++ b/app/service/generate_image/utils/adjust_contrast.py @@ -1,13 +1,14 @@ import cv2 - def adjust_contrast(image, alpha=1.5, beta=-60): """ 调整图像的对比度和亮度。 + 参数: image_path (numpy): 图像的路径。 alpha (float): 控制对比度的系数。alpha > 1 增加对比度,alpha < 1 减少对比度。 beta (int): 用于调整亮度的值,可以是正或负。 + 返回: adjusted_image (ndarray): 调整对比度后的图像。 """ @@ -18,13 +19,13 @@ def adjust_contrast(image, alpha=1.5, beta=-60): # 使用示例 if __name__ == "__main__": - image = cv2.imread('output_6.png') # 替换为你的图片路径 + image = cv2.imread('output_6.png') # 替换为你的图片路径 img_rgb = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) - alpha = 1.5 # 对比度系数,大于1增加对比度 + alpha = 1.5 # 对比度系数,大于1增加对比度 beta = -60 # 亮度调整,这里设置为0,不改变亮度 # 调整图像对比度 result_image = adjust_contrast(image, alpha, beta) - # 可以选择保存调整后的图像 - cv2.imwrite('adjusted_image.jpg', result_image) # 保存调整后的图片 + # 可以选择保存调整后的图像 + cv2.imwrite('adjusted_image.jpg', result_image) # 保存调整后的图片 \ No newline at end of file diff --git a/app/service/generate_image/utils/image_processing.py b/app/service/generate_image/utils/image_processing.py index 07bfd8f..dd64ace 100644 --- a/app/service/generate_image/utils/image_processing.py +++ b/app/service/generate_image/utils/image_processing.py @@ -214,7 +214,6 @@ def stain_detection(image, user_id, category, tasks_id, spot_size=100): logger.info("中心区域存在连续的纯白区域") is_pure_white = True else: - logger.info("中心区域不存在连续的纯白区域") is_pure_white = False if is_pure_white: