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
  • 80,138
  • 16
  • 128
  • 173
Zee Jan
  • 39
  • 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