stacker.combine_frames#
- combine_frames(frames_A, frames_B)[source]#
Combines two 2D numpy arrays (frames_A and frames_B) into a single array.
This function takes two 2D numpy arrays of the same shape and combines them into a new array. The upper triangular part (excluding the diagonal) of the resulting array is filled with the corresponding elements from frames_A, while the lower triangular part (including the diagonal) is filled with the corresponding elements from frames_B.
- Parameters:
- frames_Anumpy.ndarray
A 2D numpy array.
- frames_Bnumpy.ndarray
A 2D numpy array of the same shape as frames_A.
- Returns:
- numpy.ndarray
A new 2D numpy array with combined elements from frames_A and frames_B.
Examples
>>> import stacker as st >>> import numpy as np >>> frames_A = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) >>> frames_B = np.array([[9, 8, 7], [6, 5, 4], [3, 2, 1]]) >>> st.combine_frames(frames_A, frames_B) array([[9., 2., 3.], [6., 5., 6.],
[3., 2., 1.]])