This commit is contained in:
2024-05-26 12:12:15 +08:00
parent 17709c1a0b
commit 941a86d07a
23 changed files with 994 additions and 738 deletions
Binary file not shown.
+1 -1
View File
@@ -11,7 +11,7 @@ import shotSplit
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
# sys.argv = ["C:\\Users\\27698\\Desktop\\LAITool\\resources\\scripts\\Lai.exe","-c","C:/Users/27698/Desktop/测试/123/scripts/output_crop_00001.json"]
sys.argv = ["C:\\Users\\27698\\Desktop\\LAITool\\resources\\scripts\\Lai.exe","-c","C:/Users/27698/Desktop/测试/mjTest/scripts/output_crop_00001.json"]
print(sys.argv)
if len(sys.argv) < 2:
+6 -2
View File
@@ -174,6 +174,7 @@ class ImageToVideo:
# 计算偏移变化率
offset_change_per_frame = float(end_offset - start_offset) / total_frames
current_offset = start_offset
scale = img_resized.shape[0] / video_size[1]
for _ in range(int(duration * fps)):
# 创建一个空白画布
@@ -194,13 +195,15 @@ class ImageToVideo:
# 安全检查,确保不会复制超出边界的区域
src_x1 = max(-start_x, 0)
dst_x1 = max(start_x, 0)
copy_height = min(img_resized.shape[0] - src_x1, video_size[1] - dst_x1)
copy_width = min(img_resized.shape[1] - src_x1, video_size[0] - dst_x1)
# copy_width = min(video_size[0], img_resized.shape[1])
# 调整图片复制区域的计算
src_y1 = max(-start_y, 0)
dst_y1 = max(start_y, 0)
copy_width = min(img_resized.shape[1] - src_y1, video_size[0] - dst_y1)
copy_height = min(img_resized.shape[0] - src_y1, video_size[1] - dst_y1)
# copy_width = min(copy_width, img_resized.shape[1])
if copy_height > 0 and copy_width > 0:
canvas[dst_y1 : dst_y1 + copy_height, dst_x1 : dst_x1 + copy_width] = (
@@ -238,6 +241,7 @@ class ImageToVideo:
# 计算偏移变化率
offset_change_per_frame = float(end_offset - start_offset) / total_frames
current_offset = start_offset
scale = img_resized.shape[1] / video_size[0]
for _ in range(int(duration * fps)):
# 创建一个空白画布