Coordinates for region of interest

face_section = frame[y-offset:y+h+offset,x-offset:x+w+offset]

to find the region of interest in the frame captured from the webcam, why do we specify the ‘y’ coordinate first?

Assume the face section as follows, where i have mentioned the row number and column number,
0 1 2 3 4 5
0 _ _ _ _ _ _
1 _ _ _ _ _ _
2 _ _ _ _ X _
3 _ _ _ _ _ _
4 _ _ _ _ _ _

You have to locate the point X, so its y coordinate would be 2 and x coordinate would be 4, but treating this as a 2-D matrix if you want to reach at that point you need to use, img_name[2][4], and therefore y coordinate needs to be specified first as it depicts row number and x coordinate afterwards which signifies column number.

Hope this cleared your doubt :blush:

1 Like

Thanks :slight_smile:

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.