Identification of people crossing borders

It can be judged  according to one side of the line segment of the center point of the human body , as shown in the figure above.

The slope of a line segment can be expressed as:

 up and down as out of bounds direction

 

 Comparing center_y with temp_y, you can get whether the person crosses the boundary up or down.

Take left and right as the out-of-bounds direction

 

Comparing center_x with temp_x, you can get whether the person crosses the border left or right.

 

Guess you like

Origin blog.csdn.net/qq_36076110/article/details/130851080