Disclosure of Invention
In view of the above, the main object of the present invention is to provide an indoor monitoring system, method and device based on image recognition, which have the advantages of high efficiency, high accuracy, low false alarm rate and high intelligence degree.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
an indoor monitoring system based on image recognition, the system comprising: the system comprises a field monitoring subsystem, a wireless communication network and a user side subsystem; the on-site monitoring subsystem at least comprises: the system comprises a smoke sensor, a temperature sensor, a humidity sensor, an image sensor, an infrared sensor and a microcontroller; the microcontroller comprises: a data conversion unit, an image processing unit and a judgment unit; the judging units are respectively in signal connection with the data conversion unit; the data conversion unit is respectively in signal connection with the smoke sensor, the temperature sensor, the humidity sensor, the infrared sensor and the image processing unit; the image processing unit is connected with the image sensor through signals; the judging unit judges the received data according to preset conditions, and sends a signal to the image processing unit under the condition of abnormal judgment, and the image processing unit starts the image sensor to acquire image information according to the received signal; the image processing unit is in signal connection with a wireless communication network; the wireless communication network signal is connected to the user side subsystem; the data conversion unit converts analog data received by the smoke sensor, the temperature sensor, the humidity sensor, the infrared sensor and the image processing unit into digital data and then sends the digital data to the judgment unit; the judging unit judges whether the data acquired by the smoke sensor is abnormal or not, judges whether the data acquired by the temperature sensor is abnormal or not, judges whether the data acquired by the humidity sensor is abnormal or not and judges whether the data acquired by the infrared sensor is abnormal or not according to the received digital data and a preset threshold value, and sends a signal to the image processing unit when the number of abnormal numerical values is more than or equal to 3; the image sensor is used for acquiring original image information; the image processing unit includes: the edge detection unit is used for receiving the original image information sent by the data transmission device, carrying out edge detection on the original image and generating an intermediate image after the edge detection; the flame area identification unit judges and identifies a flame area in the intermediate image after the edge detection, intercepts the flame area in the intermediate image and generates a flame area image; the fire early warning unit judges the severity of fire according to the generated flame area image and the flame image sample input into the fire early warning unit, and carries out early warning; the edge detection unit includes: an edge detection template generating unit for generating a convolution template for edge detection; a template moving unit for moving the convolution template in the image in a raster scanning manner; the convolution unit is used for performing convolution operation on the coefficient of the convolution template and the corresponding pixel under the template; the intermediate image generating unit is used for generating an intermediate image after edge detection according to the operation result of the convolution unit; the flame region identification unit includes: an area change rate calculation unit for calculating an area change of each region in the intermediate image after the edge detection; a circularity calculation unit configured to calculate a circularity of each region in the intermediate image after the edge detection; a flame region identification unit for identifying a flame region in the intermediate image based on the results calculated by the circularity calculation unit and the area change rate calculation unit;
in the intermediate image after the edge detection, the method for judging and identifying the flame area in the intermediate image comprises the following steps: define the area change rate as: (ii) a In the formula: AR represents the rate of change of area of highlight regions between adjacent intermediate images; a (n) represents the area of the suspicious region in the current intermediate image; a (n +1) represents the area of the suspicious region in the next intermediate image, and eps is a set minimum value;
the circularity is defined as: (ii) a In the formula: ck represents the circularity of the primitive numbered k; pk is the perimeter of the kth graphic primitive;
the fire early warning unit includes: recording a training set of the flame image sample; and the deep learning neural network is used for training the training set, establishing a deep learning model and judging the fire severity of the flame region image according to the model.
An indoor monitoring method based on image recognition, the method executes the following steps:
step S1: judging whether an abnormality occurs according to the smoke data, the temperature data, the humidity data and the infrared data monitored by each sensor, and starting an image monitoring program if the abnormality occurs; .
Step S2: after an image monitoring program is started, acquiring original image information;
step S3: carrying out edge detection on the original image to generate an intermediate image after edge detection;
in the intermediate image after the edge detection, the method for judging and identifying the flame area in the intermediate image comprises the following steps: define the area change rate as: (ii) a In the formula: AR represents the rate of change of area of highlight regions between adjacent intermediate images; a (n) represents the area of the suspicious region in the current intermediate image; a (n +1) represents the area of the suspicious region in the next intermediate image, and eps is a set minimum value;
the circularity is defined as: (ii) a In the formula: ck represents the circularity of the primitive numbered k; pk is the perimeter of the kth graphic primitive;
step S5: and judging the severity of the fire according to the generated flame area image and the flame image sample recorded into the fire early warning unit, and early warning.
Further, in step S2: the method for receiving the information of the original image, carrying out edge detection on the original image and generating the intermediate image after the edge detection comprises the following steps:
step S2.1: the convolution template is used for generating a convolution template for edge detection, and the convolution template is a 3 x 3 template;
step S2.2: the following formula is used:
(ii) a Performing convolution operation on the convolution template and the original image in the step S2.1; wherein the content of the first and second substances,
in order to generate the intermediate image(s),
in order to be the original image, the image is processed,
is a convolution template.
Further, in step S5: judging the severity of the fire according to the generated flame area image and the flame image sample recorded into the fire early warning unit, and executing the following steps by the early warning method:
step S4.1: inputting an existing flame region image;
step S4.2: processing the existing flame area image to generate a plurality of training samples;
step S4.3: the training unit utilizes the training samples to perform image recognition training based on deep learning to generate a training model;
step S4.4: the method is used for detecting whether the flame area image to be detected contains the training sample or not by using the training model.
An image recognition based indoor monitoring device, the device being a non-transitory computer readable storage medium storing computing instructions, comprising: judging whether an abnormality occurs according to the smoke data, the temperature data, the humidity data and the infrared data which are monitored by each sensor, and starting a code segment of an image monitoring program if the abnormality occurs; after the image monitoring program is started, acquiring a code segment of original image information; a code segment for performing edge detection on the original image to generate an intermediate image after edge detection; a code segment for judging and identifying the flame area in the intermediate image after the edge detection, intercepting the flame area in the intermediate image and generating a flame area image; and a code segment for judging the severity of the fire and carrying out early warning according to the generated flame area image and the flame image sample recorded into the fire early warning unit.
Detailed Description
The method of the present invention will be described in further detail below with reference to the accompanying drawings and embodiments of the invention.
Example 1
An indoor monitoring system based on image recognition, the system comprising: the system comprises a field monitoring subsystem, a wireless communication network and a user side subsystem; the on-site monitoring subsystem at least comprises: the system comprises a smoke sensor, a temperature sensor, a humidity sensor, an image sensor, an infrared sensor and a microcontroller; the microcontroller comprises: a data conversion unit, an image processing unit and a judgment unit; the judging units are respectively in signal connection with the data conversion unit; the data conversion unit is respectively in signal connection with the smoke sensor, the temperature sensor, the humidity sensor, the infrared sensor and the image processing unit; the image processing unit is connected with the image sensor through signals; the judging unit judges the received data according to preset conditions, and sends a signal to the image processing unit under the condition of abnormal judgment, and the image processing unit starts the image sensor to acquire image information according to the received signal; the image processing unit is in signal connection with a wireless communication network; the wireless communication network signal is connected to the user side subsystem.
Example 2
On the basis of the previous embodiment, the data conversion unit converts analog data received by the smoke sensor, the temperature sensor, the humidity sensor, the infrared sensor and the image processing unit into digital data and then sends the digital data to the judgment unit; the judging unit judges whether the data acquired by the smoke sensor is abnormal or not, judges whether the data acquired by the temperature sensor is abnormal or not, judges whether the data acquired by the humidity sensor is abnormal or not and judges whether the data acquired by the infrared sensor is abnormal or not according to the received digital data and a preset threshold, and sends a signal to the image processing unit when the number of abnormal numerical values is more than or equal to 3.
Specifically, the invention determines whether to start image monitoring or not by judging whether the data acquired by the smoke sensor is abnormal or not, judging whether the data acquired by the temperature sensor is abnormal or not, judging whether the data acquired by the humidity sensor is abnormal or not and judging whether the data acquired by the infrared sensor is abnormal or not, so that the image monitoring can be ensured to be free from working under unnecessary conditions, and the efficiency of the system is further improved.
Example 3
On the basis of the previous embodiment, the image sensor is used for acquiring original image information; the image processing unit includes: the edge detection unit is used for receiving the original image information sent by the data transmission device, carrying out edge detection on the original image and generating an intermediate image after the edge detection; the flame area identification unit judges and identifies a flame area in the intermediate image after the edge detection, intercepts the flame area in the intermediate image and generates a flame area image; and the fire early warning unit judges the severity of the fire according to the generated flame area image and the flame image sample recorded into the fire early warning unit, and performs early warning.
Example 4
On the basis of the above embodiment, the edge detection unit includes: an edge detection template generating unit for generating a convolution template for edge detection; a template moving unit for moving the convolution template in the image in a raster scanning manner; the convolution unit is used for performing convolution operation on the coefficient of the convolution template and the corresponding pixel under the template; and the intermediate image generating unit is used for generating an intermediate image after edge detection according to the operation result of the convolution unit.
Example 5
On the basis of the above embodiment, the flame region identification unit includes: an area change rate calculation unit for calculating an area change of each region in the intermediate image after the edge detection; a circularity calculation unit configured to calculate a circularity of each region in the intermediate image after the edge detection; and the flame region identification unit is used for identifying the flame region in the intermediate image according to the results calculated by the circularity calculation unit and the area change rate calculation unit.
Specifically, in the intermediate image after the edge detection, the method for judging and identifying the flame region in the intermediate image performs the following steps: define the area change rate as:
(ii) a In the formula: AR represents the rate of change of area of highlight regions between adjacent intermediate images; a (n) represents the area of the suspicious region in the current intermediate image; a (n +1) represents the area of the suspicious region in the next intermediate image, and eps is a set minimum value; the range of the area change rate of the flame is 0.1-0.4, the area change rate of the fixed light source is close to 0, and the area change rate of the rapidly-flashing object is close to 1; the circularity is defined as:
(ii) a In the formula: ck represents the circularity of the primitive numbered k; pk is the perimeter of the kth primitive, namely the boundary length of the suspected primitive, and is obtained by calculating a boundary chain code, wherein in the boundary chain code, the chain code step length in the horizontal and vertical directions is unit length 1, the chain code step length in the diagonal direction is unit length, and the chain code step length in the right angle direction is unit length; ak is the area of the kth primitive, and is obtained by calculating the number of bright points in a suspicious primitive for a gray level image and calculating the number of pixel points with the pixel value of 1 for a binary image; n is the number of suspicious flame primitives in the image; the circularity of the flame zone is less than 0.5;
step S3.3: and judging and identifying the flame region in the intermediate image by calculating the area change rate and the circularity of the intermediate image.
Example 6
On the basis of the above embodiment, the fire early warning unit includes: recording a training set of the flame image sample; and the deep learning neural network is used for training the training set, establishing a deep learning model and judging the fire severity of the flame region image according to the model.
Example 7
An indoor monitoring method based on image recognition, the method executes the following steps:
step S1: judging whether an abnormality occurs according to the smoke data, the temperature data, the humidity data and the infrared data monitored by each sensor, and starting an image monitoring program if the abnormality occurs;
step S2: after an image monitoring program is started, acquiring original image information;
step S3: carrying out edge detection on the original image to generate an intermediate image after edge detection;
step S4: judging and identifying a flame region in the intermediate image after the edge detection, intercepting the flame region in the intermediate image, and generating a flame region image;
step S5: and judging the severity of the fire according to the generated flame area image and the flame image sample recorded into the fire early warning unit, and early warning.
Example 8
On the basis of the above embodiment, in the step S2: the method for receiving the information of the original image, carrying out edge detection on the original image and generating the intermediate image after the edge detection comprises the following steps:
step S2.1: the convolution template is used for generating a convolution template for edge detection, and the convolution template is a 3 x 3 template;
step S2.2: the following formula is used:
(ii) a Performing convolution operation on the convolution template and the original image in the step S2.1; wherein the content of the first and second substances,
in order to generate the intermediate image(s),
in order to be the original image, the image is processed,
is a convolution template.
Example 9
On the basis of the above embodiment, in the step S5: judging the severity of the fire according to the generated flame area image and the flame image sample recorded into the fire early warning unit, and executing the following steps by the early warning method:
step S4.1: inputting an existing flame region image;
step S4.2: processing the existing flame area image to generate a plurality of training samples;
step S4.3: the training unit utilizes the training samples to perform image recognition training based on deep learning to generate a training model;
step S4.4: the method is used for detecting whether the flame area image to be detected contains the training sample or not by using the training model.
Example 10
An image recognition based indoor monitoring device, the device being a non-transitory computer readable storage medium storing computing instructions, comprising: judging whether an abnormality occurs according to the smoke data, the temperature data, the humidity data and the infrared data which are monitored by each sensor, and starting a code segment of an image monitoring program if the abnormality occurs; after the image monitoring program is started, acquiring a code segment of original image information; a code segment for performing edge detection on the original image to generate an intermediate image after edge detection; a code segment for judging and identifying the flame area in the intermediate image after the edge detection, intercepting the flame area in the intermediate image and generating a flame area image; and a code segment for judging the severity of the fire and carrying out early warning according to the generated flame area image and the flame image sample recorded into the fire early warning unit.
The above description is only an embodiment of the present invention, but not intended to limit the scope of the present invention, and any structural changes made according to the present invention should be considered as being limited within the scope of the present invention without departing from the spirit of the present invention.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process and related description of the system described above may refer to the corresponding process in the foregoing method embodiments, and will not be described herein again.
It should be noted that, the system provided in the foregoing embodiment is only illustrated by dividing the functional modules, and in practical applications, the functions may be distributed by different functional modules according to needs, that is, the modules or steps in the embodiment of the present invention are further decomposed or combined, for example, the modules in the foregoing embodiment may be combined into one module, or may be further split into multiple sub-modules, so as to complete all or part of the functions described above. The names of the modules and steps involved in the embodiments of the present invention are only for distinguishing the modules or steps, and are not to be construed as unduly limiting the present invention.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes and related descriptions of the storage device and the processing device described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
Those of skill in the art would appreciate that the various illustrative modules, method steps, and modules described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that programs corresponding to the software modules, method steps may be located in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. To clearly illustrate this interchangeability of electronic hardware and software, various illustrative components and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as electronic hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The terms "first," "second," and the like are used for distinguishing between similar elements and not necessarily for describing or implying a particular order or sequence.
The terms "comprises," "comprising," or any other similar term are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus.
So far, the technical solutions of the present invention have been described in connection with the preferred embodiments shown in the drawings, but it is easily understood by those skilled in the art that the scope of the present invention is obviously not limited to these specific embodiments. Equivalent changes or substitutions of related technical features can be made by those skilled in the art without departing from the principle of the invention, and the technical scheme after the changes or substitutions can fall into the protection scope of the invention.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention.