Skip to main content
edited body
Source Link
Ahmad Raji
  • 528
  • 2
  • 12

To stack the array into shape (n_image, width, height), you need np.dstackvstack. Check out https://numpy.org/doc/stable/reference/generated/numpy.dstack.htmlhttps://numpy.org/doc/stable/reference/generated/numpy.vstack.html

For 3 bands image e.g RGB you get shape (3,width,height).

Note: width and height must be equal in all arrays.

To stack the array into shape (n_image, width, height), you need np.dstack. Check out https://numpy.org/doc/stable/reference/generated/numpy.dstack.html

For 3 bands image e.g RGB you get shape (3,width,height).

Note: width and height must be equal in all arrays.

To stack the array into shape (n_image, width, height), you need np.vstack. Check out https://numpy.org/doc/stable/reference/generated/numpy.vstack.html

For 3 bands image e.g RGB you get shape (3,width,height).

Note: width and height must be equal in all arrays.

Source Link
Ahmad Raji
  • 528
  • 2
  • 12

To stack the array into shape (n_image, width, height), you need np.dstack. Check out https://numpy.org/doc/stable/reference/generated/numpy.dstack.html

For 3 bands image e.g RGB you get shape (3,width,height).

Note: width and height must be equal in all arrays.