A kind of control method of subregion lighting energy-saving switch control system
Technical field
The present invention relates to the technical field of power down switch, more particularly to a kind of subregion lighting energy saving based on image procossing is opened
Close control system and its control method.
Background technology
In life, the use of electric light is very universal, and giving people to live brings very big convenience, but wasting phenomenon
Extremely serious, especially in public places, people generally actively will not turn off the light.Often there is both of these case:One is indoor
No one, lamp but light yellow;Two is that larger space only has a small amount of people, and indoor electric lamps whole light yellow.Both of these case can all cause electricity
The significant wastage of energy.Therefore, the demand of more intelligentized power down switch becomes increasingly conspicuous.
At present, conventional power down switch has:Light-operated switch, audio-switch, human body sensing (thermal infrared) switch.Light-operated switch
Typically it is used for aiding in what audio-switch and human body sensing (thermal infrared) were switched.
Audio-switch is widely used to the places such as corridor, but this control mode is indoors, such as room for individual study, library etc.
It is improper where quieter, and audio-switch easily disturbed by other sound sources, such as thunder, firecracker etc..Such as patent Shen
Please number for 201110214279.X " a kind of control device of light switch ", by sound detection whether someone, realize nobody
When automatic cut-off switch, so as to reach the effect of energy-conservation.But, the method is easily disturbed by noise, and in quiet situation
Under, switch is easily closed automatically, is not convenient to use.
For human body sensing (thermal infrared) switch, such as number of patent application be 201110275818.0 " a kind of energy-conservation is automatic
Illuminating switch system ", the switch of the strength control illuminator by sensing human body infrared and indoor light, realizes that someone walks
When entering room and excessively weak indoor light, illuminator is opened, when personnel withdraw from a room or indoor light brightness is stronger, close power supply
Device.But human body induction module can perceive human body thermal infrared, it is impossible to judge human motion direction, enter or withdraw from a room easily by mistake
Sentence;And no matter personnel are how many, whole room lighting is fully open, causes the waste of electric energy.
To sum up, existing power down switch has been primarily present following problem:One is less stable, easily by environmental disturbances;
Two is to realize subregion illumination on demand, even if one-man, the fully open situation of whole room lighting also occurs;Three
It is intelligent relatively low, it is impossible to follow walking about for indoor occupant to be illuminated.
The content of the invention
The purpose of the present invention and the technical problem for solving are the defects existed for prior art, are illuminated for public place
A kind of subregion lighting energy-saving switch control system and its control method are proposed, based on image processing techniquess, and subregion illumination is introduced
Mechanism, realizes that someone enters place, and during indoor light deficiency, electric light is automatically opened up;After electric light is opened, taken the photograph by high definition
As each illumination region whether someone in head automatic detection room, realize that subregion illumination (that is, is opened the electric light in someone region, closes nothing
The electric light in people region);With walking about for personnel, the electric light of human body region is automatically opened up.By subregion illumination and human body with
With illumination, the waste of electric energy can not only be prevented effectively from, and realizes intelligent lighting.
In order to realize above-mentioned purpose, the technical scheme is that:
A kind of subregion lighting energy-saving switch control system, by least one photographic head 1, at least one human body sensor 2,
Microcontroller 3, at least one relay 4 and some electric lights and computer composition.Wherein described photographic head 1 by USB interface with
Microcontroller 3 is connected, and human body sensor 2, relay 4 are connected with microcontroller 3 by GPIO mouths;The microcontroller 3
In be embedded with brightness calculation program module, Image semantic classification program module, image processing program module;Microcontroller 3 passes through USB
Interface or serial ports are connected with computer;There is system parameter settings program module in the computer, carry out the setting of systematic parameter;
Systematic parameter is stored in the ROM of microcontroller 3.
The photographic head 1 adopts CCD high-definition cameras, for gathering off-the-air picture picture.
The human body sensor 2 adopts RE200B infrared human body heat releasing electric transducers, near door, is used for
Detect whether that someone gets in.
Flush bonding processor of the microcontroller 3 using the ARM11 cores containing USB interface, GPIO interface and serial ports.
The relay 4 adopts electromagnetic relay G5V-1.
In order to realize above-mentioned purpose, another technical scheme of the present invention is:
A kind of control method of subregion lighting energy-saving switch control system of the present invention, step are as follows:
1) when someone comes into place, it is red that the arbitrary human body sensor in human body sensor 2 receives human body
External radiation, sends signal to microcontroller 3;
2) 3 initialisation image relief area of microcontroller, opens photographic head 1;
3) collection of photographic head 1 off-the-air picture picture, and microcontroller 3 is sent images to, set according to illumination region template
Fixed each zonal basis image;
4) the brightness calculation program module in microcontroller 3 calculates brightness of image, when brightness of image is less than the brightness of setting
Threshold value, then 3 sending signal control relay of microcontroller 4 open human body and close on the electric light of illumination region, go to step 5), work as image
Brightness is not less than the luminance threshold of setting, goes to step 3);
5) photographic head 1 gathered off-the-air picture picture every 10 seconds, and sent images to microcontroller 3;
6) microcontroller 3 carries out gray processing and enhancement process to image by Image semantic classification program module;Microcontroller
3, by image processing program module, each illumination region present image are contrasted with benchmark image, calculate each illumination region
Frame difference;When the frame difference limen value for having region to be less than setting, and the image processed within the default monitoring time is both less than frame difference limen
Value, then illustrate the region nobody, go to step 8);When there is frame difference limen value of the region more than setting, then region someone is illustrated, should
Region present image is defined as its benchmark image, judges the on off state of the region relay 4, when the region electric light is opened,
Go to step 5), when the region electric light is not switched on, go to step 7);The monitoring time is 5 minutes;
7) microcontroller 3 sends signal, and the relay 4 for controlling the region opens the electric light in the region, goes to step 5);
8) microcontroller 3 sends signal, and the relay 4 for controlling the region cuts out the electric light in the region;When all regions all
Nobody, then microcontroller 3 sends signal, closes photographic head 1, and 5) system dormancy otherwise, goes to step.
Step 3 described above) the illumination region template drawn by the illumination zone of electric light controlled with each relay
Divide illumination region, and demarcated by illumination region template.
Illumination region scaling method, step are as follows:
1) collection of photographic head 1 off-the-air picture picture, and send images to microcontroller 3;
2) image of each photographic head is sent to computer by microcontroller 3;
3) computer user is grouped situation according to the actual illumination of electric light, demarcates each illumination by system parameter settings program
The boundary position in region, arranges the frame difference limen value in the region, and each illumination region boundary coordinate parameter and threshold parameter is sent
To microcontroller 3;
4) microcontroller 3 is stored in each illumination region boundary coordinate parameter and threshold parameter in the ROM of microcontroller 3, shape
Into illumination region template.
Step 4 described above) described in brightness calculation program module calculate brightness of image method be:First picture by
Rgb space is transformed into HSL spaces, and L * component represents brightness, carries out mean computings twice to the L * component of image, has obtained a figure
The mean flow rate of picture.
Step 6 described above) in frame difference limen value, can determine according to photographic head precision and installation site that each region frame is poor
The size of threshold value.After photographic head is fixed, the company of the frames differencing of human body minor motion will can be perceived in the range of camera head monitor
Continuous pixel minimum is used as frame difference limen value.Frame difference limen value is set, can also rejection image noise and illumination variation impact.
Beneficial effect:A kind of subregion lighting energy-saving switch control system and its control method of the present invention, at image
The method of reason controls the opening and closing of electric light, so as to reach energy-conservation detecting the brightness in public place room and whether someone
Effect.
Energy Saving Benefit Analysis:Assume that a school there are 5 building teaching buildings, there are 40 classrooms per building teaching building, each classroom face
Product is about 100m2, lighting load is usually 1kW.If people does not actively turn off the light after walking, the electric energy that a classroom wastes for a hour
For 1 degree, 200 degree of electric energy can be saved within 1 hour using the present invention.And illuminated using subregion, it is prevented effectively from the wave of no man's land electric energy
Take.If the system is generalized to other public places, energy-saving benefit is very considerable.
The characteristics of of the invention, has:
1. realize that subregion is illuminated.The illumination zone of the lamp controlled according to each relay carries out region division, and often
Individual region is corresponding with the relay in the region, realizes the area illumination of electric light and closes, further saves energy.
2. realize following human body illumination.As human body is walked about, human body region change, if moving towards from illumination region
Non- illumination region, non-illumination region detect region someone, automatically open up the region electric light.The lighting area that human body was originally located
Domain detect the region nobody when, through setting the monitoring time after, be automatically switched off the electric light in the region, improve Lighting control
It is intelligent.
3. the present invention recognizes in illumination region whether someone using image processing techniquess, is not done by sound, infra-red radiation
Disturb, stability is strong.
4. it is by the parameter setting process of computer come initialization system parameter, convenient to be repaiied according to actual environment or requirement
Change, improve the motility of system.
5. embedded system technology, low in energy consumption, low cost are adopted.It is computed, in only one of which photographic head, the system exists
The electric energy consumed during normal work is only 1W, negligible.
The present invention is applied to the public place of large space, such as public classroom, library etc..By setting up photographic head, can be with
The careat of increase system monitoring;By setting up human body sensor, the place of many import and export is adapted to.It is of the invention same
Sample is suitable for the Energy Saving Control to other electrical equipment such as air-conditioning, electric fans.
Description of the drawings
Fig. 1 is a kind of theory diagram of subregion lighting energy-saving switch control system of the invention;
In figure:1. photographic head, 2. human body sensor, 3. microcontroller, 4. relay.
Fig. 2 is a kind of flow chart of subregion lighting energy-saving switch control method of the invention;
Fig. 3 is a kind of flow chart of illumination region scaling method of the invention.
Specific embodiment
The present invention will be further described with reference to the accompanying drawings and detailed description.
As shown in figure 1, a kind of subregion lighting energy-saving switch control system, by least one photographic head 1, at least one people's body-sensing
Inductive sensing device 2, microcontroller 3, at least one relay 4 and some electric lights and computer composition.Wherein described photographic head 1 leads to
Cross USB interface to be connected with microcontroller 3, human body sensor 2, relay 4 are connected with microcontroller 3 by GPIO mouths;Institute
Brightness calculation program module, Image semantic classification program module, image processing program module are embedded with stating microcontroller 3;Micro-control
Device processed 3 passes through USB interface or serial ports is connected with computer;There is system parameter settings program module in the computer, be
The setting of system parameter;Systematic parameter is stored in the ROM of microcontroller 3.
The photographic head 1 uses CCD camera, high definition, arrives multiple photographic head containing 1, for irregular or have
The room of pillar, photographic head sight line are easily blocked, and using multiple photographic head, can cover all blind areas.
The human body sensor 2 adopts RE200B infrared human body heat releasing electric transducers, and sensitivity is strong, installed in each
At doorway, detect whether that someone enters.In whole system dormancy, pyroelectric infrared sensor is in running order, when infrared
Pyroelectric sensor detects someone into after, just into resting state;Until it is indoor nobody, pyroelectric infrared sensor is again
Into working condition.
Flush bonding processor of the microcontroller 3 using ARM11 cores, containing USB interface, GPIO interface and serial ports, can
The each module of connection system.
The relay 4 adopts electromagnetic relay G5V-1, for controlling the switch of electric light.
As shown in Fig. 2 a kind of subregion lighting energy-saving switch control method, step is as follows:
1) when someone comes into place, it is red that the arbitrary human body sensor in human body sensor 2 receives human body
External radiation, sends signal to microcontroller 3;
2) 3 initialisation image relief area of microcontroller, opens photographic head 1;
3) collection of photographic head 1 off-the-air picture picture, and microcontroller 3 is sent images to, set according to illumination region template
Fixed each zonal basis image;
4) the brightness calculation program module in microcontroller 3 calculates brightness of image, when brightness of image is less than the brightness of setting
Threshold value, then 3 sending signal control relay of microcontroller 4 open human body and close on the electric light of illumination region, go to step 5), work as image
Brightness is not less than the luminance threshold of setting, goes to step 3);
5) photographic head 1 gathered off-the-air picture picture every 10 seconds, and sent images to microcontroller 3;
6) microcontroller 3 carries out gray processing and enhancement process to image by Image semantic classification program module;Microcontroller
3, by image processing program module, each illumination region present image are contrasted with benchmark image, calculate each illumination region
Frame difference;When the frame difference limen value for having region to be less than setting, and the image processed within the default monitoring time is both less than frame difference limen
Value, then illustrate the region nobody, go to step 8);When there is frame difference limen value of the region more than setting, then region someone is illustrated, should
Region present image is defined as its benchmark image, judges the on off state of the region relay 4, when the region electric light is opened,
Go to step 5), when the region electric light is not switched on, go to step 7);The monitoring time is 5 minutes;
7) microcontroller 3 sends signal, and the relay 4 for controlling the region opens the electric light in the region, goes to step 5);
8) microcontroller 3 sends signal, and the relay 4 for controlling the region cuts out the electric light in the region;When all regions all
Nobody, then microcontroller 3 sends signal, closes photographic head 1, and 5) system dormancy otherwise, goes to step.
Step 3 described above) the illumination region template drawn by the illumination zone of electric light controlled with each relay
Divide illumination region, and demarcated by illumination region template.
As shown in figure 3, a kind of illumination region scaling method, step is as follows:
1) collection of photographic head 1 off-the-air picture picture, and send images to microcontroller 3;
2) image of each photographic head is sent to computer by microcontroller 3;
3) computer user is grouped situation according to the actual illumination of electric light, demarcates each illumination by system parameter settings program
The boundary position in region, arranges the frame difference limen value in the region, and each illumination region boundary coordinate parameter and threshold parameter is sent
To microcontroller 3;
4) microcontroller 3 is stored in each illumination region boundary coordinate parameter and threshold parameter in the ROM of microcontroller 3, shape
Into illumination region template.
If there is nobody's scene that but image changes always, such as the position at the place such as clock and watch, fan, local can be set and drawn
Face shields, it is to avoid system erroneous judgement.
Step 4 described above) described in brightness calculation program module calculate brightness of image method be:First picture by
Rgb space is transformed into HSL spaces, and L * component represents brightness, carries out mean computings twice to the L * component of image, has obtained a figure
The mean flow rate of picture.
Step 4 described above) in the determination method of luminance threshold be:After photographic head is fixed, critical illumination condition is shot
Under image, calculate the mean flow rate of the image, the average brightness value be set to into luminance threshold.
Step 6 described above) in the computational methods of frame difference be:The pixel value of present image and the pixel of benchmark image
Value is subtracted each other one by one, the pixel that labelling pixel is changed, and obtains frames differencing.
Step 6 described above) in frame difference limen value, can determine according to photographic head precision and installation site that each region frame is poor
The size of threshold value.After photographic head is fixed, the company of the frames differencing of human body minor motion will can be perceived in the range of camera head monitor
Continuous pixel minimum is used as frame difference limen value.Frame difference limen value is set, can also rejection image noise and illumination variation impact.
If after electric light is opened, As time goes on, indoor appearance well-lighted situation without light, such as from evening
To daytime, clock control can be set, electric light is closed.
Public place is fitted with monitoring camera mostly.The present invention can utilize existing monitoring camera, make full use of existing
There is resource.
Using method
By taking classroom as an example, photographic head installation back upper place indoors, human body sensor are separately mounted to two and are entered
Door doorway.Classroom interior lighting device is divided into into 4 regions, respectively a-quadrant, B regions, C regions and D regions.Have respectively 4 after
The opening and closing of the electric light in this 4 regions of electrical equipment control.
Using front, computer is connected into microcontroller, initialization system parameter.
1. personnel enter classroom, if insufficient light, electric light is automatically opened up;
2. picture in photographic head timing acquiring classroom, realizes that subregion is illuminated, opens illumination in the region of someone;
3. personnel move towards non-illumination region from illumination region, and the electric light of non-illumination region is opened automatically with the movement of human body
Open;
4., when all personnel leaves classroom, classroom intraoral illumination is closed.
The present embodiment is the more excellent embodiment of the present invention, it should be noted that without departing substantially from spirit of the invention and its
In the case of essence, those of ordinary skill in the art work as and can make various corresponding changes and deformation, but this according to the present invention
A little changes and deformation should all belong to the protection domain of appended claims of the invention.