Reputation: 71
Can someone please explain to me what would the following line do?
bgr = img[:,:,:3]
Upvotes: 0
Views: 60
Reputation: 5659
What you want to look for here is "slicing" and "indexing". Have a look on those links:
Basically, img
is a 3-dimensional array and you are selecting all elements of axis "0" and "1", but only the first 3 elements ([0,1,2]
)of axes "2".
Upvotes: 4