How do we draw rectangles in face recognition video?

In the face recognition video , prateek bhaiya said that faceCascade.detectMultiScale returns the tuples containing following values ( x_coordinate,y_coordinate,width,height) here the x and y coordinates are of the top left most points and when we draw a rectangle we must pass into the function the coordinates of top-leftmost point and bottom right most point.
Now x,y from detectMultiscale gives us top leftmost points to get bottom rightmost points we need to do (x+w,y-h) but in the video it is done as (x+w,y+h) and it is also giving the correct boundary . Now, I don’t know why this is happening ?

Hey Anshu.

Suppose there is a rectangle frame window, where the video is streaming.
Basically you are taking the bottom left point of frame as the 0 coordinate, like we use to do in Maths geometry. But here the case is bit different. the 0 coordinate here is topleft corner in frame window. I hope now got the statement (x+w, y+h) why we did this for getting the opposite point.

1 Like