| In recent years,the education of our country has developed rapidly and the number of classrooms in colleges and universities has continued to increase.Due to the use of open management,the phenomenon of permanent lights often appears in college classrooms which resulting in a lot of energy waste.In response to the national call for energy conservation and emission reduction,many college classrooms have installed infrared pyroelectric sensors to detect human targets and control the opening and closing of lamps,which has achieved significant energy-saving effects.However,due to the limitations of the infrared pyroelectric sensor itself,it is greatly affected by the ambient temperature,the missed detection rate is high and the detection time is long,which is not ideal for lighting control.In order to increase the accuracy of human target detection,shorten the detection time,and reduce unnecessary waste of electricity for classroom lighting in colleges and universities,this paper uses image detection algorithms to detect human targets in the classroom.The main research work is as follows:First,determine the human target recognition method,by comparing and analyzing three common human moving target detection algorithms,the inter-frame difference method is selected to detect human target in the classroom,and the determination times of the inter-frame difference are determined through actual tests;Secondly,the lamp control scheme is designed,which mainly includes camera image acquisition,image data processing,human target recognition,and environmental illuminance recognition;Thirdly,the lamp control node,host computer,communication mode between the host computer and the lamp control node are designed.In the light control node,an infrared pyroelectric sensor is used to detect whether a human target enters the detection area.The OV7670 camera module is used and the lens with a suitable field of view angle is selected to collect the images in the detection area.We adopt the DMA mode in the DCMI interface of the processor STM32F4 to reads the image data collected by the camera,and the pingpong double buffer mode is adopted in the process of reading the image data.Moreover,the processor STM32F4 executes the inter-frame difference algorithm to determine whether the human target has left.The illumination change of the light control node is used to reflect the illumination change of the desktop,obtain the upper and lower thresholds of the illuminance of the lamp opening and closing,the opening and closing of the lamp is controlled by the presence or absence of human objects in the lamp area and the illuminance in the lamp area.The upper computer is transplanted with the μC/OSIII operating system,and STem Win is used to design a human-computer interaction interface for the upper computer.Through the upper computer,the operating mode of the light control node can be switched and the information of the light control node can be viewed.The Zig Bee module is used to complete the network communication between the light control node and the host computer;Finally,the actual test of the whole system shows that compared with the traditional infrared pyroelectric sensor detection method,the missed detection rate of human target detection is greatly reduced,the determination time is greatly shortened,and the energy saving effect is achieved,and it can be applied to the lighting control of university classrooms. |