新增双目yolo实现python代码
This commit is contained in:
@@ -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()
|
||||
Reference in New Issue
Block a user