diff --git a/photo_review/photo_review.py b/photo_review/photo_review.py index 51ed6e3..afbf6d3 100644 --- a/photo_review/photo_review.py +++ b/photo_review/photo_review.py @@ -2,6 +2,7 @@ import json import logging import math import os +import pdb import sys import tempfile import time @@ -55,6 +56,7 @@ def split_image(img_path, max_ratio=2.82, best_ration=1.41, overlap=0.05): split_result = [] # 打开图片 img = open_image(img_path) + pdb.set_trace() # 获取图片的宽度和高度 height, width = img.shape[:2] # 计算宽高比 diff --git a/test.py b/test.py deleted file mode 100644 index bbc6e03..0000000 --- a/test.py +++ /dev/null @@ -1,15 +0,0 @@ -import urllib.request - -import cv2 -import numpy as np - -if __name__ == '__main__': - # 发送HTTP请求并获取图像数据 - resp = urllib.request.urlopen("http://drg100.cn-sh2.ufileos.com/PH20240529000194_1_075936_1.PNG?UCloudPublicKey=4Z7QYI7qml36QRjcCjKrls7aHl1R6H6uq&Signature=iy2o2yJqJ8jJVoR71qxAIy2wuD4%3D&Expires=1719008836") - # 将数据读取为字节流 - image_data = resp.read() - # 将字节流转换为NumPy数组 - image_np = np.frombuffer(image_data, np.uint8) - # 解码NumPy数组为OpenCV图像格式 - image = cv2.imdecode(image_np, cv2.IMREAD_COLOR) - cv2.imwrite("test.png", image)