How delete channel in image opencv
img1.shape
variable returns height, width, channel of your current image.
How i can delete on first image the value 3?
3
refers to BGR channel in your image.
(I assume you read the image using cv2.imread
)
You can convert to the gray-scale by
img1 = cv2.cvtColor(img1, cv2.COLOR_BGR2GRAY)
Now print(img1.shape)
and result will be:
(31, 27)