How does [...,::-1] work in slice notation?
The slice operator works as with 3 params. Start(inclusive), end(exclusive) and step.
If start is not specified then it gets the start of the array, same with the end but with the last element. If step not specified the default is 1.
This way, if you do [1, 2, 3, 4][0:2] it will return [1, 2]
If you do [1, 2, 3, 4][1:] it will return [2, 3, 4]
If you do [1, 2, 3, 4][1::2] it will return [2, 4]
For negative indexes, that means iterate backwards so [1, 2, 3, 4][::-1] says, from the starting element until the last element iterate the list backwards 1 element at a time, returning [4, 3, 2, 1].
As the question is not entirely clear I hope this clears up the functioning and make you get to an answer.
OpenCV uses BGR encoding, and img[...,::-1] swaps the red and blue axes of img for when an image needs to be in the more common RGB. I've been using it for several months now but still don't understand how it works.