如何在hstacking后将ndarray切片,恢复为原始片段

问题描述 投票:0回答:1

嗨,我想恢复通过堆叠两个较小的数组而制成的两个复合numpy数组。我需要为每一个香料切片,我可以帮助我。

我有两个彼此堆叠的ndarrays

frame = np.hstack([thought1,pix])

pix和Thought1的形状等于(1080,1920,3)为他们两个

框架的堆叠形状为(1080,3840,3)我想通过切片从帧中恢复Thought1和pix它

frame = np.hstack([thought1,pix])
python numpy slice
1个回答
0
投票

np.hstack的'inverse'为np.hsplit

thought1, pix = np.hsplit(np.hstack([thought1,pix]), [thought1.shape[1]])
© www.soinside.com 2019 - 2024. All rights reserved.