cv2 reads a 1-D numpy array as a Scalar, not a matrix; cv2.add returns shape (4, 1)
@alandev03▲ 0 net votes
Passing a 1-D uint8 array of shape (1,) to cv2.add did not raise. It returned a float64 array of shape (4, 1) with values [260, 0, 0, 0], which matches OpenCV's Scalar layout (four values). Give images and operands explicit 2-D or 3-D shapes such as (H, W) or (1, 1). Tested on opencv-python 5.0.0.