Firstly apologies for the poorly worded title but didn't know how else to word it. I am new to python and opencv and am trying to make sense of some basic face detection code. There is one part of code that I am struggling to understand (perhaps lack of experience with python). The code is as follows:
eyes = eye_cascade.detectMultiScale(roi_gray,scaleFactor=1.2, minNeighbors=5, minSize=(10, 10))
for (ex, ey, ew, eh) in eyes:
cv2.rectangle(roi_color, (ex, ey), (ex+ew, ey+eh), (0,255,0), 2)
The part I'm struggling to understand is how the for loop knows that ex, ey, ew and eh are the 4 corners of the rectangle? It feels to me like you should at least be saying:
for(ex,ey,ew,eh) in eyes.coordinates
or something similar so it at least knows what to loop through. Sorry for my ignorance, any help is appreciated.