College students' bodies are damaged due to the pressure of school work and daily life habits such as frequent internet surfing, low exercise intensity and low frequency of exercise, which affect their study and life. In order to strengthen students' exercise, many schools have arranged students for running. However, there are still some students who do not participate in sports and avoid running sports through various illegal means. To address the above problems, an OpenCV-based pedestrian flow detection system for playground entrances and exits is proposed to enhance the monitoring of sports numbers in schools, thus alleviating the problem of college students avoiding sports by means of violations.