Video image type fire flame real-time detection method
Through the video image-type fire detection method based on the change of flame eccentricity, the problem that traditional fire detection methods cannot be detected in time in the early stage of the fire is solved, and fast and accurate flame recognition and alarm are achieved, improving the reliability and safety of flame monitoring.
Patent Information
- Application Number
- CN202411790106.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-03-07
AI Technical Summary
Traditional fire detection methods cannot detect fires in time when the flame is small in the early stage of the fire or when there is no obvious smoke or temperature changes in the fire source, and there are problems such as high false alarm rate and slow response time.
A video image-type fire detection method based on flame eccentricity changes is adopted, and color images are extracted in real time through the camera, and suspected flame areas are extracted in the RGB and HSV color ranges, and the eccentricity and changes of the adjacent three frames of flame, and the angle is calculated, and the threshold is set to give a fire alarm.
It realizes rapid and accurate identification and extraction of suspected flame images, with significant computing speed advantages and high detection accuracy, and can maintain excellent performance in complex environments, reduce false detection problems, and improve the reliability and safety of flame monitoring.
Smart Images

Figure CN119580418A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a video image type fire flame real-time detection method. Background Art
[0002] With the rapid development of modern society, the frequency and destructiveness of fires are increasing. Fires not only pose a serious threat to people's lives and property, but also cause huge losses to society and the economy. Traditional fire detection methods mostly rely on smoke detectors, temperature sensors, etc., but these methods have certain limitations, such as small sensor coverage, slow response time, and high false alarm rate. Furthermore, these methods may not be able to detect the fire in time when the flame is small at the beginning of the fire or there is no obvious smoke and temperature change in the fire source. Therefore, the development of efficient and intelligent real-time fire detection systems, especially fire detection technology based on video images, is of vital importance to protecting people's lives and property and reducing fire losses.
[0003] The video image fire detection method relies on modern video surveillance technology and computer vision technology. It can capture the image information of the fire scene through the camera, and use image processing and pattern recognition technology to analyze in real time to determine whether a fire has occurred. Compared with traditional sensor detection, this method has great advantages. Therefore, using video images for real-time fire detection has become an important research direction.
[0004] The present invention proposes a real-time fire detection method based on the change of flame eccentricity, which mainly extracts color images in real time through a camera, extracts suspected flame areas in the RGB and HSV color ranges, calculates the flame eccentricity and change, and angle of three adjacent frames, and sets the eccentricity, eccentricity change and angle thresholds to give a fire alarm. The method of the invention has simple calculation, fast detection speed, high accuracy, can eliminate the influence of interference from moving suspected flames, fixed or moving lights, and can be widely used in fixed-lens monitoring places such as offices, warehouses, and computer rooms. Summary of the invention
[0005] The present invention provides a video image type fire flame real-time detection method in order to solve the above problems in the prior art.
[0006] The technical solutions adopted in the present invention are:
[0007] A video image type fire flame real-time detection method comprises the following steps:
[0008] 1) Continuously read 3 frames of RGB color images from the video image, and reduce the resolution of the 3 frames to half of the original.
[0009] 2) Perform RGB color detection on the three color images, then perform HSV mode transformation and corresponding color detection on the detected images. The suspected flame binary images after detection are recorded as BW1, BW2, and BW3 respectively;
[0010] 3) The eight-neighborhood flame connected area is calculated and labeled for the flame binary images BW1, BW2, and BW3 respectively. The flame connected area images after calculation are CC1, CC2, and CC3 respectively;
[0011] 4) Calculate the eccentricity and area of each flame connected region in the three images CC1, CC2, and CC3 respectively, and find the connected region with the largest area in CC1, CC2, and CC3 respectively. The corresponding connected regions are recorded as L1, L2, and L3 respectively;
[0012] 5) Calculate the external eccentricity of the maximum connected area of the three connected areas, which are respectively: E1, E2, and E3;
[0013] 6) Calculate the angle θ between the outside of the largest connected area and the positive direction of the X-axis for the three connected areas, which are θ1, θ2, and θ3 respectively;
[0014] 7) Calculate the absolute value of the difference between the three-frame flame eccentricity E1, E2, and E3, that is, PL1 = |E1-E2|, PL2 = |E1-E3|, PL3 = |E2-E3|;
[0015] 8) Set the flame judgment conditions and determine whether to issue a fire alarm based on the judgment results of the judgment conditions.
[0016] Furthermore, in step 5), the process of calculating the external eccentricity of the maximum connected area is:
[0017] Find the point A with the minimum ordinate (x A ,y A ) and the maximum value point B (x B ,y B ), calculate the Euler distance between points AB, denoted as L_AB;
[0018] Find the point C with the minimum horizontal coordinate (x C ,y C ) and the maximum value D point (x D ,y D ), calculate the Euler distance between points CD, recorded as L_CD, and the eccentricity E1 is calculated as follows:
[0019]
[0020] In the same way, E2 and E3 can be calculated.
[0021] Furthermore, in step 6), the process of calculating θ is:
[0022] In the L1 binary connected region, determine the value of the straight lines L_AB and L_CD, and find the coordinates of the two points (x1, y1) and (x2, y2) with the largest distance between the two straight lines. If L_AB>L_CD, then otherwise The calculation formula of the angle θ between the maximum distance straight line and the positive direction of the X-axis is: The same method can be used to calculate θ2 and θ3.
[0023] Furthermore, in step 8), the flame judgment conditions include three types:
[0024] The flame judgment condition 1 is: the values of E1, E2, and E3 are all greater than Ethreshold, that is,
[0025] Flame judgment condition 2 is: the angles of θ1, θ2, and θ3 are between 10 and 90 degrees, that is,
[0026] Flame judgment condition 3 is: PL1, PL2, PL3 values are all greater than PLthreshold, that is
[0027] If the logical relationship among conditions 1, 2 and 3 is true, a suspected flame image is output and a fire alarm is issued; otherwise, if the logical value is false, no fire alarm is issued and both return to step 1) to continue collecting and detecting.
[0028] Furthermore, the PLthreshold varies in the range of 0.01 to 0.05, and the Ethreshold varies in the range of 0.5 to 1.
[0029] Furthermore, the threshold value of PLthreshold is set to 0.05, and the threshold value of Ethreshold is set to 0.5.
[0030] The present invention has the following beneficial effects:
[0031] The present invention can quickly and accurately identify and extract qualified suspected flame images. This method not only has significant advantages in computing speed and can meet the needs of various real-time monitoring systems, but also performs well in detection accuracy, ensuring efficient capture of real flames. In addition, the present invention can still maintain excellent performance in complex environments, especially when facing warm light sources similar to the color of flames or mobile interference objects similar to the shape of flames, it shows extremely strong anti-interference ability. This effectively avoids the common false detection problems in traditional detection systems and greatly improves the reliability and safety of flame monitoring. Through this method, not only can unnecessary human intervention be reduced, but also timely warnings can be given in the early stages of fires, providing strong technical support for fire prevention and disaster reduction. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 This is the flame video detection effect.
[0033] Figure 2 Fixed warm light similar to the color of flames interferes with the video detection effect.
[0034] Figure 3 The video detection effect is disturbed by the movement of the flames.
[0035] Figure 4 It is a flow chart of the present invention. DETAILED DESCRIPTION
[0036] The present invention will be further described below in conjunction with the accompanying drawings.
[0037] In this embodiment, the flame video is a network downloaded video test1.avi. Figure 1 , warm lights similar to flame colors interfere with video such as Figure 2 , moving interference video similar to the flame color, such as Figure 3 ,The method is implemented using software matlab2023b.
[0038] This embodiment has the following specific steps:
[0039] (1) Reading video image data: Continuously read three frames of RGB color images, image(i), image(i+1), and image(i+2), and reduce the resolution of the three frames to half of the original ones, respectively, and record them as IMG1, IMG2, and IMG3, where i is the frame variable, i=1,2,3┉.
[0040] (2) Flame region segmentation: RGB color detection is first performed on the three color images IMG1, IMG2, and IMG3. After detection, the RGB color images are RGB_IMG1, RGB_IMG2, and RGB_IMG3. Then, HSV mode transformation and corresponding color detection are performed on RGB_IMG1, RGB_IMG2, and RGB_IMG3. After detection, the suspected flame binary images are recorded as BW1, BW2, and BW3, respectively.
[0041] (3) Analysis and calculation of flame connected regions: The eight-neighborhood connected regions of the BW1, BW2, and BW3 binary images are calculated and labeled. The calculated connected region images are CC1, CC2, and CC3, respectively.
[0042] (4) Searching for the largest connected region: Calculate the eccentricity and area of each connected region for the three images CC1, CC2, and CC3, and find the connected region with the largest area in CC1, CC2, and CC3. The corresponding connected regions are recorded as L1, L2, and L3, respectively.
[0043] (5) Calculation of the external eccentricity of the maximum connected area:
[0044] Find the point A with the minimum ordinate (x A ,y A ) Maximum value point B (x B ,y B ), calculate the Euler distance between points AB, recorded as L_AB; similarly, find the point C with the minimum horizontal coordinate value (x C ,y C ) and the maximum value D point (x D ,y D ), calculate the Euler distance between points CD, recorded as L_CD; the eccentricity E1 is calculated as follows:
[0045]
[0046] The same method can be used to calculate E2 and E3.
[0047] (6)) Calculation of the angle θ between the outside of the maximum connected region and the positive direction of the X-axis: In the L1 binary connected region, determine the values of the straight lines L_AB and L_CD, and find the coordinates of the two points (x1, y1) and (x2, y2) with the largest distance between the two straight lines; that is, if L_AB>L_CD, then otherwise The calculation formula of the angle θ between the maximum distance straight line and the positive direction of the X-axis is: The same method can be used to calculate θ2 and θ3.
[0048] (7) Calculation of eccentricity change: Calculate the absolute value of the difference between the eccentricities E1, E2, and E3 of the three flame frames, that is, PL1 = |E1-E2|, PL2 = |E1-E3|, PL3 = |E2-E3|.
[0049] (8) Setting of flame judgment conditions:
[0050] Flame judgment condition 1 is that the values of E1, E2, and E3 are all greater than Ethreshold, that is,
[0051] Condition 2 is that the angles of θ1, θ2, and θ3 are between 10 and 90 degrees, that is,
[0052] Condition 3 is that the values of PL1, PL2, and PL3 are all greater than PLthreshold, that is,
[0053] The logical relationship among condition 1, condition 2 and condition 3 is AND;
[0054] If the logical relationship among conditions 1, 2 and 3 is that the logical value of the AND is true, a suspected flame image is output and a fire alarm is issued. Otherwise, if the logical value is false, no fire alarm is issued and both return to step 1 to continue collecting and detecting.
[0055] The variation range of PLthreshold is 0.01-0.05, and the variation range of Ethreshold is 0.5-1. The smaller the values of PLthreshold and Ethreshold are, the more sensitive the flame detection is, but it is also easy to cause false detection. The invention sets the thresholds PLthreshold=0.05 and Ethreshold=0.5.
[0056] The above description is only a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements without departing from the principle of the present invention, and these improvements should also be regarded as within the protection scope of the present invention.
Claims
1. A video image type fire flame real-time detection method, characterized in that: The steps include: 1) Continuously read 3 frames of RGB color images from the video image, and reduce the resolution of the 3 frames to half of the original. 2) Perform RGB color detection on the three color images, then perform HSV mode transformation and corresponding color detection on the detected images. The suspected flame binary images after detection are recorded as BW1, BW2, and BW3 respectively; 3) The eight-neighborhood flame connected area is calculated and labeled for the flame binary images BW1, BW2, and BW3 respectively. The flame connected area images after calculation are CC1, CC2, and CC3 respectively; 4) Calculate the eccentricity and area of each flame connected region in the three images CC1, CC2, and CC3 respectively, and find the connected region with the largest area in CC1, CC2, and CC3 respectively. The corresponding connected regions are recorded as L1, L2, and L3 respectively; 5) Calculate the external eccentricity of the maximum connected area of the three connected areas, which are respectively: E1, E2, and E3; 6) Calculate the angle θ between the outside of the largest connected area and the positive direction of the X-axis for the three connected areas, which are θ1, θ2, and θ3 respectively; 7) Calculate the absolute value of the difference between the three-frame flame eccentricity E1, E2, and E3, that is, PL1 = |E1-E2|, PL2 = |E1-E3|, PL3 = |E2-E3|; 8) Set the flame judgment conditions and determine whether to issue a fire alarm based on the judgment results of the judgment conditions.
2. The video image type fire flame real-time detection method as claimed in claim 1, characterized in that: In step 5), the process of calculating the external eccentricity of the maximum connected area is: Find the point A with the minimum ordinate (x A ,y A ) and the maximum value point B (x B ,y B ), calculate the Euler distance between points AB, denoted as L_AB; Find the point C with the minimum horizontal coordinate (x C ,y C ) and the maximum value D point (x D ,y D ), calculate the Euler distance between points CD, recorded as L_CD, and the eccentricity E1 is calculated as follows: In the same way, E2 and E3 can be calculated.
3. The video image type fire flame real-time detection method as claimed in claim 2, characterized in that: In step 6), the process of θ calculation is: In the L1 binary connected region, determine the value of the straight lines L_AB and L_CD, and find the coordinates of the two points (x1, y1) and (x2, y2) with the largest distance between the two straight lines. If L_AB>L_CD, then otherwise The calculation formula of the angle θ between the maximum distance straight line and the positive direction of the X-axis is: The same method can be used to calculate θ2 and θ3.
4. The video image type fire flame real-time detection method as claimed in claim 1, characterized in that: In step 8), the flame judgment conditions include three types: The flame judgment condition 1 is: the values of E1, E2, and E3 are all greater than Ethreshold, that is, Flame judgment condition 2 is: the angles of θ1, θ2, and θ3 are between 10 and 90 degrees, that is, Flame judgment condition 3 is: PL1, PL2, PL3 values are all greater than PLthreshold, that is If the logical relationship among conditions 1, 2 and 3 is true, a suspected flame image is output and a fire alarm is issued; otherwise, if the logical value is false, no fire alarm is issued and both return to step 1) to continue collecting and detecting.
5. The video image type fire flame real-time detection method as claimed in claim 4, characterized in that: The PLthreshold varies in the range of 0.01 to 0.05, and the Ethreshold varies in the range of 0.5 to 1.
6. The video image type fire flame real-time detection method as claimed in claim 5, characterized in that: The set threshold of the PLthreshold is 0.05, and the set threshold of the Ethreshold is 0.5.
Citation Information
Cited By
Fire identification and early warning method based on weather radar
CN120220315A