【发布时间】:2019-11-28 19:10:38
【问题描述】:
我正在尝试将图像拆分为B,G,R,但拆分后,每个 B G 和 R 都有灰度图像。
import cv2
import numpy as np
image = cv2.imread('/path/image.jpg') #I have tried using CV_LOAD_IMAGE_COLOR flag as well as 1
#however,image is read as color image. It is not a grayscale image
b,g,r = cv2.split(image)
#[b,g,r]=np.dsplit(image,image.shape[-1])
#b,g,r = cv2.split(image)
#b = image[:,:,0]
#g = image[:,:,1]
#r = image[:,:,2]
#none of the above worked
cv2.imshow("green",g)
cv2.waitKey(0)
cv2.destroyAllWindows()
请帮我将图像拆分为 BGR。我什至尝试过使用不同的图像。
【问题讨论】: