问题来源:最近使用ZED拍摄图片,在使用官方SDK中的ZED Explorer时发现保存的图片是将左右眼的图像保存为左右并列的一张图片,处理时需要两张单独的图片,因此写了个简单的分割程序,以供参考。
"""
split zed camera image to left image and right image.
eg: img[0:h, 0:w, : ] --> leftimg[0:h, 0:int(w/2), : ] and rightimg[0:h, int(w/2+1):w, : ].
"""
import cv2
import os
if __name__ == "__main__":
path = "E:\ZED\\1228" # change this dirpath.
listdir = os.listdir(path)
newdir = os.path.join(path,