import numpy as np
import cv2
colors = cv2.applyColorMap(np.array([0, 63, 127, 191, 255], dtype=np.uint8), cv2.COLORMAP_PARULA)
print('shape', colors.shape)
opencv-python 4.x got shape (5, 1, 3)
# pip list | grep -e cv -e numpy
numpy 2.4.6
opencv-python 4.13.0.92
Python version 3.11.9
opencv-python 5.x got shape (1, 5, 3)
# pip list | grep -e cv -e numpy
numpy 2.4.6
opencv-python 5.0.0.93
Python version 3.11.9
opencv-python 4.x got
shape (5, 1, 3)opencv-python 5.x got
shape (1, 5, 3)