1

I am following a tutorial to implement YoloV4 in the implementation the author has used this:

cv2.imread(os.path.join(self.folder_path, img_path))[:, :, ::-1]

Whats the point of the indexing at the end?

Bill Lynch
  • 76,897
  • 15
  • 123
  • 168
Zee Jan
  • 29
  • 4
  • 3
    Do these answer your question? https://stackoverflow.com/questions/14517101/what-does-extended-slice-syntax-actually-do-for-negative-steps, https://stackoverflow.com/questions/509211/understanding-slice-notation – jtbandes Feb 22 '22 at 00:07
  • 1
    In this specific case, it's swapping between RGB and BGR order for the three components of each pixel. – jasonharper Feb 22 '22 at 00:58

0 Answers0