-1

I wish to understand a piece of code that I have seen in python.

enter image description here

in my particular case, face is a list and when the code is executed x is 739 y is 229 w is 232 h is 349

image is a numpy.ndarray, I wanted to understand how the slicing of image is acctually working... which part of the image is acctually being selected?

I cant understand how the slicing is working

1 Answers1

0

To slice a multi-dimensional array, you specify a standard slicing range (with up to 3 arguments seperated by :) for each dimension, and seperate the ranges with a ,.

In this example, the array is sliced in the range of y up to y + h on one dimension, and x to x + w on the other.

read this if for more examples

LITzman
  • 730
  • 1
  • 16