numpy.empty(shape, dtype=float, ...) -> arr
numpy.zeros(shape, dtype=float, ...) -> arr
numpy.ones(shape, dtype=None, ...) -> arr
numpy.full(shape, fill_value, dtype=None, ...) -> arr
img1 = np.empty((240, 320), dtype=np.uint8) # grayscale image
img2 = np.zeros((240, 320, 3), dtype=np.uint8) # color image
img3 = np.ones((240, 320), dtype=np.uint8) * 255 # white
img4 = np.full((240, 320, 3), (0, 255, 255), dtype=np.uint8) # yellow
img1 = cv2.imread('HappyFish.jpg')
# 얕은 복사
img2 = img1
# 깊은 복사
img3 = img1.copy()
# 같은 이미지
cv2.imshow('img1', img1)
cv2.imshow('img2', img2)
cv2.imshow('img3', img3)
-----------------------------------------------------
img1[:, :, :] = 255
# 1, 2 빈 이미지 3 원본 이미지
cv2.imshow('img1', img1)
cv2.imshow('img2', img2)
cv2.imshow('img3', img3)
Reference
1) 제로베이스 데이터스쿨 강의자료