curation & gather
This commit is contained in:
@@ -161,7 +161,7 @@ async def process_video(video_path, timestamps, video_name):
|
||||
|
||||
code_crop = frame[min_y:max_y, min_x:max_x]
|
||||
code_path = os.path.join(out_dir, f"code_{t_sec:04d}s.jpg")
|
||||
cv2.imwrite(code_path, code_crop)
|
||||
Image.fromarray(cv2.cvtColor(code_crop, cv2.COLOR_BGR2RGB)).save(code_path)
|
||||
markdown_lines.append(f"\n*Saved code image: {code_path}*")
|
||||
|
||||
# Find non-text visual content (e.g. diagrams) outside the text area
|
||||
@@ -183,7 +183,7 @@ async def process_video(video_path, timestamps, video_name):
|
||||
if bw > 100 and bh > 100: # large enough
|
||||
visual_crop = frame[max(0, by-pad):min(frame.shape[0], by+bh+pad), max(0, bx-pad):min(frame.shape[1], bx+bw+pad)]
|
||||
visual_path = os.path.join(out_dir, f"visual_{t_sec:04d}s.jpg")
|
||||
cv2.imwrite(visual_path, visual_crop)
|
||||
Image.fromarray(cv2.cvtColor(visual_crop, cv2.COLOR_BGR2RGB)).save(visual_path)
|
||||
markdown_lines.append(f"\n*Saved non-text visual: {visual_path}*")
|
||||
|
||||
markdown_lines.append("\n---\n")
|
||||
|
||||
Reference in New Issue
Block a user