A flame detection method, system and computer readable storage medium
By constructing a flame three-point diagram and using a lightweight neural network to identify the flame area, the problem of insufficient flame detection performance in the prior art is solved, and efficient fire detection and positioning at the edge device end is achieved.
Patent Information
- Application Number
- CN202111607278.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-24
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2041-12-24
AI Technical Summary
Due to scene transformation and other reasons, the existing technology has high requirements for the flame detection performance of network models and cannot be applied to edge device ends.
By constructing a flame three-point diagram, the opaque mask for the flame foreground is calculated using the image cutout algorithm, irrelevant background interference is removed, and a lightweight neural network is used to classify and identify the suspected flame areas to determine whether a fire has occurred.
The accuracy of flame detection is improved, the flame detection performance requirements for network models are reduced, making this method suitable for edge equipment and the positioning of fire points is realized.
Smart Images

Figure CN114299007B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image recognition technology, and in particular to a flame detection method, system and computer-readable storage medium. Background Art
[0002] Vision-based flame detection methods have the advantages of wider deployment coverage, low price, and rapid response. They can be specifically divided into expert rule-based fire detection methods and deep learning-based fire detection methods.
[0003] Fire detection methods based on expert rules rely on manually designed flame features, such as color, texture, and motion features. These manually designed features are difficult to apply to scene changes, such as brightness changes. Fire detection methods based on deep learning are applied to weighted network models, which directly input a complete image into the classifier and use deep learning to overcome the limitations of manual features. However, lightweight network models have low flame detection performance, and weighted networks are difficult to apply to edge devices. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a flame detection method, system and computer-readable storage medium to solve the problem that the existing technology has high requirements on the flame detection performance of the network model during fire detection due to reasons such as scene changes and cannot be applied to the edge device end.
[0005] A flame detection method provided in an embodiment of the present application includes:
[0006] Acquire an image to be detected;
[0007] Construct a flame trisection image for the image, and the foreground area of the flame trisection image is the flame foreground;
[0008] For the flame trisection image, the opacity mask of the flame foreground is calculated using the image cutout algorithm, and the suspected flame area is obtained;
[0009] A lightweight neural network is used to classify and identify suspected flame areas to determine whether a fire has occurred.
[0010] In the above technical solution, a flame trisection map is constructed for the image to be detected, and the suspected flame area is re-detected under the premise of removing irrelevant background interference, thereby improving the accuracy of flame detection and reducing the requirements for the flame detection performance of the network model. Fire detection can be performed through a lightweight neural network, making this method suitable for edge devices, and suspected flame areas can be identified to locate the fire point.
[0011] In some optional implementations, constructing a flame tri-map for an image includes:
[0012] Extract the characteristic area in the image that is sensitive to the flame characteristics and obtain the segmented flame area;
[0013] Normalizing the image with the segmented flame region to obtain a standardized image;
[0014] Perform an erosion operation on the segmented flame area in the standardized image to remove the noise area that is sensitive to the flame characteristics and obtain the known foreground area;
[0015] Perform dilation and color flipping on the known foreground area to obtain the known background area;
[0016] According to the known foreground area and the known background area, the unknown area is calculated to obtain the flame trisection map.
[0017] In the above technical scheme, the segmented flame area is first obtained by feature extraction, and the segmented flame area in the standardized image is corroded to remove the noise area sensitive to the flame feature to obtain the known foreground area. The known foreground area is then expanded and color-flipped to obtain the background area, and the unknown area is calculated to obtain a rough flame trisection map.
[0018] In some optional implementations, after calculating the unknown area based on the known foreground area and the known background area to obtain the flame trisection map, the method further includes:
[0019] Calculate the spatial distance and color distance between the unknown area pixels and the known foreground or background area pixels respectively, and determine whether the spatial distance and color distance meet the following requirements:
[0020] (D(z,q)<E t )∧(||I z -I q ||≤(C t -D(z,q)
[0021] Where z is the unknown pixel, and q is the known foreground or background pixel. Iz and Iq are the RGB color values of the corresponding pixels. D(z,q) is the Euclidean distance formula; Et and Ct are the spatial distance threshold and color distance threshold, respectively.
[0022] If the condition is satisfied, the unknown area pixels are divided into the known foreground area or the known background area. If not, the unknown area pixels are kept unchanged.
[0023] In the above technical solution, the spatial distance and color distance between the pixels in the unknown area and the known foreground area are calculated. When it is determined that the spatial distance and color distance meet the threshold condition, the pixels in the unknown area are re-divided into the known foreground area or the known background area. That is, by further refining the rough flame triangulation map, a finer flame triangulation map can be obtained.
[0024] In some optional implementations, after performing dilation and color flipping on the known foreground region to obtain the known background region, the method further includes:
[0025] If the known background region does not exist, the dilation operation is repeated using a smaller dilation unit.
[0026] In the above technical solution, when performing an expansion operation on a known foreground area, if the expansion structure unit used is too large, the background area will not be recognizable. At this time, it is necessary to use a smaller expansion structure unit to re-perform the expansion operation and then perform color flipping to obtain the known background area.
[0027] In some optional implementations, extracting a characteristic region in the image that is sensitive to flame characteristics to obtain a segmented flame region includes:
[0028] Extract multiple feature maps sensitive to flame features through a pre-trained lightweight convolutional neural network;
[0029] Add and average the selected multiple feature maps to obtain the average activation map;
[0030] The average activation map is binarized to obtain the segmented flame region.
[0031] In the above technical solution, a lightweight convolutional neural network is used to extract multiple feature maps that are sensitive to flame features, so that this method can be applied to edge devices.
[0032] In some optional embodiments, a plurality of feature maps sensitive to flame features are extracted by a pre-trained lightweight convolutional neural network, including:
[0033] By forward propagating the pre-trained SqueezeNet image, multiple feature maps sensitive to flame features are extracted from the 7th layer of the SqueezeNet model.
[0034] In some optional implementations, extracting a feature region in the image that is sensitive to flame features to obtain a segmented flame region further includes:
[0035] If the segmented flame area does not exist, it is directly determined that there is no fire.
[0036] In the above technical solution, if there is no area in the image that is sensitive to flame features, the segmented flame area does not exist, and it can be quickly determined that there is no fire without the need for subsequent judgment. This shortens the judgment time, improves detection efficiency, and reduces computing pressure, allowing the edge device to use computing resources for fire detection in other images.
[0037] In some optional embodiments, the lightweight neural network includes SqueezeNet.
[0038] A flame detection system provided in an embodiment of the present application includes:
[0039] An image acquisition module, used for acquiring an image to be detected;
[0040] A three-part image calculation module is used to construct a flame three-part image for the image, and the foreground area of the flame three-part image is the flame foreground;
[0041] The suspected area acquisition module is used to divide the flame into three parts, calculate the opaque mask of the flame foreground by using the image cutout algorithm, and obtain the suspected flame area;
[0042] The classification and recognition module is used to use a lightweight neural network to classify and identify suspected flame areas to determine whether a fire has occurred.
[0043] In the above technical solution, the image acquisition module acquires the image to be detected, the tripartite graph calculation module constructs a flame tripartite graph for the image to be detected, and the suspected area acquisition module removes irrelevant background interference. Finally, the classification and recognition module re-detects the suspected flame area, thereby improving the accuracy of flame detection and reducing the requirements for the flame detection performance of the network model. Fire detection can be performed through a lightweight neural network, making this method suitable for edge devices, and identifying suspected flame areas to achieve the location of the fire point.
[0044] An electronic device provided in an embodiment of the present application includes: a processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the machine-readable instructions are executed by the processor, any of the above methods is performed.
[0045] An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, any of the above methods is executed. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0047] Figure 1 A flame detection method step flow chart provided in an embodiment of the present application;
[0048] Figure 2 A flowchart of the steps of constructing a flame trisection diagram for an image provided in an embodiment of the present application;
[0049] Figure 3 A flowchart of the steps for obtaining the segmented flame area provided in an embodiment of the present application;
[0050] Figure 4 A flowchart of a device for applying a flame detection method provided in an embodiment of the present application;
[0051] Figure 5 A functional module diagram of a flame detection system provided in an embodiment of the present application;
[0052] Figure 6 A possible structure of an electronic device provided in an embodiment of the present application.
[0053] Icon: 1-image acquisition module, 2-tri-image calculation module, 3-suspected area acquisition module, 4-classification and recognition module, 51-processor, 52-memory, 53-communication interface, 54-communication bus. DETAILED DESCRIPTION
[0054] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0055] One or more embodiments of the present application provide a flame detection method, system, and computer-readable storage medium for re-detecting a suspected flame area while removing irrelevant background interference.
[0056] Please refer to Figure 1 , Figure 1 A flame detection method step flow chart provided in an embodiment of the present application includes:
[0057] Step 100: Acquire an image to be detected;
[0058] Step 200, constructing a flame trisection map for the image, wherein the foreground area of the flame trisection map is the flame foreground;
[0059] Step 300: for the flame trisection image, an opaque mask of the flame foreground is calculated using an image cutout algorithm, and a suspected flame area is obtained;
[0060] Step 400: Use a lightweight neural network to classify and identify suspected flame areas to determine whether a fire has occurred.
[0061] In the embodiment of the present application, a flame trisection map is constructed for the image to be detected, and the suspected flame area is re-detected under the premise of removing irrelevant background interference, thereby improving the accuracy of flame detection and reducing the requirements for the flame detection performance of the network model. Fire detection can be performed through a lightweight neural network, making the method suitable for edge devices, and identifying suspected flame areas to achieve the location of the fire point.
[0062] Please refer to Figure 2 , Figure 2 A flowchart of the steps of constructing a flame trisection diagram for an image provided in an embodiment of the present application.
[0063] Step 210, extracting the characteristic region in the image that is sensitive to the flame characteristic, and obtaining the segmented flame region;
[0064] Step 220, standardizing the image with the segmented flame region to obtain a standardized image;
[0065] Step 230, performing an erosion operation on the segmented flame region in the standardized image to remove the noise region that is sensitive to the flame feature, and obtaining a known foreground region;
[0066] Step 240: dilate and color-flip the known foreground region to obtain a known background region;
[0067] Step 250: Calculate the unknown area based on the known foreground area and the known background area to obtain a flame trisection map.
[0068] In an embodiment of the present application, a segmented flame area is first obtained by feature extraction, and an erosion operation is performed on the segmented flame area in the standardized image to remove the noise area sensitive to the flame feature to obtain a known foreground area. The known foreground area is then expanded and color-flipped to obtain a background area, and the unknown area is calculated to obtain a rough flame trisection map.
[0069] In some optional implementations, after calculating the unknown area based on the known foreground area and the known background area to obtain the flame trisection map, the method further includes:
[0070] Step 251, respectively calculate the spatial distance and color distance between the unknown area pixels and the known foreground or background area pixels, and determine whether the spatial distance and color distance satisfy:
[0071] (D(z,q)<Et)∧(||I z -I q ||≤(C t -D(z,q)
[0072] Where z is the unknown pixel, and q is the known foreground or background pixel. Iz and Iq are the RGB color values of the corresponding pixels. D(z,q) is the Euclidean distance formula; Et and Ct are the spatial distance threshold and color distance threshold, respectively.
[0073] Step 252: If the condition is satisfied, the unknown region pixels are divided into the known foreground region or the known background region. If the condition is not satisfied, the unknown region pixels are kept unchanged.
[0074] Among them, when q is a known foreground area pixel, if the spatial distance and color distance meet the threshold conditions of the above formula, the corresponding unknown area pixel point z is reclassified into the known foreground area. When q is a known background area pixel, if the spatial distance and color distance meet the threshold conditions of the above formula, the corresponding unknown area pixel point z is reclassified into the known background area.
[0075] In an embodiment of the present application, the spatial distance and color distance between the pixels in the unknown area and the known foreground area are calculated. When it is determined that the spatial distance and the color distance meet the threshold condition, the pixels in the unknown area are re-divided into the known foreground area or the known background area. That is, a finer flame triangulation can be obtained by further refining the rough flame triangulation map.
[0076] In some optional implementations, after performing dilation and color flipping on the known foreground area to obtain the known background area, the method further includes: Step 241, if the known background area does not exist, re-performing the dilation operation using a smaller dilation structure unit.
[0077] In an embodiment of the present application, when performing an expansion operation on a known foreground area, if the expansion structure unit used is too large, the background area will not be recognizable. At this time, it is necessary to use a smaller expansion structure unit to re-perform the expansion operation and then perform color flipping to obtain the known background area.
[0078] Please refer to Figure 3 , Figure 3 The flowchart of the steps for obtaining the segmented flame area provided in the embodiment of the present application specifically includes:
[0079] Step 211, extracting multiple feature maps sensitive to flame features through a pre-trained lightweight convolutional neural network;
[0080] Step 212: Add and average the selected multiple feature maps to obtain an average activation map;
[0081] Step 213: binarize the average activation map to obtain segmented flame regions.
[0082] In the embodiment of the present application, a lightweight convolutional neural network is used to extract multiple feature maps that are sensitive to flame features, so that the method can be applied to edge devices.
[0083] In some optional embodiments, multiple feature maps sensitive to flame features are extracted through a pre-trained lightweight convolutional neural network, including: extracting multiple feature maps sensitive to flame features from the 7th layer of the SqueezeNet model through a pre-trained SqueezeNet forward propagation image.
[0084] In some optional implementations, extracting a feature region in the image that is sensitive to flame features to obtain a segmented flame region further includes: if the segmented flame region does not exist, directly determining that there is no fire.
[0085] In an embodiment of the present application, if there is no area in the image that is sensitive to flame features, the segmented flame area does not exist, and it can be quickly determined that there is no fire without the need for subsequent judgment. This shortens the judgment time, improves detection efficiency, and reduces computing pressure, so that the edge device can use computing resources for fire detection in other images.
[0086] In some optional embodiments, the lightweight neural network includes SqueezeNet. SqueezeNet is a lightweight and efficient CNN model proposed by Han et al. It has 50x fewer parameters than AlexNet, but its model performance is close to that of AlexNet. Under acceptable performance, small models have many advantages over large models: (1) more efficient distributed training, small models have small parameters, and reduced network communication volume; (2) easy model update, small models, and easy client program update; (3) conducive to deployment on specific hardware such as FPGA because of its limited memory.
[0087] Please refer to Figure 4 , Figure 4 The working flow chart of the equipment for applying the flame detection method includes:
[0088] Get the image to be detected, such as Figure 4 As shown in (a);
[0089] A pre-trained lightweight convolutional neural network is used to extract multiple feature maps that are sensitive to flame features, such as Figure 4 As shown in (b);
[0090] The selected multiple feature maps are added and averaged to obtain the average activation map; the average activation map is binarized to obtain the segmented flame area, such as Figure 4 As shown in (c).
[0091] The image with the segmented flame area is standardized to obtain a standardized image; the segmented flame area in the standardized image is corroded to remove the noise area sensitive to the flame feature to obtain a known foreground area; the known foreground area is expanded and the color is flipped to obtain a known background area; the unknown area is calculated based on the known foreground area and the known background area to obtain a flame trisection map, such as Figure 4 As shown in (d).
[0092] For the flame trisection image, an opaque mask of the flame foreground is calculated using an image cutout algorithm, such as Figure 4 As shown in (e);
[0093] Use the opaque mask to cover the original image to obtain the suspected flame area, such as Figure 4 As shown in (f);
[0094] A lightweight neural network is used to classify and identify the suspected flame area to determine whether a fire has occurred. If a fire is determined to have occurred, a fire alarm is issued.
[0095] Please refer to Figure 5 , Figure 5 A functional module diagram of a flame detection system provided in an embodiment of the present application includes an image acquisition module 1, a tri-image calculation module 2, a suspected area acquisition module 3 and a classification and recognition module 4.
[0096] The image acquisition module 1 is used to acquire the image to be detected. The three-part image calculation module 2 is used to construct a flame three-part image for the image, and the foreground area of the flame three-part image is the flame foreground. The suspected area acquisition module 3 is used to calculate the opaque mask of the flame foreground for the flame three-part image using the image cutout algorithm and obtain the suspected flame area. The classification and recognition module 4 is used to classify and recognize the suspected flame area using a lightweight neural network to determine whether a fire has occurred.
[0097] In the embodiment of the present application, the image acquisition module 1 acquires the image to be detected, the tripartite graph calculation module 2 constructs a flame tripartite graph for the image to be detected, and the suspected area acquisition module 3 removes irrelevant background interference. Finally, the classification and recognition module 4 re-detects the suspected flame area, thereby improving the accuracy of flame detection and reducing the requirements for the flame detection performance of the network model. Fire detection can be performed through a lightweight neural network, making the method suitable for edge device ends, and identifying suspected flame areas to achieve the location of the fire point.
[0098] Figure 6 A possible structure of an electronic device provided in an embodiment of the present application is shown. Figure 6 The electronic device includes: a processor 51, a memory 52 and a communication interface 53. These components are interconnected and communicate with each other through a communication bus 54 and / or other forms of connection mechanisms (not shown).
[0099] The memory 52 includes one or more (only one is shown in the figure), which may be, but not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc. The processor 51 and other possible components may access the memory 52, and read and / or write data therein.
[0100] The processor 51 includes one or more (only one is shown in the figure), which can be an integrated circuit chip with signal processing capabilities. The above-mentioned processor 51 can be a general-purpose processor, including a central processing unit (CPU), a micro control unit (MCU), a network processor (NP) or other conventional processors; it can also be a dedicated processor, including a neural network processor (NPU), a graphics processor (GPU), a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. In addition, when there are multiple processors 51, some of them can be general-purpose processors and the other part can be dedicated processors.
[0101] The communication interface 53 includes one or more (only one is shown in the figure), which can be used to communicate directly or indirectly with other devices to exchange data. The communication interface 53 can include an interface for wired and / or wireless communication.
[0102] One or more computer program instructions may be stored in the memory 52 , and the processor 51 may read and execute these computer program instructions to implement the flame detection method provided in the embodiment of the present application.
[0103] Understandably, Figure 6 The structure shown is for illustration only. The electronic device may also include Figure 6 More or fewer components as shown, or with Figure 6 Different structures are shown. Figure 6 The components shown in the figure can be implemented by hardware, software or a combination thereof. The electronic device may be a physical device, such as a PC, a laptop, a tablet computer, a mobile phone, a server, an embedded device, etc., or a virtual device, such as a virtual machine, a virtualized container, etc. Moreover, the electronic device is not limited to a single device, but may also be a combination of multiple devices or a cluster consisting of a large number of devices.
[0104] The present application also provides a computer-readable storage medium, which stores computer program instructions. When the computer program instructions are read and executed by a computer processor, the flame detection method provided by the present application is executed. For example, the computer-readable storage medium can be implemented as Figure 6 A memory 52 in an electronic device.
[0105] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0106] In addition, the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0107] Furthermore, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0108] In this document, relational terms such as first and second, etc. are used merely to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any such actual relationship or order between these entities or operations.
[0109] The above description is only an embodiment of the present application and is not intended to limit the scope of protection of the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the scope of protection of the present application.
Claims
1. A flame detection method, It is characterized in that include: Acquire an image to be detected; constructing a flame tri-image for the image, wherein the foreground area of the flame tri-image is the flame foreground; For the flame trisection image, an opaque mask of the flame foreground is calculated using an image cutout algorithm, and a suspected flame area is obtained; Using a lightweight neural network, the suspected flame area is classified and identified to determine whether a fire has occurred; The step of constructing a flame trisection map for the image comprises: Extract the characteristic area in the image that is sensitive to the flame characteristics and obtain the segmented flame area; Normalizing the image with the segmented flame region to obtain a standardized image; Perform an erosion operation on the segmented flame area in the standardized image to remove the noise area that is sensitive to the flame characteristics and obtain the known foreground area; Perform dilation and color flipping on the known foreground area to obtain the known background area; According to the known foreground area and the known background area, the unknown area is calculated to obtain the flame trisection map; After calculating the unknown area according to the known foreground area and the known background area to obtain the flame trisection map, the method further includes: Calculate the spatial distance and color distance between the unknown area pixels and the known foreground or background area pixels respectively, and determine whether the spatial distance and color distance satisfy: (D(z,q) <Et)(||Iz-Ill≤(Ct-D(z,q)) Where z is a pixel in the unknown area, q is a known pixel in the foreground or background area; Iz and Iq are the RGB color values of the corresponding pixels; D(z,q) is the Euclidean distance formula; Et and Ct are the spatial distance threshold and color distance threshold, respectively; If satisfied, the unknown area pixels are divided into a known foreground area or a known background area.
2. The method according to claim 1, It is characterized in that After the known foreground region is expanded and the color is flipped to obtain the known background region, the method further includes: If the known background region does not exist, the dilation operation is repeated using a smaller dilation unit.
3. The method according to claim 1, It is characterized in that The step of extracting a characteristic region in the image that is sensitive to flame characteristics to obtain a segmented flame region includes: Extract multiple feature maps sensitive to flame features through a pre-trained lightweight convolutional neural network; Add and average the selected multiple feature maps to obtain the average activation map; The average activation map is binarized to obtain the segmented flame region.
4. The method according to claim 1, It is characterized in that The method includes extracting multiple feature maps sensitive to flame features through a pre-trained lightweight convolutional neural network, including: By forward propagating the pre-trained SqueezeNet image, multiple feature maps sensitive to flame features are extracted from the 7th layer of the SqueezeNet model.
5. The method according to claim 1, It is characterized in that The step of extracting a characteristic region in the image that is sensitive to flame characteristics to obtain a segmented flame region also includes: If the divided flame area does not exist, it is determined that there is no fire.
6. The method according to claim 1, It is characterized in that The lightweight neural network includes SqueezeNet.
7. A flame detection system, It is characterized in that include: An image acquisition module, used for acquiring an image to be detected; The tri-map calculation module is used to construct a flame tri-map for the image, wherein the foreground area of the flame tri-map is the flame foreground; the step of constructing the flame tri-map for the image includes: Extract the characteristic area in the image that is sensitive to the flame characteristics and obtain the segmented flame area; Normalizing the image with the segmented flame region to obtain a standardized image; Perform an erosion operation on the segmented flame area in the standardized image to remove the noise area that is sensitive to the flame characteristics and obtain the known foreground area; Perform dilation and color flipping on the known foreground area to obtain the known background area; According to the known foreground area and the known background area, the unknown area is calculated to obtain the flame trisection map; After calculating the unknown area according to the known foreground area and the known background area to obtain the flame trisection map, the method further includes: Calculate the spatial distance and color distance between the unknown area pixels and the known foreground or background area pixels respectively, and determine whether the spatial distance and color distance satisfy: (D(z,q) <E)∧(||Iz-Ill≤(C-D(2,q)) Where z is a pixel in the unknown area, q is a known pixel in the foreground or background area; Iz and Iq are the RGB color values of the corresponding pixels; D(z,q) is the Euclidean distance formula; Et and Ct are the spatial distance threshold and color distance threshold, respectively; If satisfied, the unknown area pixels are divided into a known foreground area or a known background area; A suspected region acquisition module is used to calculate the opaque mask of the flame foreground by using an image cutout algorithm for the flame trisection image, and obtain a suspected flame region; The classification and recognition module is used to classify and recognize the suspected flame area using a lightweight neural network to determine whether a fire has occurred.
8. A computer-readable storage medium, It is characterized in that The storage medium stores a computer program, which, when executed by a processor, executes the method according to any one of claims 1 to 6.
