Can someone please explain to me what would the following line do?
bgr = img[:,:,:3]
Can someone please explain to me what would the following line do?
bgr = img[:,:,:3]
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".