0

I receive the error in the title when trying to import certain images. All images are .PNG, however, some work while others don't. I understand that this is due to the third parameter in shape. What does the third parameter represent?

I have been looking in the cv2 shape documentation and can not find it.

Community
  • 1
  • 1
HARV mackie
  • 123
  • 1
  • 13
  • The third parameter is the number of channels in the image (this first two number are height and width). For example, a RGB image of size 400x400 would have a img.shape = 400,400,3. A grayscale image of the same size would have a img.shape = 400,400,1. – Stephen Meschke Jan 11 '19 at 01:55
  • Are you aware of a method for increasing the number of channels by one on exported images? – HARV mackie Jan 11 '19 at 02:01
  • https://stackoverflow.com/questions/13451936/opencv-transforming-3-channel-image-into-4-channel Found it – HARV mackie Jan 11 '19 at 02:02

0 Answers0