How to obtain an image's single colour channel without using the split function in OpenCV Python?
问题 I'd like to highlight a hand for real-time gesture recognition. I observed that the image of a hand gets highlighted differently for different colour channels using the cv2.imsplit function. But this split function is very costly in terms of time. I'm not able to perform the same functionality using Numpy indexing (as given on the official page) 回答1: You can use numpy's slice: import cv2 import numpy as np ## read image as np.ndarray in BGR order img = cv2.imread("test.png") ## use OpenCV