新增双目yolo实现python代码

This commit is contained in:
keita
2026-09-14 15:05:03 +08:00
parent 538ae4c6c7
commit 3a8e2c7f4b
65 changed files with 2467 additions and 10 deletions
+16
View File
@@ -0,0 +1,16 @@
"""side-by-side 单流裁切(需求说明 §2.3:同帧拼接形态推荐优先支持)。
解码一次、裁切为左右图,天然同曝光、天然同帧;宽须为偶数。
"""
from typing import Tuple
import numpy as np
def split_sbs(image: np.ndarray) -> Tuple[np.ndarray, np.ndarray]:
"""左右各半裁切,返回 (左图, 右图)。"""
if image.ndim < 2 or image.shape[1] % 2 != 0:
raise ValueError(f"side-by-side 图像宽度须为偶数,实际 shape={image.shape}")
half = int(image.shape[1] // 2)
return image[:, :half].copy(), image[:, half:].copy()