Automatic control method, system, electronic equipment and medium for lighting lamp
Through head detection model and computer vision technology, the opening and brightness of lighting lamps are dynamically adjusted, which solves the high energy consumption problem of traditional lighting systems when personnel density changes, realizes intelligent energy-saving control of lighting lamps, and supports green ecology and sustainable development.
Patent Information
- Application Number
- CN202411288851.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-14
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-09-14
AI Technical Summary
Traditional lighting systems lack dynamic perception and intelligent regulation capabilities, resulting in high energy consumption in areas with few people or no need for high-brightness lighting, resulting in waste of power resources and violating the green ecological and sustainable development goals.
Using head detection model and computer vision technology, through image acquisition and processing, a heat map of personnel density is generated, combined with affine transformation and perspective correction technology, the population density in the area is determined, and the preset lighting switch control algorithm is used to dynamically adjust the lighting. On and brightness.
It realizes intelligent automation control of lighting, reduces power consumption, complies with the requirements of green ecology and sustainable development, and improves energy utilization efficiency.
Smart Images

Figure CN118829048B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision technology, and in particular to an automatic control method, system, electronic equipment and medium for lighting lamps. Background Art
[0002] In modern society, the use of building space is becoming increasingly diverse, the flow of people is frequent, and the lighting needs at different times and in different areas vary significantly. However, traditional lighting systems lack the ability to perceive and control such dynamics, resulting in unnecessary high energy consumption in areas where there are few people or high-brightness lighting is not required. This "one-size-fits-all" lighting strategy not only causes a huge waste of electricity resources, but also increases the environmental burden, which is contrary to the sustainable development goals of green ecology, energy conservation and emission reduction.
[0003] Therefore, the existing technology proposes a lighting optimization algorithm to adjust the parameters and power of lighting lamps. However, the existing lighting optimization algorithm ignores the limitations of changes in external demand when adjusting the parameters and power of lighting lamps. Traditional lighting systems often rely only on the adjustment of the parameters of the lighting lamps themselves, but fail to perform intelligent regulation based on the actual changes in the density of people, which leads to a waste of power resources and does not meet the requirements of green ecology and sustainable development. Summary of the invention
[0004] The purpose of the embodiments of the present invention is to provide an automatic control method, system, electronic device and medium for lighting lamps, so as to solve the technical problems existing in the above-mentioned prior art.
[0005] In order to achieve the above object, an embodiment of the present invention provides an automatic control method of a lighting lamp, comprising:
[0006] Collect images of different areas to be illuminated, and use the pre-trained head detection model to detect the heads of people in the images of different areas to be illuminated to obtain the position information of the head bounding box;
[0007] Based on the position information of the head bounding box, a heat map background of the center point of the head is generated, and the head heat map is grayed to obtain a grayscale head heat map;
[0008] Mapping the grayscale head heat map to a pre-divided chessboard seating map to determine the density distribution of people in different areas to be illuminated;
[0009] Based on the population density distribution in different areas to be illuminated and the cumulative time whether there are people in the areas to be illuminated, the preset lighting switch control algorithm is used to control the on and off status and brightness adjustment status of the lighting in different areas to be illuminated.
[0010] Optionally, the training process of the head detection model includes:
[0011] Obtain a head detection dataset SCUT-HEAD, where the head detection dataset SCUT-HEAD includes labeled bounding box information for indicating a position of a head in an image;
[0012] Preprocess the head detection dataset SCUT-HEAD into the format required by the YOLOv10 pre-training model;
[0013] Set training parameters, including learning rate, batch size, and number of training rounds;
[0014] The YOLOv10 pre-trained model is trained using the head detection dataset SCUT-HEAD to generate a head detection model.
[0015] Optionally, before performing image mapping of the grayscale head heat map onto a pre-divided chessboard-shaped seating map to determine the density distribution of people in different areas to be illuminated, the automatic control method of the lighting lamp further includes:
[0016] The distorted grayscale head heat map is corrected using affine transformation and perspective correction technology:
[0017] Taking three non-collinear calibration points in the grayscale head heat map, and determining the first coordinates of each non-collinear calibration point respectively;
[0018] Determine the second coordinate of each fixed point in the non-collinearity table in the image collector used for collecting images of different areas to be illuminated;
[0019] Based on the affine principle, determining the association relationship between the first coordinate and the second coordinate, and determining an affine transformation matrix;
[0020] The grayscale head heat map is affine transformed by using the affine transformation matrix to obtain a target grayscale head heat map, and a corresponding planar rectangular area is intercepted from the target grayscale head heat map to obtain a corrected target grayscale head heat map.
[0021] Optionally, the grayscale head heat map is image-mapped to a pre-divided chessboard-shaped seating map to determine the density distribution of people in different areas to be illuminated, including:
[0022] According to the pixel value of the seat number area in the area to be illuminated, the actual situation of whether each seat is occupied is mapped to a pre-divided chessboard seating diagram based on a mapping rule; wherein, the mapping rule is characterized in that if there is a head at the seat number, the pixel value is greater than zero, and if there is no head at the seat number, the pixel value is equal to zero.
[0023] Optionally, based on the distribution of population density in different areas to be illuminated, the number of people in the illumination area of each lamp, and the cumulative time of presence of people in the area to be illuminated, a preset lamp switch control algorithm is used to control the on and off states of lamps in different areas to be illuminated, including:
[0024] Based on the density distribution of people in different lighting areas and the cumulative time of presence of people in the lighting areas, the on and off states of the lighting in different lighting areas are controlled by using the preset lighting switch control algorithm, including:
[0025] The area to be illuminated is divided into M×N grids, the thermal map is intercepted, the thermal intensity value in each grid is counted, and an M×N array is obtained. The M×N array is binarized by comparing with a preset threshold to obtain a two-dimensional array F M×N , where if there is a head in the grid area, the value is 1, and if there is no head, the value is 0;
[0026] According to the number of lights K, define the three-dimensional array L M×N×K , where the elements Represents the maximum illumination value of the kth lighting in the M×N grid, and defines a one-dimensional array T K Used to store the opening time of K lighting lamps;
[0027] During the loop call of the control method, take the current personnel distribution matrix F M×N The intersection of the personnel distribution matrix in the historical time period is used as the distribution for control decision-making to characterize the basis for no personnel in the lighting area F' M×N ;
[0028] Compared with the distribution of the previous cycle, if the distribution at this moment changes, the lighting on and brightness are determined so that the brightness in the grid with people meets the lighting requirements and the energy consumption is the lowest. After adjusting the lighting on or brightness, the lighting on time value T is updated. K , otherwise, keep the current state unchanged and wait for the next cycle.
[0029] Optionally, during the loop call of the control method, the on and brightness of the lighting lamps are determined according to the following formula so that the brightness in the grid with people meets the lighting requirements and the energy consumption is minimized:
[0030] ;
[0031]
[0032] ;
[0033] In the formula, S kis the brightness adjustment ratio of the kth lighting fixture, that is, the ratio of the actual adjusted brightness to the rated brightness, S k Greater than or equal to 0 and less than or equal to 1. When determining the decision variable sk, consider the corresponding Tk value. If its value is greater than a certain threshold, it can be used as a decision variable; otherwise, it is used as a fixed variable and its value is the value set in the previous cycle. P k represents the rated power of the kth lighting lamp, Lux is the illumination setting value that meets health requirements, is the cumulative illumination value of K lamps at the mth row and nth column position, The personnel distribution matrix F is used for control decision making M×N The value of the element in the mth row and nth column of .
[0034] Optionally, the cumulative illumination value of the K lighting lamps at the position of the mth row and the nth column is determined according to the following formula:
[0035]
[0036] In the formula, K represents the number of lighting lamps, S k is the brightness adjustment ratio of the kth lighting fixture, S k Greater than or equal to 0 and less than or equal to 1, Represents the illuminance value at the mth row and nth column of the plane grid when the kth lighting lamp is at rated illuminance.
[0037] On the other hand, the present invention also provides an automatic control system for lighting lamps, comprising:
[0038] The acquisition unit is used to acquire images of different areas to be illuminated, and use a pre-trained head detection model to perform head detection on people in the images of different areas to be illuminated to obtain position information of head bounding boxes;
[0039] A grayscale processing unit, used to generate a head center point heat map background based on the position information of the head bounding box, and grayscale the head heat map to obtain a grayscale head heat map;
[0040] A mapping unit, used for performing image mapping of the grayscale head heat map to a pre-divided chessboard-shaped seating map to determine the density distribution of people in different areas to be illuminated;
[0041] The control unit is used to control the on and off state and brightness adjustment state of the lighting in different areas to be illuminated based on the population density distribution in different areas to be illuminated and the cumulative time whether there are people in the areas to be illuminated, using a preset lighting switch control algorithm.
[0042] On the other hand, the present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned method for automatic control of lighting lamps when executing the program.
[0043] On the other hand, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the above-mentioned method for automatically controlling a lighting lamp.
[0044] Through the above technical solution, the presence of people and their location information are detected in real time based on computer vision and corresponded to the corresponding lights. The designed algorithm is used to realize flexible control of the switching of lights and the accumulated time of no one present that needs to be referred to, thereby maximizing the energy saving of lights.
[0045] Other features and advantages of the embodiments of the present invention will be described in detail in the subsequent detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present invention, but do not constitute a limitation on the embodiments of the present invention. In the accompanying drawings:
[0047] Figure 1 is an implementation flow chart of an automatic control method for a lighting lamp provided by an embodiment of the present invention;
[0048] Figure 2 It is a schematic diagram of various stages of executing an automatic control method for a lighting lamp provided by an embodiment of the present invention;
[0049] Figure 3 It is a structural schematic diagram of an automatic control system for a lighting lamp provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0050] The specific implementation of the embodiment of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the embodiment of the present invention, and is not used to limit the embodiment of the present invention.
[0051] See also Figure 1 As shown, it is a flowchart of an implementation method of an automatic control method of a lighting lamp provided by an embodiment of the present invention, comprising the following execution steps:
[0052] Step 100: Collect images of different areas to be illuminated, and use a pre-trained head detection model to perform head detection on people in the images of different areas to be illuminated to obtain position information of head bounding boxes.
[0053] In some implementations, the training process of the head detection model includes:
[0054] Acquire a head detection dataset, where the head detection dataset includes labeled bounding box information for indicating a head position in an image;
[0055] Preprocess the head detection dataset into the format required by the YOLOv10 pre-trained model;
[0056] Set training parameters, including learning rate, batch size, and number of training rounds;
[0057] Use the head detection dataset to train the YOLOv10 pre-trained model to generate a head detection model.
[0058] The head detection dataset includes but is not limited to SCUT-HEAD or other datasets, which are not limited here.
[0059] Step 101: Based on the position information of the head bounding box, generate a head center point heat map background, and grayscale the head heat map to obtain a grayscale head heat map.
[0060] Specifically, after obtaining the head prediction frame inside the space, the center point of the prediction frame is used as the maximum pixel value point of the heat map, and the Gaussian kernel is used to generate the heat map background image and grayscale it.
[0061] In this way, accurate target detection of the number of people in different areas can be achieved, and a heat map of population density can be generated in real time, which can intuitively reflect the distribution and flow of population density in the space, providing strong data support for subsequent automatic control of lighting switches.
[0062] Step 102: Map the grayscale head heat map to a pre-divided chessboard seating diagram to determine the density distribution of people in different areas to be illuminated.
[0063] In some implementations, before executing step 102, the following steps are further performed to correct the distorted grayscale head heat map using affine transformation and perspective correction technology:
[0064] S1: Take three non-collinear calibration points in the grayscale head heat map, and determine the first coordinates of each non-collinear calibration point respectively.
[0065] S2: Determine the second coordinate of each fixed point in the non-collinearity table in the image collector used for acquiring images of different areas to be illuminated.
[0066] S3: Based on the affine principle, determine the correlation relationship between the first coordinate and the second coordinate, and determine the affine transformation matrix.
[0067] In some embodiments, three non-collinear markers (points) are taken as calibration points above the workstation and near the plane of the sitting head, and their plane coordinates are measured and calibrated. , i=1,2,3. Then find and measure its coordinates in the image in the camera ( ), according to the affine principle, the coordinates have the following relationship:
[0068]
[0069] Substituting the front and back coordinates of the three calibration points, the affine transformation matrix can be obtained:
[0070]
[0071] Subsequently, when the camera position angle remains unchanged, this matrix can be continuously used to perform affine transformation on the grayscale head heat map to obtain the image of the original coordinates, and the corresponding plane rectangular area can be intercepted from the transformed image (the rectangular image is transformed into a non-rectangular rectangle, but it contains a rectangle of the seat plane space, and the others are walls or ceilings, etc.) The perspective correction is similar to this, and ultimately the seat plane is determined.
[0072] S4: performing an affine transformation on the grayscale head heat map using the affine transformation matrix to obtain a target grayscale head heat map, and intercepting a corresponding planar rectangular area from the target grayscale head heat map to obtain a corrected target grayscale head heat map.
[0073] The perspective transformation and affine transformation techniques in image processing are used to correct the distorted fixed seat areas in the images taken by the camera, ensuring that the head heat map of each seat number captured by the camera can be accurately mapped to the regularly arranged seat model map within the area, thereby achieving accurate grasp of the presence of personnel at each workstation.
[0074] Specifically, when executing step 102, the following steps can be specifically performed: according to the pixel value of the seat number area in the area to be illuminated, the actual situation of whether each seat is occupied is mapped to a pre-divided chessboard seating diagram based on a mapping rule; wherein the mapping rule is characterized by that if there is a head at the seat number, the pixel value is greater than zero, and if there is no head at the seat number, the pixel value is equal to zero.
[0075] Step 103: Based on the density distribution of people in different areas to be illuminated and the cumulative time of presence of people in the areas to be illuminated, a preset lighting switch control algorithm is used to control the on and off states and brightness adjustment states of the lighting in different areas to be illuminated.
[0076] Specifically, when executing step 103, the following steps may be specifically performed:
[0077] S1030: Divide the area to be illuminated into M×N grids, intercept the thermal map, count the thermal intensity values in each grid, obtain an M×N array, and compare it with a preset threshold to obtain a binary processing of the M×N array to obtain a two-dimensional array F M×N , where the value is 1 if there is a head in the grid area and 0 if there is no head.
[0078] A value of 0 indicates that there is no person in the grid, and a value of 1 indicates that there is a person.
[0079] S1031: Define a three-dimensional array L according to the number of lighting lamps K M×N×K, The elements Represents the maximum illumination value of the kth lighting in the M×N grid, and defines a one-dimensional array T K Used to store the opening time of K lights.
[0080] S1032: During the loop call of the control method, the current personnel distribution matrix F is obtained. M×N The intersection of the personnel distribution matrix in the historical time period is used as the distribution for control decision-making to characterize the basis for no personnel in the lighting area F' M×N .
[0081] Specifically, the distribution of control decision is expressed as:
[0082]
[0083] In the formula, It represents the personnel distribution matrix when making the control decision at time i, and its elements are composed of the intersection of the corresponding position elements of the personnel distribution function in d+1 periods.
[0084] S1033: Compare with the distribution during the previous cycle. If the distribution at this moment changes, determine the lighting and brightness to ensure that the brightness in the grid with people meets the lighting requirements and the energy consumption is the lowest. After adjusting the lighting or brightness, update the lighting on time value T K , otherwise, keep the current state unchanged and wait for the next cycle.
[0085] The activation period of the control rule is represented by a specified time period, such as after get off work, which can be set according to the actual application scenario and is not limited here. K 0 means it is not turned on, 1 means it is turned on. At the same time, the lighting can receive signals from manual adjustments (switch or remote control). After adjustment, T is updated according to the same plan. K value.
[0086] In some embodiments, a timestamp two-dimensional array is defined to record the timestamp status of no person present within the lighting range of each lighting lamp. The initial value of the timestamp two-dimensional array is set to zero. When it is detected that no person is present within the lighting range and the corresponding timestamp is zero, T is set. K The value is the current timestamp, ensuring that the lighting is on at this time; when it is detected that there is no person present within the lighting range and the corresponding timestamp is not zero, calculate the current timestamp and T K If the difference is greater than the preset threshold, ensure that the lighting is turned off. K A value of zero ensures that the light is on at this time.
[0087] In some embodiments, the lighting and brightness of the lighting are determined during the loop call of the control method according to the following formula, so that the brightness in the grid with people meets the lighting requirements and the energy consumption is minimized:
[0088] ;
[0089] ;
[0090] ;
[0091] In the formula, S k is the brightness adjustment ratio of the kth lighting fixture, that is, the ratio of the actual adjusted brightness to the rated brightness, S k Greater than or equal to 0 and less than or equal to 1. When determining the decision variable sk, consider the corresponding Tk value. If its value is greater than a certain threshold, it can be used as a decision variable; otherwise, it is used as a fixed variable and its value is the value set in the previous cycle. P k represents the rated power of the kth lighting lamp, Lux is the illumination setting value that meets health requirements, is the cumulative illumination value of K lamps at the mth row and nth column position, The personnel distribution matrix F is used for control decision making M×N The value of the element in the mth row and nth column of .
[0092] Specifically, the cumulative illumination value of K lighting lamps at the position of the mth row and the nth column is determined according to the following formula:
[0093]
[0094] In the formula, K represents the number of lighting lamps, S k is the brightness adjustment ratio of the lighting lamp, S k Greater than or equal to 0 and less than or equal to 1, Represents the illuminance value at the mth row and nth column of the plane grid when the kth lighting lamp is at rated illuminance.
[0095] Based on the real-time updated occupancy density heat map in the standard seating model, it can intelligently analyze the occupancy density in different areas and automatically adjust the lighting switches accordingly. Specifically, when no one is present in a lighting area within 10 minutes, the lighting in that area will be automatically turned off. This automated lighting switch control strategy not only ensures the maximum lighting energy saving, but also effectively avoids unnecessary electricity waste, providing strong technical support for achieving efficient energy utilization and energy saving and emission reduction in modern buildings.
[0096] In some embodiments, when the control rules begin to be executed (such as after work), steps 1 to 4 are executed, where step 1 is head detection and location information acquisition, step 2 is heat map generation and grayscale processing, step 3 is image correction and personnel density distribution display, and step 4 is the automatic control algorithm for lighting switch. Steps 1 to 3 are executed regularly, such as every 10 minutes, to obtain the current personnel distribution. If the distribution remains unchanged and the lighting status remains unchanged (no manual adjustment), step 4 is skipped; if the distribution changes, step 4 is entered. To reduce discomfort, optionally, in the optimization target, only the lighting that has been adjusted for a certain cumulative time can be optimized. That is, the optimized S k A certain time threshold t must be met m >=T lim For example, 30 minutes or 600 seconds, that is, the opening time does not exceed T lim The lighting is not adjusted, and is taken as the current value during optimization calculation and remains unchanged. When all lamps are turned off or the brightness does not meet the video / image acquisition requirements, steps 1-4 are skipped directly.
[0097] In some embodiments, see Figure 2 As shown, it is a schematic diagram of each stage of executing an automatic control method of a lighting lamp provided by an embodiment of the present invention, wherein the area to be illuminated ( Figure 2 The first picture in the upper left corner) uses YOLOv10 head detection to mark the heads that appear in the area to be illuminated, and obtains the location information of the head bounding box ( Figure 2 The first picture in the upper right corner) generates a head heat map background based on the position information of the head bounding box ( Figure 2 The first picture in the lower right corner) uses perspective correction to correct the distorted image into a normal rectangular image and maps it to the standard seating map ( Figure 2 The first picture in the lower left corner), Figure 2 In the first picture on the lower left corner, the white dot represents a human head, and the small yellow square represents a light.
[0098] Through the above technical solution, the presence of people and their location information are detected in real time based on computer vision and corresponded to the corresponding lights. The designed algorithm is used to realize flexible control of the switching of lights and the accumulated time of no one present that needs to be referred to, thereby maximizing the energy saving of lights.
[0099] See also Figure 3 FIG. 1 is a schematic diagram of a structure of an automatic control system for a lighting lamp provided by an embodiment of the present invention, comprising:
[0100] The acquisition unit 30 is used to acquire images of different areas to be illuminated, and use a pre-trained head detection model to perform head detection on people in the images of different areas to be illuminated to obtain position information of head bounding boxes;
[0101] A grayscale processing unit 31 is used to generate a head center point heat map background based on the position information of the head bounding box, and grayscale the head heat map to obtain a grayscale head heat map;
[0102] A mapping unit 32 is used to map the grayscale head heat map to a pre-divided chessboard seating map to determine the density distribution of people in different areas to be illuminated;
[0103] The control unit 33 is used to control the on and off states and brightness adjustment states of the lights in different areas to be illuminated based on the population density distribution in different areas to be illuminated, the number of people in the lighting area of each light, and the cumulative time whether there are people in the area to be illuminated, using a preset light switch control algorithm.
[0104] On the other hand, an embodiment of the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the automatic control method of the lighting lamp described in any of the above embodiments are implemented.
[0105] On the one hand, an embodiment of the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the automatic control method of a lighting lamp described in any of the above embodiments are implemented.
[0106] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0107] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0108] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0109] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0110] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0111] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0112] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0113] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0114] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. An automatic control method for a lighting lamp, characterized in that: include: Collect images of different areas to be illuminated, and use the pre-trained head detection model to detect the heads of people in the images of different areas to be illuminated to obtain the position information of the head bounding box; Based on the position information of the head bounding box, a heat map background of the center point of the head is generated, and the head heat map is grayed to obtain a grayscale head heat map; Mapping the grayscale head heat map to a pre-divided chessboard seating map to determine the density distribution of people in different areas to be illuminated; Based on the density distribution of people in different areas to be illuminated and the cumulative time of presence of people in the areas to be illuminated, the on / off state and brightness adjustment state of the lights in different areas to be illuminated are controlled using a preset lighting switch control algorithm; Among them, based on the density distribution of people in different areas to be illuminated and the cumulative time of whether there are people in the areas to be illuminated, the on and off states of the lights in different areas to be illuminated are controlled by using a preset lighting switch control algorithm, including: The area to be illuminated is divided into M×N grids, the thermal map is intercepted, the thermal intensity value in each grid is counted, and an M×N array is obtained. The M×N array is binarized by comparing with the set threshold to obtain a two-dimensional array F M×N , where if there is a head in the grid area, the value is 1, and if there is no head, the value is 0; According to the number of lights K, define the three-dimensional array L M×N×K , where the elements Represents the maximum illumination value of the kth lighting in the M×N grid, and defines a one-dimensional array T K Used to store the opening time of K lighting lamps; During the loop call of the control method, take the current personnel distribution matrix F M×N The intersection of the personnel distribution matrix in the historical time period is used as the distribution for control decision-making to characterize whether there are personnel in the lighting area F' M×N ; Compared with the distribution of the previous cycle, if the distribution at this moment changes, the lighting is turned on and the brightness is determined so that the brightness in the grid with people meets the lighting requirements and the energy consumption is the lowest. After adjusting the lighting or brightness, the lighting is turned on and the lighting time value T is updated. K , otherwise, keep the current state unchanged and wait for the next cycle; According to the following formula, during the cycle call of the control method, the lighting and brightness are determined so that the brightness in the grid with people meets the lighting requirements and the energy consumption is minimized: ; ; In the formula, S k is the brightness adjustment ratio of the kth lighting lamp, that is, the ratio of the actual adjusted brightness to the rated brightness, S k Greater than or equal to 0 and less than or equal to 1. When determining the decision variable sk, consider the corresponding Tk value. If its value is greater than a certain threshold, it can be used as a decision variable; otherwise, it is used as a fixed variable and its value is the value set in the previous cycle. P k represents the rated power of the kth lighting lamp, L ux To set the illumination value to meet health requirements, is the cumulative illumination value of K lamps at the mth row and nth column position, To control the decision-making personnel distribution matrix F' M×N The value of the mth row and nth column; Determine the cumulative illumination value of K lamps at the mth row and nth column position according to the following formula: In the formula, K represents the number of lighting lamps, S k is the brightness adjustment ratio of the kth lighting fixture, S k Greater than or equal to 0 and less than or equal to 1, Represents the illuminance value at the mth row and nth column of the plane grid when the kth lighting lamp is at rated illuminance.
2. The automatic control method of the lighting lamp according to claim 1, characterized in that: The training process of the head detection model includes: Acquire a head detection data set, where the head detection data set includes labeled bounding box information for indicating a head position in an image; Preprocess the head detection dataset into the format required by the YOLOv10 pre-trained model; Set training parameters, including learning rate, batch size, and number of training rounds; Use the head detection dataset to train the YOLOv10 pre-trained model to generate a head detection model.
3. The automatic control method of a lighting lamp according to claim 1, characterized in that: Before performing image mapping of the grayscale head heat map onto a pre-divided chessboard-shaped seating map to determine the density distribution of people in different areas to be illuminated, the automatic control method of the lighting lamp further includes: The distorted grayscale head heat map is corrected using affine transformation and perspective correction technology: Take three non-collinear calibration points in the grayscale head heat map, and determine the first coordinates of each non-collinear calibration point respectively; Determine the second coordinate of each fixed point in the non-collinearity table in the image collector used for collecting images of different areas to be illuminated; Based on the affine principle, determining the association relationship between the first coordinate and the second coordinate, and determining an affine transformation matrix; The grayscale head heat map is affine transformed by using the affine transformation matrix to obtain a target grayscale head heat map, and a corresponding planar rectangular area is intercepted from the target grayscale head heat map to obtain a corrected target grayscale head heat map.
4. The automatic control method of a lighting lamp according to claim 1, characterized in that: The grayscale head heat map is image-mapped to a pre-divided chessboard-shaped seating map to determine the density distribution of people in different areas to be illuminated, including: According to the pixel value of the seat number area in the area to be illuminated, the actual situation of whether each seat is occupied is mapped to a pre-divided chessboard seating diagram based on a mapping rule; wherein, the mapping rule is characterized in that if there is a head at the seat number, the pixel value is greater than zero, and if there is no head at the seat number, the pixel value is equal to zero.
5. An automatic control system for lighting lamps applied to the automatic control method for lighting lamps according to any one of claims 1 to 4, characterized in that: include: The acquisition unit is used to acquire images of different areas to be illuminated, and use a pre-trained head detection model to perform head detection on people in the images of different areas to be illuminated to obtain position information of head bounding boxes; A grayscale processing unit, used to generate a head center point heat map background based on the position information of the head bounding box, and grayscale the head heat map to obtain a grayscale head heat map; A mapping unit, used for performing image mapping of the grayscale head heat map to a pre-divided chessboard-shaped seating map to determine the density distribution of people in different areas to be illuminated; The control unit is used to control the on and off state and brightness adjustment state of the lighting in different areas to be illuminated based on the population density distribution in different areas to be illuminated and the cumulative time whether there are people in the areas to be illuminated, using a preset lighting switch control algorithm.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the automatic control method of the lighting lamp as described in any one of claims 1 to 4 are implemented.
7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the automatic control method of the lighting lamp as described in any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Dense crowd counting and personnel distribution estimating method based on deep learning
CN107506692A
Deep learning-based estimation method for number of people in high-density crowd
CN108563975A