A kind of method of the night bedroom window aperture of Intelligent Measurement
The present invention be Application No. 201510536514.3, the applying date be August in 2015 28 days, it is entitled " a kind of
The divisional application of the patent of the method for the night bedroom window aperture of Intelligent Measurement ".
Technical field
The present invention relates to the method in environment measuring field, more particularly to a kind of night bedroom window aperture of Intelligent Measurement.
Background technology
In the prior art, at night, when bedroom people, which enter, to sleep, bedroom window is in runaway condition, so-called mistake
Control refer to bedroom window can only keep before open or close state, and in open mode, bedroom window can only be with
Wind rocks or is fixed on a certain position, it is impossible to the control of bedroom window is flexibly carried out according to indoor occupant situation and outdoor wind speed
System, easily brings uncomfortable sensation to bedroom personnel.
Therefore, the method that the present invention proposes a kind of night bedroom window aperture of Intelligent Measurement, can be real-time at night
Sweat situation and the outside wind speed of detection and the indoor poison gas concentration content of detection bedroom personnel, with set up suitable personnel's body-sensing and
The venting mechanism of indoor healthy environment, it is ensured that the physical and mental health of indoor occupant.
The content of the invention
In order to solve the technical problem of prior art presence, the invention provides a kind of night bedroom window of Intelligent Measurement
The method of aperture, is detected using toxic gas detection equipment and wind speed measurement equipment to indoor and outdoor ventilation parameter, using tool
There is the image recognition apparatus of adapting to image Threshold segmentation mechanism and multiple effective image preconditioning technique to indoor occupant sweat
Detected, so as to automatically control the opening and closing of night bedroom window and automatically control the open degree of bedroom window.
There is provided a kind of method of the night bedroom window aperture of Intelligent Measurement, this method according to an aspect of the present invention
Including:1) a kind of night bedroom window aperture operating platform based on infrared detection is provided, the operating platform include it is infrared into
As equipment, infrared indoor image processing equipment, window aperture control device and AT89C51 single-chip microcomputers, the infrared imaging device
For obtaining infrared indoor image to bedroom indoor shot, the infrared indoor image processing equipment is set with the infrared imaging
Standby connection, for carrying out image procossing, the AT89C51 single-chip microcomputers and the infrared indoor image to the infrared indoor image
Processing equipment is connected, and the window aperture control is controlled for the processing result image based on the infrared indoor image processing equipment
Open mode of the control equipment to bedroom window;2) detected using the operating platform.
More specifically, in the night bedroom window aperture operating platform based on infrared detection, in addition to:There is poison gas
Physical examination measurement equipment, is connected with the AT89C51 single-chip microcomputers, whether there is toxic gas in bedroom for detecting, and detecting
When there is toxic gas, toxic gas content is sent to the AT89C51 single-chip microcomputers;Wind speed measurement equipment, is arranged on bedroom
On outside exterior wall, for detecting and exporting the real-time wind speed outside bedroom;Power supply unit, is arranged on the exterior wall outside bedroom
On, including solar powered device, commercial power interface, switching switch and electric pressure converter, switching switch and the solar energy
Power supply device and the commercial power interface are connected respectively, according to the line voltage size at commercial power interface decides whether to be switched to
Solar powered device by the solar powered device to be powered, and the electric pressure converter is connected with the switching switch, with
It is 3.3V voltages by the 5V voltage conversions that input is switched by switching;Mobile hard disk, for prestoring human body gray threshold model
Enclose with presetted pixel amount threshold, be additionally operable to prestore benchmark sweat image, the benchmark sweat image is to benchmark sweat
What is shot and obtained only includes the image of sweat pixel;The infrared indoor image processing equipment is arranged on inside bedroom
On interior wall, it is connected with the infrared imaging device, for receiving infrared indoor image;The infrared indoor image processing equipment bag
Contrast enhancer equipment, the sub- equipment of Wiener filtering, the sub- equipment of medium filtering, the sub- equipment of mean filter, image expansion is included to set
The sub- equipment of standby, Image erosion, the sub- equipment of gray processing processing, threshold value select sub- equipment, the sub- equipment of human body segmentation and sweat to extract son
Equipment;The contrast enhancer equipment, the sub- equipment of the Wiener filtering, the sub- equipment of the medium filtering, the mean filter
Sub- equipment, described image expand sub- equipment, described image and corrode sub- equipment, the sub- equipment of gray processing processing to the infrared room
Interior image performs contrast enhancing, Wiener filtering, medium filtering, mean filter, image expansion, Image erosion and gray processing successively
Processing, to obtain gray level image;The threshold value selects sub- equipment to handle sub- equipment with the mobile hard disk and the gray processing
Connect respectively, for selecting a value from the human body gray threshold scope successively as pre-selection gray threshold, using pre-selection
Gray level image is divided into pre-selection background area and pre-selected target region by gray threshold, is calculated pre-selection background area and is occupied gray scale
Change the area ratio of image as the first area ratio, calculate the pixel average gray value of pre-selection background area as the first average ash
Angle value, calculates pre-selected target region and occupies the area ratio of gray level image as second area ratio, calculating pre-selected target region
Pixel average gray value as the second average gray value, the first average gray value is subtracted into the second average gray value, acquisition
Difference square is multiplied by the first area ratio and second area ratio, and the product of acquisition is as threshold value product, and selection threshold value product is maximum
Pre-selection gray threshold is used as target gray threshold value;The sub- equipment of human body segmentation selects sub- equipment to be connected with the threshold value, is used for
Gray level image is divided into by background image and human body image using target gray threshold value;The sweat extract sub- equipment with it is described
The sub- equipment of human body segmentation and the mobile hard disk are connected respectively, from human body image extract with benchmark sweat images match each
Sweat subgraph, the pixel summation added up in each sweat subgraph, when obtained pixel summation is more than presetted pixel quantity threshold
During value, judge that human body has sweat and output has sweat signal, when obtained pixel summation is less than or equal to presetted pixel quantity
During threshold value, judge that human body is not present sweat and exported and sweat signal is not present;The AT89C51 single-chip microcomputers and the infrared imaging
Equipment, the wind speed measurement equipment, the mobile hard disk, the infrared indoor image processing equipment and window aperture control
Equipment is connected respectively, is being received in the absence of sweat signal, is being controlled the window aperture control device to close bedroom window,
Receive and there is sweat signal, open bedroom window, and determine that the window aperture control is set according to the real-time wind speed received
Standby unlatching strategy;Wherein, the unlatching strategy that the AT89C51 single-chip microcomputers are determined is specifically included:The AT89C51 single-chip microcomputers base
The window aperture control device is controlled in the wind speed aperture table of comparisons so that the window aperture control device controls bedroom window
Aperture be inversely proportional with real-time wind speed;Wherein, the wind speed aperture table of comparisons be pre-stored in the mobile hard disk it is advance in,
The wind speed aperture table of comparisons gives the mapping relations of each wind speed range and window aperture, the AT89C51 single-chip microcomputers
The aperture for causing the window aperture control device control window according to the wind speed aperture table of comparisons is inversely proportional with real-time wind speed;
The contrast enhancer equipment, the sub- equipment of the Wiener filtering, the sub- equipment of the medium filtering, mean filter are set
Standby, described image expands sub- equipment, described image and corrodes sub- equipment, the sub- equipment of gray processing processing, threshold value selection
Equipment, the sub- equipment of the human body segmentation and the sweat extract sub- equipment and the fpga chip of different model are respectively adopted to realize.
More specifically, in the night bedroom window aperture operating platform based on infrared detection:Alternatively, it is described right
Than degree enhancer equipment, the sub- equipment of the Wiener filtering, the sub- equipment of the medium filtering, the sub- equipment of the mean filter, described
The sub- equipment of image expansion, described image corrode sub- equipment, the sub- equipment of gray processing processing, the threshold value and select sub- equipment, institute
State the sub- equipment of human body segmentation and the sweat extracts sub- equipment and is integrated in one piece of fpga chip.
More specifically, in the night bedroom window aperture operating platform based on infrared detection, the operating platform
Also include:User input equipment, under the operation of user, inputting the human body gray threshold scope and the presetted pixel
Amount threshold.
More specifically, in the night bedroom window aperture operating platform based on infrared detection:User's input
Equipment is keyboard.
More specifically, in the night bedroom window aperture operating platform based on infrared detection, the operating platform
Also include:Sound and light alarm equipment, is connected with the AT89C51 single-chip microcomputers, for the control connected in the AT89C51 single-chip microcomputers
Lower carry out sound and light alarm.
More specifically, in the night bedroom window aperture operating platform based on infrared detection:The AT89C51 is mono-
Piece machine sends acousto-optic report when the toxic gas content received is more than or equal to default content threshold value to the sound and light alarm equipment
Alert signal.
More specifically, in the night bedroom window aperture operating platform based on infrared detection:The default content
Threshold value is pre-stored in the mobile hard disk.
Brief description of the drawings
Embodiment of the present invention is described below with reference to accompanying drawing, wherein:
Fig. 1 is the night bedroom window aperture operating platform based on infrared detection according to embodiment of the present invention
Block diagram.
Reference:1 infrared imaging device;2 infrared indoor image processing equipments;3 window aperture control devices;
4AT89C51 single-chip microcomputers
Embodiment
Below with reference to accompanying drawings to the implementation of the night bedroom window aperture operating platform based on infrared detection of the invention
Scheme is described in detail.
In the prior art, according to indoor poison gas situation, outdoor wind speed and interior when and being slept soundly in the absence of night bedroom personnel
Personnel's degree of sweating carries out the intelligent scheme for opening control to bedroom window, so easilys lead to indoor occupant and sweat catch a cold
Or heatstroke, and cause that the opening degree of window can not be automatically controlled according to outdoor wind speed.
In order to overcome above-mentioned deficiency, it is flat that the present invention has built a kind of night bedroom window aperture operation based on infrared detection
Platform, carries out data acquisition to night bedroom personnel image using infrared image acquisition technology, passes through targetedly various images
Processing equipment recognizes bedroom personnel's perspiration situation, and flexibly controls according to perspiration situation and indoor and outdoor ventilation condition the unlatching of window
State.
Fig. 1 is the night bedroom window aperture operating platform based on infrared detection according to embodiment of the present invention
Block diagram, the operating platform includes infrared imaging device, infrared indoor image processing equipment, window aperture control device
With AT89C51 single-chip microcomputers, the infrared imaging device is used for bedroom indoor shot to obtain infrared indoor image, described infrared
Off-the-air picture processing equipment is connected with the infrared imaging device, for carrying out image procossing, institute to the infrared indoor image
State AT89C51 single-chip microcomputers to be connected with the infrared indoor image processing equipment, for setting based on the infrared indoor image procossing
Open mode of the standby processing result image control window aperture control device to bedroom window.
Then, continue to enter the concrete structure of the night bedroom window aperture operating platform based on infrared detection of the present invention
Row further instruction.
The operating platform also includes:Toxic gas detection equipment, is connected with the AT89C51 single-chip microcomputers, for detecting
It whether there is toxic gas in bedroom, and when detecting the presence of toxic gas, toxic gas content be sent to described
AT89C51 single-chip microcomputers.
The operating platform also includes:Wind speed measurement equipment, is arranged on the exterior wall outside bedroom, for detecting and exporting
Real-time wind speed outside bedroom.
The operating platform also includes:Power supply unit, is arranged on the exterior wall outside bedroom, including solar energy electric supplier
Part, commercial power interface, switching switch and electric pressure converter, the switching switch connect with the solar powered device and the civil power
Mouth is connected respectively, decides whether to be switched to the solar powered device according to the line voltage size at commercial power interface with by institute
State solar powered device to power, the electric pressure converter is connected with the switching switch, input will be switched by switching
5V voltage conversions are 3.3V voltages.
The operating platform also includes:Mobile hard disk, for prestoring human body gray threshold scope and presetted pixel number
Threshold value is measured, is additionally operable to prestore benchmark sweat image, the benchmark sweat image is obtained to shoot benchmark sweat
The image for only including sweat pixel.
The infrared indoor image processing equipment is arranged on the interior wall inside bedroom, is connected with the infrared imaging device
Connect, for receiving infrared indoor image;The infrared indoor image processing equipment includes contrast enhancer equipment, Wiener filtering
The sub- equipment of sub- equipment, medium filtering, the sub- equipment of mean filter, the sub- equipment of image expansion, the sub- equipment of Image erosion, gray processing processing
Sub- equipment, threshold value select sub- equipment, the sub- equipment of human body segmentation and sweat to extract sub- equipment.
The contrast enhancer equipment, the sub- equipment of the Wiener filtering, the sub- equipment of the medium filtering, average filter
Marble equipment, described image expand sub- equipment, described image and corrode sub- equipment, the sub- equipment of gray processing processing to described infrared
Off-the-air picture performs contrast enhancing, Wiener filtering, medium filtering, mean filter, image expansion, Image erosion and gray scale successively
Change is handled, to obtain gray level image.
The threshold value selects sub- equipment to be connected respectively with the mobile hard disk and the sub- equipment of gray processing processing, for according to
It is secondary that a value is selected from the human body gray threshold scope as pre-selection gray threshold, using pre-selection gray threshold by gray processing
Image is divided into pre-selection background area and pre-selected target region, calculates the area ratio that pre-selection background area occupies gray level image
As the first area ratio, the pixel average gray value of pre-selection background area is calculated as the first average gray value, pre-selection mesh is calculated
Mark region occupies the area ratio of gray level image as second area ratio, calculates the pixel average gray value in pre-selected target region
As the second average gray value, the first average gray value is subtracted into the second average gray value, poor square of acquisition is multiplied by first
Area ratio and second area ratio, the product of acquisition are used as threshold value product, the maximum pre-selection gray threshold conduct of selection threshold value product
Target gray threshold value.
The sub- equipment of human body segmentation selects sub- equipment to be connected with the threshold value, for using target gray threshold value by gray scale
Change image and be divided into background image and human body image.
The sweat extracts sub- equipment and is connected respectively with the sub- equipment of the human body segmentation and the mobile hard disk, from human figure
The pixel summation in each sweat subgraph with benchmark sweat images match, each accumulative sweat subgraph is extracted as in, when
When obtained pixel summation is more than presetted pixel amount threshold, judge that human body has sweat and output has sweat signal, when
When the pixel summation arrived is less than or equal to presetted pixel amount threshold, judges that human body is not present sweat and exported and sweat letter is not present
Number.
The AT89C51 single-chip microcomputers and the infrared imaging device, the wind speed measurement equipment, the mobile hard disk, institute
State infrared indoor image processing equipment and the window aperture control device connected respectively, receiving in the absence of sweat signal,
Control the window aperture control device to close bedroom window, there is sweat signal receiving, open bedroom window, and root
The unlatching strategy of the window aperture control device is determined according to the real-time wind speed received.
Wherein, the unlatching strategy that the AT89C51 single-chip microcomputers are determined is specifically included:The AT89C51 single-chip microcomputers are based on wind
The fast aperture table of comparisons controls the window aperture control device so that the window aperture control device controls opening for bedroom window
Degree is inversely proportional with real-time wind speed.The wind speed aperture table of comparisons be pre-stored in the mobile hard disk it is advance in, the wind speed
The aperture table of comparisons gives the mapping relations of each wind speed range and window aperture, and the AT89C51 single-chip microcomputers are according to described
The wind speed aperture table of comparisons causes the aperture of the window aperture control device control window to be inversely proportional with real-time wind speed.
The contrast enhancer equipment, the sub- equipment of the Wiener filtering, the sub- equipment of the medium filtering, average filter
Marble equipment, described image expand sub- equipment, described image and corrode sub- equipment, the sub- equipment of gray processing processing, the threshold value
The fpga chip for selecting sub- equipment, the sub- equipment of the human body segmentation and the sub- equipment of sweat extraction that different model is respectively adopted comes
Realize.
Alternatively, in the operating platform:Alternatively, the contrast enhancer equipment, Wiener filtering are set
Standby, the described sub- equipment of medium filtering, the sub- equipment of the mean filter, described image expand sub- equipment, described image corrosion and set
Standby, described gray processing handles sub- equipment, the threshold value and selects sub- equipment, the sub- equipment of the human body segmentation and the sweat to extract son
Equipment is integrated in one piece of fpga chip;In the night bedroom window aperture operating platform based on infrared detection, institute
Stating operating platform also includes:User input equipment, under the operation of user, inputting the human body gray threshold scope and institute
State presetted pixel amount threshold;The user input equipment is keyboard;The operating platform also includes:Sound and light alarm equipment, with
The AT89C51 single-chip microcomputers connection, for carrying out sound and light alarm under the control that the AT89C51 single-chip microcomputers are connected;It is described
AT89C51 single-chip microcomputers are when the toxic gas content received is more than or equal to default content threshold value, to the sound and light alarm equipment
Send sound and light alarm signal;The default content threshold value is pre-stored in the mobile hard disk.
In addition, FPGA (Field-Programmable Gate Array), i.e. field programmable gate array, he be
The product further developed on the basis of the programming devices such as PAL, GAL, CPLD.He is led as application specific integrated circuit (ASIC)
A kind of semi-custom circuit in domain and occur, both solved the deficiency of custom circuit, original programming device door overcome again
The limited shortcoming of circuit number.
The circuit design completed with hardware description language (Verilog or VHDL), can pass through simple synthesis and cloth
Office, is quickly burned onto on FPGA and is tested, and is the technology main flow of modern IC designs checking.These editable elements can be by
For realizing the combination function of some basic logic gates (such as AND, OR, XOR, NOT) or more more complicated such as
Decoder or mathematical equation.Inside most FPGA, also for example touched comprising memory cell in these editable elements
Send out device (Flip-flop) or other more complete block of memory.System designer can be as desired by editable company
Connect the logical block inside FPGA to connect, just look like that a breadboard has been placed in a chip.One dispatches from the factory
The logical block of finished product FPGA afterwards and connection can change according to designer, so FPGA can complete required logic work(
Energy.
Speed of the FPGA in general than ASIC (application specific integrated circuit) is slow, realizes same function than ASIC circuit face
Product is big.But they also have the advantages that it is many such as can quick finished product, the mistake that can be modified in correction program and
Less expensive cost.Manufacturer may also can provide the FPGA of cheap still edit capability difference.Because these chips have poor
Editable ability, so these design exploitations be to be completed on common FPGA, design is then transferred to a class
It is similar on ASIC chip.Another method is with CPLD (Complex Programmable Logic Device, complexity
PLD).Exploitation of the FPGA exploitation relative to traditional PC, single-chip microcomputer is very different.FPGA is with concurrent operation
Based on, realized with hardware description language;Compared to PC or single-chip microcomputer (either von Neumann structure or Harvard structure)
Order operation has very big difference.
Early in 1980 mid-nineties 90s, FPGA takes root in PLD equipment.CPLD and FPGA include some relatively large numbers
The Programmadle logic unit of amount.The density of CPLD gates is between thousands of to tens of thousands of logic units, and FPGA typically exists
It is tens of thousands of to arrive millions of.The CPLD and FPGA main distinction is their system architecture.CPLD is a somewhat restricted structure.
This structure is arranged the register with the locking of some relatively small amounts by the logical groups of one or more editable result sum
Composition.Such result is a lack of editing flexibility, but have it is anticipated that time delay and logic unit it is single to connection
The advantage of first height ratio.And FPGA is to have many connection units, although so allowing him more flexibly to edit,
Structure is complicated more.
Using the night bedroom window aperture operating platform based on infrared detection of the present invention, for night in the prior art
Bedroom window is difficult to the technical problem automatically controlled, using a variety of sensing technologies and targetedly image recognition technology, to sleeping
Room personnel's sweat data are acquired, and indoor gas and outdoor wind speed are acquired, and on this basis, flexibly control is sleeping
Closing, unlatching and the opening degree at room window family.
Although it is understood that the present invention is disclosed as above with preferred embodiment, but above-described embodiment and being not used to
Limit the present invention.For any those skilled in the art, without departing from the scope of the technical proposal of the invention,
Many possible variations and modification are all made to technical solution of the present invention using the technology contents of the disclosure above, or are revised as
With the equivalent embodiment of change.Therefore, every content without departing from technical solution of the present invention, the technical spirit pair according to the present invention
Any simple modifications, equivalents, and modifications made for any of the above embodiments, still fall within the scope of technical solution of the present invention protection
It is interior.