Disclosure of Invention
An object of embodiments of the present invention is to provide a fire early warning method, a fire early warning device, and a computer-readable storage medium, which can early warn in time, and have low cost and wide application range.
In order to solve the above technical problem, an embodiment of the present invention provides a fire early warning method, including:
acquiring a characteristic image for representing the temperature of a monitoring area, wherein the monitoring area comprises a fire power utilization area and a non-fire power utilization area outside the fire power utilization area; dividing the characteristic image into a first characteristic image for representing the temperature of the non-powered area and a second characteristic image for representing the temperature of the powered area; acquiring a background value used for representing the temperature of the non-fire electricity utilization area in the first characteristic image; intermittently acquiring a characteristic value used for representing the temperature of the fire power utilization area in the second characteristic image by taking a first preset time length as an interval; and acquiring the alarm level of the fire power utilization area according to the characteristic value and the background value, and sending alarm information when the alarm level is greater than a preset alarm level.
The embodiment of the present invention also provides a fire early warning device, including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the fire early warning method described above.
Embodiments of the present invention also provide a computer-readable storage medium storing a computer program, which when executed by a processor implements the fire early warning method described above.
Compared with the prior art, the embodiment of the invention acquires the characteristic image for representing the temperature of the monitoring area, divides the characteristic image into the first characteristic image for representing the temperature of the non-power-consumption area and the second characteristic image for representing the temperature of the power-consumption area, so that the temperatures of the power-consumption area and the non-power-consumption area in the monitoring area can be known according to the characteristic image, acquires the background value for representing the temperature of the non-power-consumption area in the first characteristic image, intermittently acquires the characteristic value for representing the temperature of the power-consumption area in the second characteristic image at intervals of a first preset time length, thereby being capable of mastering the change condition of the temperature of the power-consumption area in real time, and finally acquires the alarm level of the power-consumption area according to the characteristic value and the background value, and when the alarm level is greater than a preset alarm level, sending alarm information. Since only the temperature in the electric fire area changes (gradually increases) at the initial stage of fire occurrence, but the temperature in the electric fire area does not basically remain unchanged, the alarm level obtained through the background value and the characteristic value changes as long as the temperature in the electric fire area changes (namely the characteristic value changes), and when the alarm level is greater than the preset alarm level, alarm information is immediately sent, so that early warning is timely, and the situation that the early warning cannot be timely realized because smoke with sufficient concentration is not generated at the initial stage of fire occurrence is effectively avoided; meanwhile, an infrared thermal imaging camera with higher cost does not need to be used, and a security monitoring camera with low cost and high reliability can be used, so that the cost of the fire early warning method is reduced; in addition, the color and the shape of the smoke do not need to be extracted through a computer vision technology, the method is not limited by any technology, and the application scene is wide.
In addition, the obtaining of the background value used for characterizing the temperature of the non-live fire electricity utilization region in the first characteristic image specifically includes: acquiring N first pixel values of the first characteristic image, wherein N is an integer greater than 1; and calculating a first average value of the N first pixel values, and taking the first average value as the background value. This approach provides a specific solution for obtaining a background value that is indicative of the temperature of the non-live zone.
In addition, the intermittently obtaining the characteristic value used for representing the temperature of the fire power utilization area in the second characteristic image by taking the first preset time period as an interval specifically comprises: intermittently acquiring M second pixel values of the second characteristic image by taking the first preset time length as an interval, wherein M is an integer greater than 1; subtracting the first average value from the M second pixel values respectively to obtain M intermediate values; and calculating a second average value of the M intermediate values, and taking the second average value as the characteristic value. This provides a specific solution for obtaining a characteristic value for characterizing the temperature of the live zone.
In addition, the acquiring of the alarm level of the fire power utilization area according to the characteristic value and the background value and the sending of alarm information when the alarm level is greater than a preset alarm level specifically include: and judging whether the characteristic value is greater than the background value, increasing the alarm level when judging that the characteristic value is greater than the background value, and sending alarm information until the alarm level is greater than a preset alarm level in a second preset time length, wherein the second preset time length is greater than or equal to the first preset time length and is an integral multiple of the first preset time length.
In addition, the acquiring of the alarm level of the fire power utilization area according to the characteristic value and the background value and the sending of alarm information when the alarm level is greater than a preset alarm level specifically include: judging whether the characteristic value is greater than the background value, increasing the alarm level when judging that the characteristic value is greater than the background value, reducing the alarm level when judging that the characteristic value is less than the background value, and sending alarm information until the alarm level is greater than the preset alarm level in a second preset time period, wherein the second preset time period is greater than or equal to the first preset time period and is an integral multiple of the first preset time period. Due to the fact that other factors (such as sunlight irradiation and the like) can also cause the characteristic value to be larger than the background value at a certain moment, the alarm level is increased when the characteristic value is judged to be larger than the background value, and the alarm level is reduced when the characteristic value is judged to be smaller than the background value, so that misjudgment on whether a fire disaster happens or not is effectively avoided, and the accuracy of fire early warning is improved.
In addition, the determining whether the feature value is greater than the background value, increasing the alarm level when determining that the feature value is greater than the background value, and decreasing the alarm level when determining that the feature value is less than the background value specifically includes: and judging whether the characteristic value is greater than the background value, adding 1 to the alarm level when judging that the characteristic value is greater than the background value, and subtracting 1 from the alarm level when judging that the characteristic value is less than the background value.
In addition, the acquiring of the characteristic image for characterizing the temperature of the monitoring area specifically includes: and acquiring an image of the monitoring area in a near infrared band, and taking the image in the near infrared band as the characteristic image.
In addition, the dividing the characteristic image into a first characteristic image for representing the temperature of the non-powered electrical region and a second characteristic image for representing the temperature of the powered electrical region specifically includes: setting a target area as an area to be measured in coordinates in the characteristic image; acquiring the image coordinates of the area to be measured in coordinates; calculating a circumscribed circle of the image coordinate according to the image coordinate; and taking the area where the circumscribed circle is located as the fire power utilization area, taking the area outside the circumscribed circle as the non-fire power utilization area, taking the image corresponding to the non-fire power utilization area as the first characteristic image, and taking the image corresponding to the fire power utilization area as the second characteristic image.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, embodiments of the present invention will be described in detail below with reference to the accompanying drawings. However, it will be appreciated by those of ordinary skill in the art that numerous technical details are set forth in order to provide a better understanding of the present invention in its various embodiments. However, the technical solution claimed in the present invention can be implemented without these technical details and various changes and modifications based on the following embodiments.
The first embodiment of the present invention relates to a fire early warning method, and the specific flow is shown in fig. 1, and includes:
s101: a characteristic image is acquired that is characteristic of the temperature of the monitored area.
In step S101, specifically, the monitoring area includes a fire power utilization area and a non-fire power utilization area outside the fire power utilization area, and the obtaining of the characteristic image for representing the temperature of the monitoring area may be: and acquiring an image of the monitoring area in a near infrared band, and taking the image in the near infrared band as the characteristic image. It is understood that the near infrared band is an electromagnetic wavelength range between the visible light band and the mid infrared band, and belongs to a band invisible to human eyes, and the temperature condition of the monitored area can be known by observing the image of the near infrared band of the monitored area. It should be noted that the sensor used in the camera in this embodiment is a Complementary Metal Oxide Semiconductor (CMOS) sensor, which belongs to a photoelectric imaging device manufactured by using semiconductor materials silicon Si and germanium Ge, and the infrared signal collection capability can be improved by using two characteristics of the sensor, namely, high dynamics and high signal-to-noise ratio.
It is worth mentioning that, for the clear near-infrared signal of better collection, can add infrared filter in the front of the camera in this embodiment, through carrying out the coating film or increasing the filter at the detector front end to optical lens, filter the partial photon of visible light, strengthened the ability of collecting near-infrared photon in other words. The key parameter of the filter is called cut-off wavelength, the cut-off wavelength is used as a specific wavelength threshold value, energy with the wavelength smaller than the cut-off wavelength is rejected to pass, energy with the wavelength larger than the cut-off wavelength is allowed to pass, and the filter is a filter with the selected wavelength. The schematic diagram of the ideal filter is shown in fig. 2, and the cutoff wavelength of the infrared filter is designed in the band range of 700 and 800 nm (i.e. 0.7-0.8 μm).
Specifically, the schematic diagram of the camera and the alarm system device is shown in fig. 3: the camera is fixed above the monitoring area to ensure clear visual field. The camera is connected with the computer through a data cable. The video captured by the camera is further processed as input by an image processing program. The output part of the computer is connected with an automatic alarm system, and the automatic alarm system informs related workers through a network.
S102: the characteristic image is divided into a first characteristic image used for representing the temperature of the non-live electric region and a second characteristic image used for representing the temperature of the live electric region.
In step S102, specifically, the dividing the characteristic image into a first characteristic image for representing the temperature of the non-utility power region and a second characteristic image for representing the temperature of the utility power region may be: setting a target area as an area to be measured in coordinates in the characteristic image; acquiring the image coordinates of the area to be measured in coordinates; calculating a circumscribed circle of the image coordinate according to the image coordinate; and taking the area where the circumscribed circle is located as the fire power utilization area, taking the area outside the circumscribed circle as the non-fire power utilization area, taking the image corresponding to the non-fire power utilization area as the first characteristic image, and taking the image corresponding to the fire power utilization area as the second characteristic image. It can be understood that, after the camera captures the feature image of the monitored area, the area to be measured in coordinates can be manually selected from the feature image, so as to obtain the area using fire.
S103: and acquiring a background value used for representing the temperature of the non-live electric region in the first characteristic image.
In step S103, specifically, the obtaining of the background value in the first characteristic image for characterizing the temperature of the non-live fire electricity utilization region may be: acquiring N first pixel values of the first characteristic image, wherein N is an integer greater than 1; and calculating a first average value of the N first pixel values, and taking the first average value as the background value.
S104: and intermittently acquiring a characteristic value used for representing the temperature of the fire electricity utilization area in the second characteristic image by taking the first preset time length as an interval.
In step S104, specifically, M second pixel values of the second feature image are intermittently obtained at intervals of the first preset time duration, where M is an integer greater than 1; subtracting the first average value from the M second pixel values respectively to obtain M intermediate values; and calculating a second average value of the M intermediate values, and taking the second average value as the characteristic value.
S105: and judging whether the characteristic value is greater than the background value, increasing the alarm level when the characteristic value is greater than the background value, and sending alarm information until the alarm level is greater than the preset alarm level within a second preset time.
In step S105, specifically, if the first preset time period is 15 seconds, the second preset time period is 3 minutes, and the preset alarm level is 10, the alarm level is increased to 12 and 10 if the feature value is always greater than the background value within 3 minutes, and then alarm information is generated.
Compared with the prior art, the embodiment of the invention acquires the characteristic image for representing the temperature of the monitoring area, divides the characteristic image into the first characteristic image for representing the temperature of the non-power-consumption area and the second characteristic image for representing the temperature of the power-consumption area, so that the temperatures of the power-consumption area and the non-power-consumption area in the monitoring area can be known according to the characteristic image, acquires the background value for representing the temperature of the non-power-consumption area in the first characteristic image, intermittently acquires the characteristic value for representing the temperature of the power-consumption area in the second characteristic image at intervals of a first preset time length, thereby being capable of mastering the change condition of the temperature of the power-consumption area in real time, and finally acquires the alarm level of the power-consumption area according to the characteristic value and the background value, and when the alarm level is greater than a preset alarm level, sending alarm information. Since only the temperature in the electric fire area changes (gradually increases) at the initial stage of fire occurrence, but the temperature in the electric fire area does not basically remain unchanged, the alarm level obtained through the background value and the characteristic value changes as long as the temperature in the electric fire area changes (namely the characteristic value changes), and when the alarm level is greater than the preset alarm level, alarm information is immediately sent, so that early warning is timely, and the situation that the early warning cannot be timely realized because smoke with sufficient concentration is not generated at the initial stage of fire occurrence is effectively avoided; meanwhile, an infrared thermal imaging camera with higher cost does not need to be used, and a security monitoring camera with low cost and high reliability can be used, so that the cost of the fire early warning method is reduced; in addition, the color and the shape of the smoke do not need to be extracted through a computer vision technology, the method is not limited by any technology, and the method is suitable for any scene.
A second embodiment of the present invention is a fire alarm method, and the second embodiment is substantially the same as the first embodiment, and is mainly different in that in the first embodiment, the acquiring an alarm level of the fire electricity utilization area based on the characteristic value and the background value, and transmitting alarm information when the alarm level is greater than a preset alarm level, specifically includes: and judging whether the characteristic value is greater than the background value, increasing the alarm level when judging that the characteristic value is greater than the background value, and sending alarm information until the alarm level is greater than a preset alarm level in a second preset time length, wherein the second preset time length is greater than or equal to the first preset time length and is an integral multiple of the first preset time length. In a second embodiment, the acquiring an alarm level of the fire power utilization area according to the characteristic value and the background value, and sending alarm information when the alarm level is greater than a preset alarm level specifically includes: judging whether the characteristic value is greater than the background value, increasing the alarm level when judging that the characteristic value is greater than the background value, reducing the alarm level when judging that the characteristic value is less than the background value, and sending alarm information until the alarm level is greater than the preset alarm level in a second preset time period, wherein the second preset time period is greater than or equal to the first preset time period and is an integral multiple of the first preset time period. Due to the fact that other factors (such as sunlight irradiation and the like) can also cause the characteristic value to be larger than the background value at a certain moment, the alarm level is increased when the characteristic value is judged to be larger than the background value, and the alarm level is reduced when the characteristic value is judged to be smaller than the background value, so that misjudgment on whether a fire disaster happens or not is effectively avoided, and the accuracy of fire early warning is improved.
As shown in fig. 4, a specific flow of the present embodiment includes:
s201: a characteristic image is acquired that is characteristic of the temperature of the monitored area.
S202: the characteristic image is divided into a first characteristic image used for representing the temperature of the non-live electric region and a second characteristic image used for representing the temperature of the live electric region.
S203: and acquiring a background value used for representing the temperature of the non-live electric region in the first characteristic image.
S204: and intermittently acquiring a characteristic value used for representing the temperature of the fire electricity utilization area in the second characteristic image by taking the first preset time length as an interval.
Steps S201 to S204 in this embodiment are similar to steps S101 to S104 in the first embodiment, and are not repeated here to avoid repetition.
S205: and judging whether the characteristic value is greater than the background value, increasing the alarm level when the characteristic value is greater than the background value, reducing the alarm level when the characteristic value is less than the background value, and sending alarm information until the alarm level is greater than the preset alarm level within a second preset time.
Specifically, in step S205, in this embodiment, when the feature value is determined to be greater than the background value, the alarm level is increased, and when the feature value is determined to be less than the background value, the alarm level is decreased by: and when the characteristic value is judged to be larger than the background value, adding 1 to the alarm level, and when the characteristic value is judged to be smaller than the background value, subtracting 1 from the alarm level. It can be understood that the interference of external conditions except for the occurrence of a fire may also cause an increase in the characteristic value, and when it is determined that the characteristic value is smaller than the background value, the alarm level is decreased by 1, so that the alarm level is not increased all the time within a certain time period due to other reasons (non-fire), which may cause an erroneous determination of the alarm system, thereby improving the accuracy of fire early warning. It will be appreciated by those skilled in the art that the present embodiment can achieve the same technical effects as the foregoing embodiment.
For convenience of understanding, the following specifically describes the processing flow of the feature image in the present embodiment:
1. in a focus monitoring area, such as a fire-using electric area such as a heating table or a cooking bench, a local area is set in the image as an area of interest. The setting method is that the image coordinate of the area is obtained and stored, the circumcircle of the group of coordinates is calculated to obtain the center coordinate (Xc, Yc) and the radius distance r of the circle, and the circumcircle is set as the ROI (region of interest);
2. and obtaining an image captured by the infrared filter camera. Calculating the average value of pixel values outside the ROI area as a background value background;
3. calculating each pixel value in the ROI area minus background, and storing as ROI _ cut _ bg;
4. and (3) taking the average value ROI _ avg of the ROI _ cut _ bg, collecting the ROI _ avg at intervals of a fixed time interval t, and sequentially saving the ROI _ avg _1, the ROI _ avg _2 and the ROI _ avg _3 … … ROI _ avg _ n.
5. And when the ROI _ avg _ i is smaller than the ROI _ avg _ fire _ alarm, the alarm level alarm _ degree is decreased by 1. When the alarm _ degree exceeds the threshold value, the fire is considered to be detected, and staff are informed to process through an alarm system.
A third embodiment of the present invention relates to a fire early warning device, as shown in fig. 5, including:
at least one processor 301; and the number of the first and second groups,
a memory 302 communicatively coupled to the at least one processor 301; wherein,
the memory 302 stores instructions executable by the at least one processor 301, the instructions being executable by the at least one processor 301 to enable the at least one processor 301 to perform the fire early warning method described above.
Where the memory 302 and the processor 301 are coupled in a bus, the bus may comprise any number of interconnected buses and bridges, the buses coupling one or more of the various circuits of the processor 301 and the memory 302. The bus may also connect various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. A bus interface provides an interface between the bus and the transceiver. The transceiver may be one element or a plurality of elements, such as a plurality of receivers and transmitters, providing a means for communicating with various other apparatus over a transmission medium. The data processed by the processor 301 is transmitted over a wireless medium through an antenna, which further receives the data and transmits the data to the processor 301.
The processor 301 is responsible for managing the bus and general processing and may also provide various functions including timing, peripheral interfaces, voltage regulation, power management, and other control functions. And memory 302 may be used to store data used by processor 301 in performing operations.
A fourth embodiment of the present invention relates to a computer-readable storage medium storing a computer program. The computer program realizes the above-described method embodiments when executed by a processor.
That is, as can be understood by those skilled in the art, all or part of the steps in the method for implementing the embodiments described above may be implemented by a program instructing related hardware, where the program is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the method described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It will be understood by those of ordinary skill in the art that the foregoing embodiments are specific examples for carrying out the invention, and that various changes in form and details may be made therein without departing from the spirit and scope of the invention in practice.