A smoke detection method and device, electronic equipment and storage medium
By using an image acquisition device with infrared illumination, image regions are divided and differences are calculated for video frames, solving the problem of false detection by smoke detectors under the influence of dust. This achieves high-accuracy and low-cost smoke detection, suitable for large spaces.
Patent Information
- Application Number
- CN202211690079.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-27
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2042-12-27
AI Technical Summary
Existing smoke detectors are easily affected by dust and other particulate matter in the environment, resulting in low smoke detection accuracy, a high risk of false detection, and difficulty in being applied to large indoor spaces, as well as high maintenance costs.
An image acquisition device with infrared illumination is used to divide video frames into image regions, calculate indicators such as the mean and standard deviation of differences, determine the smoke area, and output alarm information when preset conditions are met.
It improves the accuracy of smoke detection, avoids false detections, is suitable for larger indoor spaces, and reduces maintenance costs.
Smart Images

Figure CN116129305B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, and in particular to a smoke detection method and device, electronic equipment and a storage medium. BACKGROUND
[0002] In the early stage of a fire, a large amount of smoke is generated due to insufficient combustion of combustible materials, which is an important phenomenon of early fire, and therefore, smoke detection and alarm are important means of fire detection, which have wide applications. For example, for zero-visibility industrial scenes such as transformer substations, smoke detection is an important part of fire prevention.
[0003] In related technologies, the alarm device for fire detection is a smoke detector. The physical element in the smoke detector can sense the smoke concentration and environmental temperature in the air, and trigger an alarm according to the changes in the smoke concentration and environmental temperature in the air when a fire occurs. However, the smoke detector is easily affected by dust and other particulate matters in the environment, resulting in low accuracy of smoke detection and easy false detection. SUMMARY
[0004] The purpose of the embodiments of the present application is to provide a smoke detection method, device, electronic equipment and storage medium to improve the accuracy of smoke detection and avoid false detection. The specific technical solutions are as follows:
[0005] In a first aspect, to achieve the above-mentioned purpose, the embodiments of the present application provide a smoke detection method, which comprises:
[0006] Obtaining a video containing a target scene collected by an image collection device as a to-be-processed video, wherein the image collection device is a device with infrared light supplement function;
[0007] Dividing each first video frame in the to-be-processed video into a plurality of image regions as first image regions;
[0008] For each first image region, calculating the difference value of the pixel values of the first image region and the corresponding image region in the second video frame as the difference pixel value of the first image region, and calculating the average value of the difference pixel values of the first image region as the difference average value of the first image region, wherein the second video frame is a video frame located before the first video frame;
[0009] Based on the difference average values of the first image regions, determining the image region that meets the first smoke detection condition from each first image region in the first video frame as a second image region;
[0010] determine, from the second image regions in the first video frame, an image region satisfying a second smoke detection condition as a third image region, based on a position of each second image region in the first video frame;
[0011] output alarm information for the target scene when the third image region containing smoke in each first video frame satisfies a preset alarm condition.
[0012] Optionally, the determining, from the first image regions in the first video frame, an image region satisfying a first smoke detection condition as a second image region based on the difference mean value of each first image region includes:
[0013] determining, from the first image regions in the first video frame, an image region corresponding to an absolute value of a difference mean value greater than a first threshold value, a standard deviation of the difference mean value less than a second threshold value, and a quotient of the absolute value and the standard deviation of the difference mean value greater than a third threshold value as the second image region.
[0014] Alternatively,
[0015] determining, from the first image regions in the first video frame, an image region corresponding to an absolute value of a difference mean value greater than a first threshold value, a standard deviation of the difference mean value less than a second threshold value, and a quotient of the absolute value and the standard deviation of the difference mean value greater than a third threshold value as the second image region.
[0016] Optionally, the determining, from the first image regions in the first video frame, an image region satisfying a first smoke detection condition as a second image region based on the difference pixel value of each first image region includes:
[0017] obtaining a median of the absolute values of the difference mean values corresponding to the first image regions in the first video frame as a first median, and obtaining a median of the standard deviations of the difference mean values corresponding to the first image regions in the first video frame as a second median;
[0018] for each first image region in the first video frame, calculating a quotient of the absolute value of the difference mean value corresponding to the first image region and the first median as a first quotient value, and calculating a quotient of the standard deviation of the difference mean value corresponding to the first image region and the second median as a second quotient value;
[0019] determining, from the first image regions in the first video frame, an image region corresponding to the first quotient value and the second quotient value satisfying a first smoke detection condition as a second image region; wherein the first smoke detection condition is that the corresponding first quotient value is greater than a fourth threshold value and the corresponding second quotient value is less than a fifth threshold value; or the first smoke detection condition is that the corresponding first quotient value is greater than a fourth threshold value, the corresponding second quotient value is less than a fifth threshold value, and a quotient of the first quotient value and the second quotient value is greater than a sixth threshold value.
[0020] Optionally, the determining the image region satisfying the second smoke detection condition from the second image regions in the first video frame as the third image region comprises:
[0021] performing target detection on each video frame in the video to be processed to obtain image regions containing the specified object in the video as the fourth image regions;
[0022] for each second image region in the first video frame, judging whether the second image region and the fourth image regions in the first video frame have an overlapping region based on the position of the second image region in the first video frame;
[0023] if the second image region and the fourth image regions in the first video frame have no overlapping region, judging whether the second image region and the fourth image regions in the second video frame have an overlapping region based on the position of the second image region in the first video frame;
[0024] if the second image region and the fourth image regions in the second video frame have no overlapping region, determining the second image region as the third image region containing smoke.
[0025] Optionally, the method further comprises:
[0026] in the case that the second image region and the fourth image regions in the first video frame have an overlapping region or the second image region and the fourth image regions in the second video frame have an overlapping region, determining that the second image region does not contain smoke.
[0027] Optionally, before outputting the alarm information for the target scene when the third image regions containing smoke in each first video frame satisfy the preset alarm condition, the method further comprises:
[0028] for each first video frame, if the median of the absolute values of the difference means corresponding to the first image regions in the first video frame is greater than a seventh threshold, determining that the first video frame does not contain image regions containing smoke.
[0029] Optionally, before outputting the alarm information for the target scene when the third image regions containing smoke in each first video frame satisfy the preset alarm condition, the method further comprises:
[0030] for each first video frame, if the number of the third image regions in the first video frame is less than a first number, determining that the first video frame does not contain image regions containing smoke.
[0031] Optionally, the alarm condition is that the third image region containing smoke exists in a second number of continuous video frames in the to-be-processed video; or, the alarm condition is that a number of video frames in which the third image region containing smoke exists in the to-be-processed video is greater than a third number.
[0032] In a second aspect, to achieve the above object, an embodiment of the present application provides a smoke detection device, which comprises:
[0033] a to-be-processed video acquisition module configured to acquire a video containing a target scene collected by an image collection device as a to-be-processed video, wherein the image collection device is a device with infrared light supplement function;
[0034] a first image region determination module configured to divide each first video frame in the to-be-processed video into a plurality of image regions as first image regions;
[0035] a difference mean value determination module configured to calculate, for each first image region, a difference value of pixel values of the first image region and a corresponding image region in a second video frame as a difference pixel value of the first image region, and calculate a mean value of the difference pixel values of the first image region as a difference mean value of the first image region, wherein the second video frame is a video frame located before the first video frame;
[0036] a second image region determination module configured to determine, from each first image region in the first video frame, an image region satisfying a first smoke detection condition as a second image region based on the difference mean value of each first image region;
[0037] a third image region determination module configured to determine, from each second image region in the first video frame, an image region satisfying a second smoke detection condition as a third image region based on a position of each second image region in the first video frame;
[0038] an alarm module configured to output alarm information for the target scene when the third image region containing smoke in each first video frame satisfies a preset alarm condition.
[0039] Optionally, the second image region determination module is specifically configured to determine, from each first image region in the first video frame, an image region in which an absolute value of a corresponding difference mean value is greater than a first threshold value and a standard deviation of the corresponding difference mean value is less than a second threshold value as a second image region;
[0040] or,
[0041] From the first image regions in the first video frame, determine an image region as a second image region, if the absolute value of the corresponding difference mean is greater than a first threshold, the standard deviation of the corresponding difference mean is less than a second threshold, and the quotient of the absolute value and the standard deviation of the corresponding difference mean is greater than a third threshold.
[0042] Optionally, the second image region determining module is specifically configured to obtain a median of the absolute values of the difference means corresponding to the first image regions in the first video frame as a first median, and obtain a median of the standard deviations of the difference means corresponding to the first image regions in the first video frame as a second median.
[0043] For each first image region in the first video frame, calculate the quotient of the absolute value of the difference mean corresponding to the first image region and the first median as a first quotient value, and calculate the quotient of the standard deviation of the difference mean corresponding to the first image region and the second median as a second quotient value.
[0044] From the first image regions in the first video frame, determine an image region as a second image region, if the corresponding first quotient value and second quotient value satisfy a first smoke detection condition; wherein the first smoke detection condition is that the corresponding first quotient value is greater than a fourth threshold, and the corresponding second quotient value is less than a fifth threshold; or the first smoke detection condition is that the corresponding first quotient value is greater than the fourth threshold, the corresponding second quotient value is less than the fifth threshold, and the quotient of the corresponding first quotient value and second quotient value is greater than a sixth threshold.
[0045] Optionally, the third image region determining module is specifically configured to perform target detection on each video frame in the video to be processed to obtain an image region containing a specified object in each video as a fourth image region.
[0046] For each second image region in the first video frame, determine whether the second image region and the fourth image region in the first video frame have an overlapping region based on the position of the second image region in the first video frame.
[0047] If the second image region and the fourth image region in the first video frame do not have an overlapping region, determine whether the second image region and the fourth image region in the second video frame have an overlapping region based on the position of the second image region in the first video frame.
[0048] If the second image region and the fourth image region in the second video frame do not have an overlapping region, determine the second image region as a third image region containing smoke.
[0049] Optionally, the device further comprises:
[0050] The first processing module is configured to determine that the second image region does not contain smoke when there is an overlapping region between the second image region and a fourth image region in the first video frame or there is an overlapping region between the second image region and a fourth image region in the second video frame.
[0051] Optionally, the device further comprises:
[0052] The second processing module is configured to, before the alarm module outputs the alarm information for the target scene when the third image region containing smoke in each first video frame meets the preset alarm condition, execute the following for each first video frame: if the median of the absolute values of the mean differences of the first image regions in the first video frame is greater than a seventh threshold, it is determined that there is no image region containing smoke in the first video frame.
[0053] Optionally, the device further comprises:
[0054] The third processing module is configured to, before the alarm module outputs the alarm information for the target scene when the third image region containing smoke in each first video frame meets the preset alarm condition, execute the following for each first video frame: if the number of the third image regions in the first video frame is less than a first number, it is determined that there is no image region containing smoke in the first video frame.
[0055] Optionally, the alarm condition is that there is a third image region containing smoke in a second number of continuous video frames in the to-be-processed video; or the alarm condition is that the number of video frames containing the third image region in the to-be-processed video is greater than a third number.
[0056] The embodiment of the present application further provides an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus.
[0057] The memory is used for storing a computer program.
[0058] The processor is used for executing the program stored on the memory, and realizes the steps of the smoke detection method.
[0059] The embodiment of the present application further provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is executed by a processor to realize the steps of the smoke detection method.
[0060] The embodiment of the present application further provides a computer program product comprising instructions which, when executed on a computer, cause the computer to perform the smoke detection method.
[0061] The embodiments of the present application have the following beneficial effects:
[0062] The smoke detection method provided by the embodiments of the present application comprises the following steps: acquiring a video containing a target scene collected by an image collection device as a to-be-processed video; the image collection device is a device with infrared light supplement function; for each first video frame in the to-be-processed video, the first video frame is divided into a plurality of image regions as first image regions; for each first image region, the difference between the pixel values of the first image region and the corresponding image region in a second video frame is calculated as the difference pixel value of the first image region, and the average value of the difference pixel value of the first image region is calculated as the difference average value of the first image region; the second video frame is a video frame located before the first video frame; based on the difference average values of the first image regions, image regions satisfying a first smoke detection condition are determined from the first image regions in the first video frame as second image regions; based on the positions of the second image regions in the first video frame, image regions satisfying a second smoke detection condition are determined from the second image regions in the first video frame as third image regions; when the third image regions containing smoke in each first video frame satisfy a preset alarm condition, alarm information for the target scene is output.
[0063] Based on the above processing, according to the dynamic characteristics of smoke, if smoke appears in the target scene, the pixel values of each video frame in the to-be-processed video will change, and the difference between the pixel values of different video frames is large, therefore, based on the difference pixel values of each first video frame, the third image regions containing smoke can be accurately determined, that is, the smoke detection can be accurately performed, which is not easily affected by dust and other particulate matters in the environment, can improve the accuracy of smoke detection, and avoids false detection. Moreover, the target scene is detected for smoke based on the to-be-processed video containing the target scene, which is not easily affected by the space size of the target scene, is suitable for larger indoor space, and can improve the adaptation range of the smoke detection method. In addition, the target scene is detected for smoke based on the to-be-processed video containing the target scene, without the need to update and maintain the smoke detector, which can reduce the cost of smoke detection.
[0064] Of course, implementing any product or method of the present application does not necessarily require achieving all the advantages described above at the same time. BRIEF DESCRIPTION OF DRAWINGS
[0065] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description only constitute some embodiments of the present application, and other embodiments can also be obtained by those skilled in the art based on these drawings.
[0066] Figure 1 A flow chart of a first smoke detection method provided for an embodiment of the present application;
[0067] Figure 2 A flow chart of a second smoke detection method provided for an embodiment of the present application;
[0068] Figure 3 A flow chart of a third smoke detection method provided for an embodiment of the present application;
[0069] Figure 4 A flow chart of a fourth smoke detection method provided for an embodiment of the present application;
[0070] Figure 5 A flow chart of a fifth smoke detection method provided for an embodiment of the present application;
[0071] Figure 6 A flow chart of a sixth smoke detection method provided for an embodiment of the present application;
[0072] Figure 7 A structure diagram of a smoke detection device provided for an embodiment of the present application;
[0073] Figure 8 A structure diagram of an electronic device provided for an embodiment of the present application. DETAILED DESCRIPTION
[0074] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art based on the present application belong to the scope of protection of the present application.
[0075] In the related art, fire detection is performed by a smoke detector. The smoke detector is easily affected by dust and other particulate matters in the environment, resulting in low accuracy of smoke detection and easy false detection. Moreover, the smoke detector will only trigger an alarm when the concentration of smoke in the space or the rise in ambient temperature reaches a certain degree. The concentration of smoke or the rise in ambient temperature in a larger indoor space is slow, so the smoke detector is difficult to be applied to a larger indoor space, that is, the existing smoke detection method has a narrow range of adaptation. In addition, the sensitivity of the smoke detector decreases over time, and the cost required for updating and maintaining the smoke detector is high, that is, the cost of smoke detection is high.
[0076] To solve the above problems, the embodiment of the present application provides a smoke detection method, which is applied to an electronic device, and the electronic device can acquire a to-be-processed video containing a target scene collected by an image collection device; the image collection device is a device with infrared light supplement function, and according to the method provided by the embodiment of the present application, the target scene is detected based on the pixel value of each first video frame in the to-be-processed video, the third image region containing smoke in each first video frame can be determined, and then when the third image region containing smoke in each first video frame meets a preset alarm condition, alarm information for the target scene can be output.
[0077] Based on the above processing, according to the dynamic characteristics of smoke, if smoke appears in the target scene, the pixel value of each video frame in the to-be-processed video will change, and the difference between the pixel values of different video frames is large, therefore, based on the difference pixel value of each first video frame, the third image region containing smoke can be accurately determined, that is, the smoke detection can be accurately performed, which is not easily affected by dust and other particulate matters in the environment, and the accuracy of smoke detection can be improved. Moreover, the target scene is detected based on the to-be-processed video containing the target scene, which is not easily limited by the space size of the target scene, is suitable for larger indoor space, and can improve the adaptation range of the smoke detection method. In addition, the target scene is detected based on the to-be-processed video containing the target scene, without the need to update and maintain the smoke detector, and the cost of smoke detection can be reduced.
[0078] Referring to Figure 1 , Figure 1 A flowchart of a smoke detection method provided by the embodiment of the present application is provided, and the method comprises the following steps:
[0079] S101: Acquire a video containing a target scene collected by an image collection device as a to-be-processed video.
[0080] The image collection device is a device with infrared light supplement function.
[0081] S102: For each first video frame in the to-be-processed video, divide the first video frame into a plurality of image regions as first image regions.
[0082] S103: For each first image region, calculate the difference value between the pixel value of the first image region and the corresponding image region in the second video frame as the difference pixel value of the first image region, and calculate the average value of the difference pixel value of the first image region as the difference average value of the first image region.
[0083] The second video frame is a video frame located before the first video frame.
[0084] S104: Determine, from each first image region in the first video frame, an image region satisfying a first smoke detection condition as a second image region based on the difference mean of each first image region.
[0085] S105: Determine, from each second image region in the first video frame, an image region satisfying a second smoke detection condition as a third image region based on the position of each second image region in the first video frame.
[0086] S106: Output alarm information for the target scene when the third image region containing smoke in each first video frame satisfies a preset alarm condition.
[0087] Based on the smoke detection method provided in the embodiments of the present application, according to the dynamic characteristics of smoke, if smoke appears in the target scene, the pixel values of each video frame in the video to be processed will change, and the difference between the pixel values of different video frames is large. Therefore, based on the difference pixel values of each first video frame, the third image region containing smoke can be accurately determined, that is, the smoke detection can be accurately performed, which is not easily affected by dust and other particulate matters in the environment, can improve the accuracy of smoke detection, and avoid false detection. Moreover, the target scene is detected for smoke based on the video to be processed containing the target scene, which is not easily limited by the space size of the target scene, is suitable for larger indoor space, and can improve the adaptation range of the smoke detection method. In addition, the target scene is detected for smoke based on the video to be processed containing the target scene, without the need to update and maintain the smoke detector, which can reduce the cost of smoke detection.
[0088] For step S101, the target scene can be any scene in an industrial production environment, for example, a substation, etc. The image acquisition device is arranged in the target scene to acquire a video containing the target scene (i.e. the video to be processed).
[0089] The image acquisition device can be a device with infrared light compensation function, for example, a camera, a camera with infrared light compensation function, etc. If the target scene is a zero visible light illumination environment, infrared light compensation can be performed by the image acquisition device, and the video to be processed containing the target scene can be acquired. Subsequently, the target scene can be detected for smoke based on the video to be processed according to the method provided in the embodiments of the present application, which can realize smoke detection for the target scene in the zero visible light illumination environment and improve the application range of the smoke detection method.
[0090] In some embodiments, the image acquisition device acquires the video containing the target scene in real time, and the electronic device can acquire a plurality of video segments from the video acquired by the image acquisition device, for example, extract a plurality of video segments from the video acquired by the image acquisition device according to 30 seconds for one video segment, and each video segment is the video to be processed in the embodiments of the present application.
[0091] For step S102, the first video frames can include all video frames in the to-be-processed video. The electronic device can perform frame processing on the to-be-processed video to obtain a plurality of first video frames. Alternatively, the first video frames can include part of the video frames in the to-be-processed video. The electronic device can perform equal-interval frame extraction on the to-be-processed video to obtain a plurality of first video frames. For example, the electronic device can extract a video frame from the to-be-processed video every 3 frames to obtain a plurality of first video frames.
[0092] In an implementation manner, for each first video frame in the to-be-processed video, the electronic device can divide the first video frame according to a preset height and a preset width to obtain a plurality of first image regions with the preset height and the preset width. For example, the width of the i-th first video frame is denoted as Wi, the height of the i-th first video frame is denoted as Hi, the preset width is denoted as Wb, and the preset height is denoted as Hb. The number of first image regions divided horizontally in the first video frame is The number of first image regions divided vertically in the first video frame is The total number of first image regions in the first video frame is N i1 ×N i2 .
[0093] For step S103, for each first video frame, the electronic device can obtain a video frame located before the first video frame from the to-be-processed video according to a preset inter-frame interval to obtain a second video frame corresponding to the first video frame. For example, the first video frame is the 6th frame in the to-be-processed video, and the inter-frame interval is set to 5 frames. The second video frame corresponding to the first video frame can be the 1st frame in the to-be-processed video.
[0094] The to-be-processed video can be a grayscale video. Each video frame in the to-be-processed video is a grayscale image. For each first image region, the pixel value of the first image region is the grayscale value of each pixel point in the first image region.
[0095] For each first image region in the first video frame, the electronic device can determine the position of the first image region in the first video frame, for example, the coordinates of the first image region in the first video frame. Then, the electronic device can determine an image region at the same position from the second video frame corresponding to the first video frame to obtain an image region corresponding to the first image region in the second video frame.
[0096] Then, the electronic device differentiates the pixel values of the first image region and the corresponding image region in the second video frame, that is, for each pixel point in the first image region, the electronic device calculates the difference between the pixel value of the pixel point and the pixel value of the corresponding pixel point in the corresponding image region in the second video frame to obtain the difference pixel value of each pixel point in the first image region. Further, the electronic device can calculate the average value of the difference pixel values of each pixel point in the first image region to obtain the difference average value of the first image region.
[0097] For step S104, for each first image region in the first video frame, if the difference average value of the first image region meets the first smoke detection condition, it indicates that the first image region may contain smoke, and then the electronic device can determine the first image region as the second image region that may contain smoke.
[0098] The electronic device can determine the second image region that meets the first smoke detection condition from each first image region in the first video frame in the following manner.
[0099] Method one:
[0100] The first smoke detection condition is that the absolute value of the corresponding difference average value is greater than a first threshold, and the standard deviation of the corresponding difference average value is less than a second threshold. Correspondingly, step S104 can include the following steps:
[0101] From each first image region in the first video frame, determine the image region whose absolute value of the corresponding difference average value is greater than the first threshold and the standard deviation of the corresponding difference average value is less than the second threshold as the second image region.
[0102] According to the dynamic characteristics of smoke, if smoke appears in the video to be processed, the pixel values of each video frame in the video to be processed will change, and the difference between the pixel values of different video frames is large. Therefore, if the absolute value of the difference average value corresponding to the first image region is greater than the first threshold, smoke may exist in the first image region. If the absolute value of the difference average value corresponding to the first image region is not greater than the first threshold, there is no smoke in the first image region.
[0103] According to the gray mask characteristics of smoke, that is, if smoke appears in the video to be processed, it is equivalent to adding a layer of gray mask to the original picture of each video frame. Therefore, if the standard deviation of the difference average value corresponding to the first image region is less than the second threshold, smoke may exist in the first image region. If the specified object (for example, a person, a vehicle, etc.) in the video to be processed moves, there is no gray mask characteristic, and the pixel values of each pixel point in the first image region will not change as a whole. Therefore, if the standard deviation of the difference average value corresponding to the first image region is not less than the second threshold, there is no smoke in the first image region.
[0104] Correspondingly, the electronic device calculates the absolute value A of the difference mean corresponding to each first image region according to the following formula (1):
[0105]
[0106] The electronic device can also calculate the standard deviation B of the difference mean corresponding to each first image region according to the following formula (2):
[0107]
[0108] Wherein, H b represents the height of the first image region in the cth first video frame; W b represents the width of the first image region in the cth first video frame; b(i,j,c) represents the first image region in the i-th row and the j-th column of the cth first video frame (which can be referred to as the first image region b). x,y∈b(i,j,c) indicates that the pixel point (x,y) belongs to the first image region b in the cth first video frame; f(x,y,c) represents the pixel value of the pixel point (x,y) in the cth first video frame; f[x,y,(c-Δc)] represents the pixel value of the pixel point (x,y) in the second video frame corresponding to the cth first video frame. The second video frame corresponding to the cth first video frame is the (c-Δc)th first video frame, and Δc is a preset inter-frame interval.
[0109] Further, the electronic device can determine, from each first image region in the first video frame, an image region whose absolute value of the corresponding difference mean is greater than a first threshold and whose standard deviation of the corresponding difference mean is less than a second threshold, as a second image region that may exist smoke. That is, for each first image region, if the first image region satisfies the first smoke detection condition, i.e. A>T1 and B<T2, it is determined that the first image region is a second image region that may exist smoke. T1 is the first threshold, and T2 is the second threshold.
[0110] Method two:
[0111] The first smoke detection condition is that the absolute value of the corresponding difference mean is greater than the first threshold, the standard deviation of the corresponding difference mean is less than the second threshold, and the quotient of the absolute value and the standard deviation of the corresponding difference mean is greater than a third threshold. Correspondingly, step S104 can include the following steps:
[0112] From each first image region in the first video frame, determine an image region whose absolute value of the corresponding difference mean is greater than a first threshold, whose standard deviation of the corresponding difference mean is less than a second threshold, and whose quotient of the absolute value and the standard deviation of the corresponding difference mean is greater than a third threshold, as a second image region.
[0113] For each first image region in the first video frame, the electronic device can further calculate, according to formula (3) below, a quotient of the absolute value of the difference mean and the standard deviation corresponding to the first image region.
[0114]
[0115] b(i,j,c) represents a first image region of the i-th row and the j-th column in the c-th first video frame (which can be referred to as first image region b); S represents a quotient of the absolute value of the difference mean and the standard deviation corresponding to the first image region b in the c-th first video frame; H b represents a height of the first image region in the c-th first video frame; W b represents a width of the first image region in the c-th first video frame; x, y ∈ b(i,j,c) represents that a pixel point (x, y) belongs to the first image region b in the c-th first video frame; f(x,y,c) represents a pixel value of the pixel point (x, y) in the c-th first video frame; f[x,y,(c-Δc)] represents a pixel value of the pixel point (x, y) in the second video frame corresponding to the c-th first video frame. The second video frame corresponding to the c-th first video frame is the (c-Δc)-th first video frame, and Δc is a preset inter-frame interval.
[0116] Further, the electronic device determines, from each first image region in the first video frame, an image region for which the absolute value of the difference mean is greater than a first threshold value, the standard deviation of the difference mean is less than a second threshold value, and the quotient of the absolute value and the standard deviation of the difference mean is greater than a third threshold value, that is, an image region for which A > T1, B < T2, and S > T3, as a second image region. T3 is the third threshold value.
[0117] Method three:
[0118] In some embodiments, on the basis of Figure 1 , see Figure 2 , step S104 can include the following steps:
[0119] S1041: Obtain a median of the absolute values of the difference means corresponding to each first image region in the first video frame as a first median, and obtain a median of the standard deviations of the difference means corresponding to each first image region in the first video frame as a second median.
[0120] S1042: For each first image region in the first video frame, calculate a quotient of the absolute value of the difference mean and the first median corresponding to the first image region as a first quotient value, and calculate a quotient of the standard deviation of the difference mean and the second median corresponding to the first image region as a second quotient value.
[0121] S1043: Determine, from the first image regions in the first video frame, an image region for which the corresponding first quotient and second quotient satisfy a first smoke detection condition, as a second image region.
[0122] The first smoke detection condition is that the corresponding first quotient is greater than a fourth threshold value and the corresponding second quotient is less than a fifth threshold value, or the first smoke detection condition is that the corresponding first quotient is greater than the fourth threshold value, the corresponding second quotient is less than the fifth threshold value, and the quotient of the corresponding first quotient and second quotient is greater than a sixth threshold value.
[0123] For each first video frame, the electronic device can sort the absolute values of the difference means corresponding to the first image regions in the first video frame in ascending order to obtain a first sorting result, and obtain a median (i.e., a first median) of the absolute values of the difference means corresponding to the first image regions in the first video frame from the first sorting result. The electronic device can also sort the standard deviations of the difference means corresponding to the first image regions in the first video frame in ascending order to obtain a second sorting result, and obtain a median (i.e., a second median) of the standard deviations of the difference means corresponding to the first image regions in the first video frame from the second sorting result.
[0124] Then, for each first image region, the electronic device can calculate the quotient of the absolute value of the difference mean corresponding to the first image region and the first median as a first quotient, and calculate the quotient of the standard deviation of the difference mean corresponding to the first image region and the second median as a second quotient.
[0125] For example, for each first image region in the first video frame, the electronic device can determine the first quotient M1 corresponding to the first image region according to the following formula (4).
[0126]
[0127] The electronic device can also determine the second quotient M2 corresponding to the first image region according to the following formula (5).
[0128]
[0129] wherein H b represents the height of the first image region in the cth first video frame; W brepresents the width of the first image region in the cth first video frame; b(i,j,c) represents the first image region in the i-th row and the j-th column in the cth first video frame (which can be referred to as a first image region b). x,y∈b(i,j,c) represents that a pixel point (x,y) belongs to the first image region b in the cth first video frame; f(x,y,c) represents a pixel value of the pixel point (x,y) in the cth first video frame; f[x,y,(c-Δc)] represents a pixel value of the pixel point (x,y) in a second video frame corresponding to the cth first video frame. The second video frame corresponding to the cth first video frame is the (c-Δc)th first video frame, and Δc is a preset inter-frame interval. Median() represents obtaining the median of values in the parentheses, and for all b(i,j,c) represents all first image regions in the cth first video frame.
[0130] According to the dynamic characteristics of smoke, if smoke appears in the to-be-processed video, the pixel values of each video frame in the to-be-processed video will change, and the difference between the pixel values of different video frames is large. Therefore, if the first quotient value corresponding to the first image region is greater than the fourth threshold value, smoke may exist in the first image region. If the first quotient value corresponding to the first image region is not greater than the fourth threshold value, smoke does not exist in the first image region.
[0131] According to the gray mask characteristics of smoke, that is, if smoke appears in the to-be-processed video, it is equivalent to that a layer of gray mask is added to the original picture of each video frame. Therefore, if the second quotient value corresponding to the first image region is less than the fifth threshold value, smoke may exist in the first image region. If the specified object in the to-be-processed video moves, there is no gray mask characteristic, and the pixel values of each pixel point in the first image region will not change as a whole. Therefore, if the second quotient value corresponding to the first image region is not less than the fifth threshold value, smoke does not exist in the first image region.
[0132] In an implementation manner, the electronic device can determine, from each first image region in the first video frame, an image region for which the corresponding first quotient value is greater than the fourth threshold value and the corresponding second quotient value is less than the fifth threshold value, that is, an image region for which M1>T4 and M2<T5, as a second image region. T4 is the fourth threshold value, and T5 is the fifth threshold value.
[0133] In another implementation manner, for each first image region, the electronic device can also calculate a quotient M3 of the first quotient value and the second quotient value corresponding to the first image region according to the following formula (6).
[0134]
[0135] wherein H brepresents a height of the first image region in the c-th first video frame; W b represents a width of the first image region in the c-th first video frame; b(i,j,c) represents the first image region in the i-th row and the j-th column in the c-th first video frame (which can be referred to as a first image region b). x,y e b(i,j,c) represents that a pixel point (x,y) belongs to the first image region b in the c-th first video frame; f(x,y,c) represents a pixel value of the pixel point (x,y) in the c-th first video frame; f[x,y,(c-Δc)] represents a pixel value of the pixel point (x,y) in a second video frame corresponding to the c-th first video frame. The second video frame corresponding to the c-th first video frame is the (c-Δc)-th first video frame, and Δc is a preset inter-frame interval. Median() represents obtaining the median of values in the parentheses, and for all b(i,j,c) represents all first image regions in the c-th first video frame.
[0136] Further, the electronic device determines, from each first image region, an image region for which the corresponding first quotient is greater than a fourth threshold, the corresponding second quotient is less than a fifth threshold, and a quotient of the corresponding first quotient and the second quotient is greater than a sixth threshold, that is, an image region for which MT>T4, M2
[0137] For step S105, for each first video frame, after determining the second image region in which smoke is likely to exist in the first video frame, the electronic device can further determine, from each second image region in the first video frame, an image region that satisfies a second smoke detection condition, to obtain a third image region containing smoke.
[0138] In some embodiments, the second smoke detection condition is that there is no overlapping region with the fourth image region in the first video frame, and there is no overlapping region with the fourth image region in the corresponding second video frame.
[0139] Correspondingly, based on Figure 1 , referring to Figure 3 , step S105 can include the following steps:
[0140] S1051: performing target detection on each video frame in the video to be processed to obtain an image region containing a specified object in each video as a fourth image region.
[0141] S1052: for each second image region in the first video frame, judging whether the second image region and the fourth image region in the first video frame have an overlapping region based on a position of the second image region in the first video frame.
[0142] S1053: If the second image region does not overlap with the fourth image region in the first video frame, it is determined whether the second image region overlaps with the fourth image region in the second video frame based on the position of the second image region in the first video frame.
[0143] S1054: If the second image region does not overlap with the fourth image region in the second video frame, the second image region is determined as the third image region containing smoke.
[0144] In an implementation manner, the electronic device can perform target detection on each video frame in the to-be-processed video based on a target detection model to obtain a fourth image region containing a specified object in each video. The target detection model can be a YOLOv5 (You only look once-v5, an end-to-end target detection algorithm based on deep learning) model, and the specified object can be a real object capable of moving in a target scene, such as a person or a vehicle.
[0145] If the specified object (for example, a person or a vehicle) in the to-be-processed video moves, the pixel value of each video frame in the to-be-processed video also changes, and it can be determined that the region (that is, the fourth image region) where the specified object appears and the preset neighborhood of the fourth image region do not contain smoke.
[0146] In order to improve the accuracy of smoke detection, for each second image region in the first video frame, the electronic device can obtain the position of the second image region in the first video frame, for example, the electronic device obtains the coordinates of the second image region in the first video frame.
[0147] Then, the electronic device determines whether the second image region overlaps with the fourth image region in the first video frame. If the second image region does not overlap with the fourth image region in the first video frame, the electronic device determines whether the second image region overlaps with the fourth image region in the second video frame, that is, the electronic device determines whether the same position as the second image region in the second video frame contains a specified object. If the second image region does not overlap with the fourth image region in the second video frame, the second image region does not contain a specified object, and the second image region is determined as the third image region containing smoke.
[0148] In some embodiments, after step S1051, the method can further include the following steps:
[0149] In the case where the second image region overlaps with the fourth image region in the first video frame or the second image region overlaps with the fourth image region in the second video frame, it is determined that the second image region does not contain smoke.
[0150] For each second image region in the first video frame, if the second image region has an overlapping region with a fourth image region in the first video frame, and the second image region contains the specified object, it is determined that the second image region does not contain smoke. If the second image region has an overlapping region with a fourth image region in the second video frame, and the second image region contains the specified object, it is determined that the second image region does not contain smoke.
[0151] For example, for each second image region, if the second image region satisfies any of the following conditions, it is determined that the second image region does not contain smoke.
[0152] Condition 1: b_person(i,j,c) = True
[0153] Condition 2: b_person[i,j,(c-Δc)] = True
[0154] b_person(i,j,c) = True means that the second image region at the i-th row and the j-th column in the c-th first video frame contains a person. b_person[i,j,(c-Δc)] = True means that the second image region at the i-th row and the j-th column in the (c-Δc)-th first video frame contains a person. The (c-Δc)-th first video frame is the second video frame corresponding to the c-th first video frame.
[0155] In some embodiments, in order to improve the accuracy of smoke detection, the fourth image region can also be expanded in the spatial direction, that is, to determine the preset neighborhood of the fourth image region. For example, according to the width of the first image region, the left boundary and the right boundary of the fourth image region are respectively expanded outward by the same size, and according to the height of the first image region, the upper boundary and the lower boundary of the fourth image region are respectively expanded outward by the same size, to obtain the preset neighborhood of the fourth image. Then, for each second image region, when it is determined that the second image region does not have an overlapping region with the preset neighborhood of the fourth image region in the first video frame, and does not have an overlapping region with the preset neighborhood of the fourth image region in the corresponding second video frame, it is determined that the second image region is a third image region containing smoke.
[0156] In some embodiments, if the electronic device detects multiple fourth image regions containing the specified object in the first video, for each fourth image region and the preset neighborhood of the fourth image region, it is determined that each fourth image region and the preset neighborhood of the fourth image region does not contain smoke.
[0157] Based on the above processing, the alarm is suppressed according to the fourth image region containing the specified object in each first video frame, that is, it is determined that the fourth image region is an image region without non-smoke. In order to avoid the influence of the error of the target detection model on the smoke detection result, the fourth image region is expanded in the spatial direction for suppression. The arms of the person and the whole person may be detected at the same time, and then the fourth image region and the preset neighborhood of the fourth image region are suppressed for alarm. That is, it is determined that the fourth image region and the preset neighborhood of the fourth image region do not contain smoke. The accuracy of smoke detection can be improved, and false detection can be avoided.
[0158] In some embodiments, before step S106, the method further comprises the following steps:
[0159] For each first video frame, if the median of the absolute values of the difference means of each first image region in the first video frame is greater than the seventh threshold, it is determined that there is no image region containing smoke in the first video frame.
[0160] Because when the image acquisition device acquires the to-be-processed video, the image acquisition device will perform overexposure adjustment, causing the pixel values of each video frame in the to-be-processed video to be offset, therefore, the median of the absolute values of the difference means of each image region in the video frame will be high. However, if the video frame only contains a small part of smoke spraying, the median of the absolute values of the difference means of each image region in the video frame will still be low.
[0161] Therefore, in order to improve the accuracy of smoke detection and avoid false detection, for each first video frame, the electronic device obtains the median of the absolute values of the difference means (i.e., the first median) corresponding to each first image region in the first video frame. If the first median is greater than the seventh threshold, it indicates that the change of the pixel value of the first video frame relative to the second video frame is caused by the overexposure adjustment of the image acquisition device, and therefore it is determined that there is no image region containing smoke in the first video frame.
[0162] For example, if the absolute values of the difference means corresponding to each first image region in the first video frame satisfy the condition shown in the following formula (7), it is determined that there is no image region containing smoke in the first video frame.
[0163]
[0164] Wherein, b(i,j,c) img(c), b(i,j,c) represents the first image region (which can be referred to as the first image region b) of the i-th row and the j-th column in the c-th first video frame; H b represents the height of the first image region in the c-th first video frame; W bb(i,j,c) represents the width of the first image region in the cth first video frame; img(c) represents the cth first video frame. x, y e b(i,j,c) represents that the pixel point (x, y) belongs to the first image region b in the cth first video frame; f(x,y,c) represents the pixel value of the pixel point (x, y) in the cth first video frame; f[x,y,(c-Δc)] represents the pixel value of the pixel point (x, y) in the second video frame corresponding to the cth first video frame. The second video frame corresponding to the cth first video frame is the (c-Δc)th first video frame, and Δc is a preset inter-frame interval. Median() represents the median of the values in the parentheses, and for all b(i,j,c) represents all first image regions in the cth first video frame. T7 represents the seventh threshold value.
[0165] In some embodiments, before step S106, the method further comprises the following steps: for each first video frame, if the number of third image regions in the first video frame is less than the first number, it is determined that there is no image region containing smoke in the first video frame.
[0166] When the target detection model detects each video frame in the to-be-processed video, due to the error of the target detection model, the phenomenon of missed detection may occur, that is, the image region containing the specified object is not detected. Or, when the image acquisition device performs a small degree of exposure adjustment, it may cause the third image region to be determined as not an image region containing smoke.
[0167] Therefore, in order to improve the accuracy of smoke detection and avoid false detection, for each first video frame, if the number of third image regions in the first video frame is less than the first number, it indicates that the third image region in the first video frame may be an image region containing the specified object missed by the target detection model, and it can be determined that there is no image region containing smoke in the first video frame.
[0168] For example, if each third image region in the first video frame satisfies the condition shown in the following formula (8), it is determined that there is no image region containing smoke in the first video frame.
[0169] COUNT(b(i,j,c)=True),for all b(i,j,c)<K (8)
[0170] wherein b(i,j,c) e img(c), COUNT(b(i,j,c) = True) represents the number of the third image regions in the c-th first video frame; b(i,j,c) represents the first image region in the i-th row and the j-th column in the c-th first video frame; b(i,j,c) = True represents that the first image region in the i-th row and the j-th column in the c-th first video frame is the third image region; img(c) represents the c-th first video frame; for all b(i,j,c) represents all the first image regions in the c-th first video frame; and K represents the first number.
[0171] For step S106, the alarm condition is that there is a third image region containing smoke in the second number of continuous video frames in the video to be processed. Alternatively, the alarm condition is that the number of video frames containing the third image region containing smoke in the video to be processed is greater than the third number.
[0172] If the third image region containing smoke in each first video frame in the video to be processed meets the preset alarm condition, it indicates that the target scene has a fire, and the electronic device can output alarm information for the target scene. For example, the electronic device contains an alarm, and the electronic device can control the alarm to issue an alarm. The electronic device can also locally store the first video frame containing the third image region in the video to be processed for subsequent technical personnel to check. If the third image region containing smoke in each first video frame in the video to be processed does not meet the preset alarm condition, it indicates that the target scene does not have a fire, and the electronic device can not alarm.
[0173] In some embodiments, the electronic device can also obtain a smoke detection data set of a zero visible light illumination environment. For example, the electronic device obtains infrared video data of a zero visible light illumination environment collected by a camera with infrared light compensation function, and collects a video data set of an open zero visible light illumination environment to obtain a plurality of sample video frames of the zero visible light illumination environment. For each sample video frame, a sample image region containing smoke in the sample video frame is labeled, and each sample video frame is classified as a positive sample and a negative sample to obtain a smoke detection data set of the zero visible light illumination environment,
[0174] Then, for each sample video frame, the sample video frame is processed by blocking, that is, the sample video frame is divided into a plurality of candidate image regions. Based on traditional computer vision and image processing technology, the image region in the sample video that may contain smoke (which can be referred to as a suspected image region) is detected and extracted, that is, based on the difference mean value of each candidate image region, the suspected image region meeting the first smoke detection condition is determined from the candidate image regions in the sample video frame.
[0175] Further, based on deep learning target detection and data statistical technology, the real object motion and exposure adjustment are suppressed to obtain an image area containing smoke in the sample video frame (which can be referred to as a smoke image area), that is, based on the position of each suspected image area in the sample video frame, the smoke image area satisfying the second smoke detection condition is determined from each suspected image area in the sample video frame. Then, based on the pre-defined alarm logic, it is determined whether the video slice needs to be alarmed, and the pre-defined alarm logic is also the preset alarm condition. When the preset alarm condition is met, it is determined that the alarm processing needs to be performed.
[0176] Further, the electronic device adjusts each threshold value for smoke detection, i.e., the first threshold value, the second threshold value, the third threshold value, the fourth threshold value, the fifth threshold value, the sixth threshold value, and the seventh threshold value, and the first number, the second number, and the third number, based on the detection result of the sample video frame for smoke detection, and the pre-labeled sample image area in the sample video frame.
[0177] Referring to Figure 4 , Figure 4 A flowchart of a smoke detection method provided by an embodiment of the present application. The method is suitable for indoor smoke detection in a zero visible light illumination environment. That is, the target scene is a zero visible light illumination environment.
[0178] A camera with infrared light supplementing function is used as a sensor, and an alarm control device is configured. The camera with infrared light supplementing function acquires a gray video slice, which is the aforementioned video to be processed. Then, the gray video slice is input to a smoke detection algorithm model running in an electronic device through a video capture card. The electronic device performs smoke detection on the gray video slice of the target scene through the smoke detection algorithm model, which is an environmental auxiliary control part.
[0179] Specifically, first, the traditional computer vision and image processing technology is used on an industrial computer to extract the smoke suspected area. The industrial computer is also the electronic device in the embodiment of the present application, that is, the electronic device determines each image area in each first video frame, and calculates the difference mean value of each first image area. Based on the difference mean value of each first image area, the second image area satisfying the first smoke detection condition is determined from each first image area in the first video frame.
[0180] Then, the suspected smoke area is suppressed by using deep learning target detection and data statistical technology, that is, the electronic device determines a third image area meeting the second smoke detection condition from each second image area in the first video frame based on the position of each second image area in the first video frame. Further, it is judged whether to trigger the alarm control device by using the alarm strategy, that is, whether to control the alarm to issue an alarm. When the third image area containing smoke in each first video frame meets the preset alarm condition, the electronic device controls the alarm to issue an alarm. When the third image area containing smoke in each first video frame does not meet the preset alarm condition, no alarm is issued.
[0181] Based on the above processing, while using traditional computer vision, image processing and deep learning technology, based on the time characteristics and spatial characteristics of smoke, a plurality of smoke detection conditions with high reliability and strong applicability are set, the second image area in which smoke may exist in each video frame is determined, and the second image area in which smoke may exist is activated and suppressed to obtain the final smoke detection result, that is, the third image area containing smoke in each video frame, which can improve the accuracy of smoke detection. And it does not depend on the visible light conditions such as daytime and visible light illumination, and can detect smoke indoors in zero visible light illumination environment, has wide application range, can be completed by using only the camera with infrared light supplement function, and has low cost for smoke detection. In addition, the smoke detection algorithm model mainly uses traditional computer vision technology, has low complexity and fast running speed, and can be used for environmental auxiliary control of most industrial equipment.
[0182] As can be seen, the smoke detection method provided by the embodiment of the present application has high accuracy and recall rate for smoke detection, low false alarm rate and false alarm rate, high reliability, and is suitable for industrial production field, and has the ability of plug and play, that is, without the need to transform the industrial production environment, and is convenient to use.
[0183] Referring to Figure 5 , Figure 5 A flowchart of a smoke detection method provided by the embodiment of the present application is shown in FIG. 1.
[0184] S501: Collect infrared video under zero visible light illumination.
[0185] In this step, the target scene is a zero visible light illumination environment. The infrared video is the video to be processed in the foregoing embodiment. The electronic device obtains the video to be processed containing the target scene through an image acquisition device with infrared light supplement function.
[0186] S502: Detect suspected smoke area in infrared video based on traditional computer vision and image processing technology.
[0187] In this step, the suspected smoke area is the second image area in which smoke may exist in the foregoing embodiments. That is, for each first video frame in the video to be processed, the first video frame is divided into a plurality of first image areas, and the difference mean of each first image area is calculated. Then, based on the difference mean of each first image area, the second image area satisfying the first smoke detection condition is determined from each first image area in the first video frame.
[0188] S503: The image processing module determines whether there is a suspected smoke area in the video. If not, step S502 is performed; if so, step S504 is performed.
[0189] In this step, the image processing module is a module for detecting whether there is a suspected smoke area in each first video frame. That is, it is determined whether there is a second image area in which smoke may exist in the first video frame. If there is no second image area in the first video frame, the next first video frame in the video to be processed is continuously subjected to smoke detection. If there is a second image area in the first video frame, the second image area is subjected to suppression of real object motion and exposure adjustment.
[0190] S504: Suppression of real object motion and exposure adjustment based on deep learning target detection and data statistical techniques.
[0191] In this step, real object motion is the motion of a specified object in a target scene, which causes the pixel values of the captured video frames to change, resulting in the second image area determined not containing smoke. Exposure adjustment is the exposure adjustment of the image acquisition device, which causes the pixel values of the captured video frames to change, resulting in the second image area determined not containing smoke.
[0192] That is, if there is a second image area in which smoke may exist in the first video frame, the electronic device subjects the second image area to suppression of real object motion and exposure adjustment, that is, based on the position of each second image area in the first video frame, determines a third image area satisfying a second smoke detection condition from each second image area in the first video frame, that is, determines a third image area containing smoke.
[0193] S505: After the suspected smoke area is suppressed, it is determined whether there is a smoke area. If not, step S502 is performed; if so, step S506 is performed.
[0194] In this step, the smoke area is the third image area containing smoke in the foregoing embodiments, that is, the electronic device determines whether there is a third image area containing smoke in the first video frame. If there is no third image area containing smoke in the first video frame, the next first video frame in the video to be processed is continuously subjected to smoke detection.
[0195] S506: determining whether the smoke area information should trigger an alarm, if not, executing step S502, if yes, executing step S507.
[0196] In this step, if the third image area containing smoke exists in the first video frame, it is determined whether the smoke area information should trigger an alarm, that is, it is determined whether the third image area containing smoke in each first video frame meets the alarm condition, and when the third image area containing smoke in each first video frame does not meet the alarm condition, the smoke detection is continued on the next first video frame in the video to be processed.
[0197] S507: the controller controls the alarm to trigger an alarm, and stores the smoke detection slice.
[0198] In this step, the controller, that is, the electronic device in the foregoing embodiment, controls the alarm to trigger an alarm when the third image area containing smoke in each first video frame meets the alarm condition, that is, the electronic device controls the alarm to output the alarm information for the target scene. The electronic device can also store the smoke detection slice, that is, store the first video frame containing the third image area for subsequent checking.
[0199] Based on the above processing, through traditional computer vision and image processing technology, combined with the time characteristics and spatial features of smoke, multiple smoke detection conditions are set, smoke detection is performed in a zero visible light illumination environment, and through deep learning target detection technology, each first video frame in the video to be processed is expanded in spatial and temporal dimensions, entity motion and exposure adjustment suppression is performed, motion differentiation and non-smoke block alarm suppression in a zero visible light illumination environment are performed, and whether to trigger an alarm is detected through the alarm condition. The smoke detection method provided by the embodiment of the present application has high accuracy and recall rate for smoke detection, low false alarm rate and false alarm rate, high reliability, and is suitable for industrial production field. At the same time, it has the ability of plug and play, that is, without the need to modify the industrial production environment, it is convenient to use.
[0200] Referring to Figure 6 , Figure 6 The embodiment of the present application provides a flow chart of a smoke detection method. The method is applied to an electronic device, and the electronic device comprises a suspected smoke block extraction module, a suspected smoke block suppression module and an alarm module.
[0201] The suspected smoke block extraction module is configured to determine a second image region that is likely to contain smoke. Specifically, the electronic device frames the video stream, i.e., the electronic device acquires a to-be-processed video containing a target scene, and acquires a plurality of first video frames from the to-be-processed video. The electronic device divides the first video frames into a plurality of blocks, and performs a difference operation between the blocks and a previous Δc frame, i.e., a second video frame corresponding to the first video frames. That is, the electronic device divides the first video frames into a plurality of first image regions, and calculates a difference value of pixel values between each first image region and a corresponding image region in the second video frame, to obtain a difference pixel value of each first image region.
[0202] Then, the electronic device calculates an absolute value of an average value of pixel difference within a block, and a standard deviation of pixel difference within a block, i.e., the electronic device calculates an average value of the difference pixel value of each first image region, to obtain a difference average value of each first image region, and calculates an average value and a standard deviation of the difference average values of the first image regions. Further, for each block, the electronic device determines whether the absolute value of the average value of pixel difference within a block is greater than a threshold value, and whether the standard deviation of pixel difference within a block is less than a threshold value. If the absolute value of the average value of pixel difference within a block is greater than the threshold value, and the standard deviation of pixel difference within a block is less than the threshold value, the electronic device determines that the block is a suspected smoke block. If the absolute value of the average value of pixel difference within a block is not greater than the threshold value, or the standard deviation of pixel difference within a block is not less than the threshold value, the electronic device determines that there is no smoke block, and continues to perform smoke detection on a next first video frame.
[0203] That is, the electronic device determines whether the absolute value of the difference average value of the first image region is greater than a first threshold value, and whether the standard deviation of the difference average value of the first image region is less than a second threshold value. If the absolute value of the difference average value of the first image region is greater than the first threshold value, and the standard deviation of the difference average value of the first image region is less than the second threshold value, the electronic device determines that the first image region is a second image region that is likely to contain smoke. If the absolute value of the difference average value of the first image region is not greater than the first threshold value, or the standard deviation of the difference average value of the first image region is not less than the second threshold value, the electronic device determines that there is no smoke in the first image region, and continues to perform smoke detection on a next first video frame.
[0204] The smoke block suppression module is configured to determine a third image region containing smoke. Specifically, the electronic device performs target detection on an image to determine a real object bounding box, and extracts a real object bounding box result of the previous Δc frame. The real object bounding box is also the fourth image region containing a specified object in the foregoing embodiments. That is, the electronic device performs target detection on each video frame in the to-be-processed video to obtain a fourth image region containing a specified object in each video frame.
[0205] Then, the electronic device expands the target detection result in a spatial direction, that is, the electronic device determines a preset neighborhood of the fourth image region containing the specified object in each video frame. The electronic device determines whether the suspected smoke block overlaps with the real object frame of the current frame or the previous Δc frame. If the suspected smoke block overlaps with the real object frame of the current frame or the previous Δc frame, the alarm is suppressed in the overlapping block. If the suspected smoke block does not overlap with the real object frame of the current frame or the previous Δc frame, the median of the average difference of all blocks in the current frame is calculated. That is, the electronic device determines whether the second image region overlaps with the fourth image region in the first video frame and whether the second image region overlaps with the fourth image region in the corresponding second video frame. If the second image region overlaps with the fourth image region in the first video frame or the fourth image region in the corresponding second video frame, it is determined that the second image region does not contain smoke. If the second image region does not overlap with the fourth image region in the first video frame and does not overlap with the fourth image region in the corresponding second video frame, the second image region is determined to be the third image region containing smoke.
[0206] Further, when the suspected smoke block does not overlap with the real object frame of the current frame or the previous Δc frame, the electronic device calculates the median of the average difference of all blocks in the current frame, and determines whether the median is greater than a threshold value. If the median is greater than the threshold value, all blocks in the frame are suppressed, that is, the electronic device obtains the median of the absolute values of the difference averages corresponding to each first image region in the first video frame (i.e., the first median). When the first median is greater than a seventh threshold value, it is determined that there is no image region containing smoke in the first video frame.
[0207] If the median is not greater than the threshold value, the electronic device counts the number of blocks of all determined smoke blocks, which are the third image regions containing smoke in the foregoing embodiments, and determines whether the number of blocks is less than a threshold value. If the number of blocks is less than the threshold value, all blocks in the frame are suppressed. That is, the electronic device obtains the number of third image regions in the first video frame. When the number of third image regions in the first video frame is less than a first number, it is determined that there is no image region containing smoke in the first video frame. After obtaining the smoke detection result of each first video frame, the smoke detection result is input to the alarm module. If the number of blocks is not less than the threshold value, the smoke detection result is input to the alarm module.
[0208] The alarm module is configured to determine whether to alarm according to the smoke detection result. The smoke detection result is the third image region containing smoke in each first video frame in the video to be processed. Specifically, the smoke detection result is input into an alarm strategy. The alarm strategy is the alarm condition in the foregoing embodiments. Whether to alarm is determined based on the alarm strategy and the smoke detection result of each first video frame. If it is necessary to alarm, an alarm signal is generated. If it is not necessary to alarm, no alarm signal is generated. That is, the electronic device determines whether the third image region containing smoke in each first video frame meets the alarm condition. When the third image region containing smoke in each first video frame meets the alarm condition, alarm information for the target scene is output. When the third image region containing smoke in each first video frame does not meet the alarm condition, no alarm is performed.
[0209] Based on the foregoing processing, by means of traditional computer vision and image processing technology, in combination with the temporal characteristics and spatial features of smoke, a plurality of smoke detection conditions are set, smoke detection can be performed in a zero visible light illumination environment, and by means of deep learning target detection technology, spatial and temporal dimensions of each first video frame in the video to be processed are expanded, entity motion and exposure adjustment are inhibited, motion discrimination in a zero visible light illumination environment and alarm inhibition of non-smoke blocks are performed, and whether to alarm is detected by means of an alarm condition. It can be seen that the smoke detection method provided in the embodiments of the present application has high accuracy and recall rate in smoke detection, low false alarm rate and false alarm rate, high reliability, and is suitable for industrial production fields. At the same time, it has the ability of plug and play, that is, without the need to modify the industrial production environment, it is convenient to use.
[0210] Referring to Figure 7 , Figure 7 A structural diagram of a smoke detection device provided by the embodiments of the present application is shown in FIG. 1. The device comprises:
[0211] A video to be processed acquisition module 701 is configured to acquire a video containing a target scene collected by an image collection device as a video to be processed. The image collection device is a device with infrared light supplementing function.
[0212] A first image region determination module 702 is configured to divide each first video frame in the video to be processed into a plurality of image regions as first image regions.
[0213] A difference average value determination module 703 is configured to calculate, for each first image region, a difference value of pixel values of the first image region and a corresponding image region in a second video frame as a difference pixel value of the first image region, and calculate an average value of the difference pixel value of the first image region as a difference average value of the first image region. The second video frame is a video frame located before the first video frame.
[0214] The second image region determination module 704 is configured to determine, from each first image region in the first video frame, an image region satisfying a first smoke detection condition as a second image region based on a difference mean value of each first image region.
[0215] The third image region determination module 705 is configured to determine, from each second image region in the first video frame, an image region satisfying a second smoke detection condition as a third image region based on a position of each second image region in the first video frame.
[0216] The alarm module 706 is configured to output alarm information for the target scene when the third image region containing smoke in each first video frame satisfies a preset alarm condition.
[0217] Optionally, the second image region determination module 704 is specifically configured to determine, from each first image region in the first video frame, an image region corresponding to an absolute value of a difference mean value greater than a first threshold value and a standard deviation of the difference mean value less than a second threshold value as a second image region.
[0218] Alternatively,
[0219] The second image region determination module 704 is specifically configured to determine, from each first image region in the first video frame, an image region corresponding to an absolute value of a difference mean value greater than a first threshold value, a standard deviation of the difference mean value less than a second threshold value, and a quotient of the absolute value and the standard deviation of the difference mean value greater than a third threshold value as a second image region.
[0220] Optionally, the second image region determination module 704 is specifically configured to obtain a median of the absolute values of the difference mean values corresponding to each first image region in the first video frame as a first median, and obtain a median of the standard deviations of the difference mean values corresponding to each first image region in the first video frame as a second median.
[0221] For each first image region in the first video frame, the second image region determination module 704 is specifically configured to calculate a quotient of the absolute value of the difference mean value corresponding to the first image region and the first median as a first quotient value, and calculate a quotient of the standard deviation of the difference mean value corresponding to the first image region and the second median as a second quotient value.
[0222] The second image region determination module 704 is specifically configured to determine, from each first image region in the first video frame, an image region corresponding to the first quotient value and the second quotient value satisfying a first smoke detection condition as a second image region. The first smoke detection condition is that the first quotient value is greater than a fourth threshold value and the second quotient value is less than a fifth threshold value. Alternatively, the first smoke detection condition is that the first quotient value is greater than the fourth threshold value, the second quotient value is less than the fifth threshold value, and a quotient of the first quotient value and the second quotient value is greater than a sixth threshold value.
[0223] Optionally, the third image region determining module 705 is specifically configured to perform target detection on each video frame in the to-be-processed video to obtain image regions containing the specified object in each video as fourth image regions.
[0224] For each second image region in the first video frame, it is determined whether the second image region and the fourth image region in the first video frame have an overlapping region based on the position of the second image region in the first video frame.
[0225] If the second image region and the fourth image region in the first video frame do not have an overlapping region, it is determined whether the second image region and the fourth image region in the second video frame have an overlapping region based on the position of the second image region in the first video frame.
[0226] If the second image region and the fourth image region in the second video frame do not have an overlapping region, the second image region is determined as a third image region containing smoke.
[0227] Optionally, the apparatus further includes:
[0228] The first processing module is configured to determine that the second image region does not contain smoke in a case where the second image region and the fourth image region in the first video frame have an overlapping region or the second image region and the fourth image region in the second video frame have an overlapping region.
[0229] Optionally, the apparatus further includes:
[0230] The second processing module is configured to, before the alarm module 706 outputs the alarm information for the target scene when the third image regions containing smoke in each first video frame satisfy the preset alarm condition, perform, for each first video frame, a determination that the first video frame does not contain an image region containing smoke if the median of the absolute values of the difference means corresponding to each first image region in the first video frame is greater than a seventh threshold.
[0231] Optionally, the apparatus further includes:
[0232] The third processing module is configured to, before the alarm module outputs the alarm information for the target scene when the third image regions containing smoke in each first video frame satisfy the preset alarm condition, perform, for each first video frame, a determination that the first video frame does not contain an image region containing smoke if the number of the third image regions in the first video frame is less than a first number.
[0233] Optionally, the alarm condition is that the third image region containing smoke exists in the second number of continuous video frames in the video to be processed; or the alarm condition is that the number of video frames containing the third image region in the video to be processed is greater than the third number.
[0234] Based on the smoke detection device provided in the embodiment of the present application, according to the dynamic characteristics of smoke, if smoke appears in the target scene, the pixel values of each video frame in the video to be processed will change, and the difference between the pixel values of different video frames is large. Therefore, based on the difference pixel values of each first video frame, the third image region containing smoke can be accurately determined, that is, the smoke detection can be accurately performed, which is not easily affected by dust and other particulate matters in the environment, can improve the accuracy of smoke detection, and avoids false detection. Moreover, the target scene is detected for smoke based on the video to be processed containing the target scene, which is not easily limited by the space size of the target scene, is suitable for larger indoor space, and can improve the adaptation range of the smoke detection method. In addition, the target scene is detected for smoke based on the video to be processed containing the target scene, without the need to update and maintain the smoke detector, which can reduce the cost of smoke detection.
[0235] The embodiment of the present application also provides an electronic device, such as Figure 8 As shown in the figure, the electronic device comprises a processor 801, a communication interface 802, a memory 803 and a communication bus 804, wherein the processor 801, the communication interface 802 and the memory 803 complete mutual communication through the communication bus 804,
[0236] The memory 803 is used for storing a computer program;
[0237] The processor 801 is used for executing the program stored in the memory 803, and realizes the following steps:
[0238] An image acquisition device is used to acquire a video containing a target scene as a video to be processed; wherein the image acquisition device is a device with infrared light supplement function;
[0239] For each first video frame in the video to be processed, the first video frame is divided into a plurality of image regions as first image regions;
[0240] For each first image region, the difference between the pixel values of the first image region and the corresponding image region in the second video frame is calculated as the difference pixel value of the first image region, and the average value of the difference pixel value of the first image region is calculated as the difference average value of the first image region; wherein the second video frame is a video frame located before the first video frame;
[0241] Determine, from the first image regions in the first video frame, an image region satisfying a first smoke detection condition as a second image region based on a difference mean value of the first image regions;
[0242] Determine, from the second image regions in the first video frame, an image region satisfying a second smoke detection condition as a third image region based on a position of the second image regions in the first video frame;
[0243] Output alarm information for the target scene when the third image region containing smoke in each first video frame satisfies a preset alarm condition.
[0244] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or only one type of bus.
[0245] The communication interface is used for communication between the above-mentioned electronic device and other devices.
[0246] The memory can include a Random Access Memory (RAM) and can also include a Non-Volatile Memory (NVM), such as at least one disk memory. Optionally, the memory can also be at least one storage device located away from the aforementioned processor.
[0247] The processor mentioned above can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.
[0248] In yet another embodiment provided by the present application, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program. The computer program is executed by a processor to implement the steps of any of the smoke detection methods described above.
[0249] In yet another embodiment provided by the present application, a computer program product containing instructions which, when executed on a computer, cause the computer to perform any of the smoke detection methods described in the above embodiments.
[0250] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware, or any combination thereof. When implemented by software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer readable storage medium, or transferred from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be transferred from one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) manner. The computer readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. integrated with one or more available media. The available media can be magnetic media (for example, floppy disk, hard disk, magnetic tape), optical media (for example, DVD), or semiconductor media (for example, solid state disk (SSD)) and the like.
[0251] It should be noted that, in this document, the terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between the entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the processes, methods, articles or devices including a series of elements not only include those elements, but also include other elements not explicitly listed or inherent to such processes, methods, articles or devices. Without more limitations, the element defined by the statement "including a" does not exclude the presence of another identical element in the process, method, article or device including the element.
[0252] Various embodiments are described in related manner in the specification, and the same or similar parts among various embodiments can be referred to each other. Each embodiment focuses on the difference from other embodiments. In particular, for the device, electronic device, computer-readable storage medium and computer program product embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the part of the method embodiment.
[0253] The above only describes the preferred embodiments of the present application, and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method of detecting smoke, characterized by, The method comprises: acquiring a video containing a target scene collected by an image collection device as a to-be-processed video; wherein the image collection device is a device with infrared light supplement function; for each first video frame in the to-be-processed video, dividing the first video frame into a plurality of image regions as first image regions; for each first image region, calculating a difference value of pixel values of the first image region and a corresponding image region in a second video frame as a difference pixel value of the first image region, and calculating an average value of the difference pixel values of the first image region as a difference average value of the first image region; wherein the second video frame is a video frame located before the first video frame; based on the difference average values of the first image regions, determining, from the first image regions in the first video frame, an image region satisfying a first smoke detection condition as a second image region; based on the positions of the second image regions in the first video frame, determining, from the second image regions in the first video frame, an image region satisfying a second smoke detection condition as a third image region; when the third image region containing smoke in each first video frame satisfies a preset alarm condition, outputting alarm information for the target scene; the method further comprises: if the second image region and the fourth image region in the first video frame do not have an overlapping region, judging whether the second image region and the fourth image regions in the second video frame have an overlapping region based on the position of the second image region in the first video frame; if the second image region and the fourth image regions in the second video frame do not have an overlapping region, determining that the second image region is a third image region containing smoke; the method further comprises: in a case where the second image region and the fourth image region in the first video frame have an overlapping region, or the second image region and the fourth image regions in the second video frame have an overlapping region, determining that the second image region does not contain smoke. the method further comprises: determining, from the first image regions in the first video frame, an image region with an absolute value of a corresponding difference average value greater than a first threshold value and a standard deviation of the corresponding difference average value less than a second threshold value as a second image region; 2. The method of claim 1, wherein, or, Determine, from the first image regions in the first video frame, an image region for which the absolute value of the corresponding difference mean is greater than a first threshold, the standard deviation of the corresponding difference mean is less than a second threshold, and the quotient of the absolute value of the corresponding difference mean and the standard deviation is greater than a third threshold, as a second image region.
3. The method of claim 1, wherein, The determining, from the first image regions in the first video frame, an image region that satisfies a first smoke detection condition as a second image region based on the difference mean of each first image region includes: Obtain the median of the absolute values of the difference means corresponding to the first image regions in the first video frame as a first median, and obtain the median of the standard deviations of the difference means corresponding to the first image regions in the first video frame as a second median; For each first image region in the first video frame, calculate the quotient of the absolute value of the difference mean corresponding to the first image region and the first median as a first quotient value, and calculate the quotient of the standard deviation of the difference mean corresponding to the first image region and the second median as a second quotient value; Determine, from the first image regions in the first video frame, an image region for which the corresponding first quotient value and second quotient value satisfy a first smoke detection condition as a second image region; wherein the first smoke detection condition is that the corresponding first quotient value is greater than a fourth threshold and the corresponding second quotient value is less than a fifth threshold; or the first smoke detection condition is that the corresponding first quotient value is greater than a fourth threshold, the corresponding second quotient value is less than a fifth threshold, and the quotient of the corresponding first quotient value and second quotient value is greater than a sixth threshold.
4. The method of claim 1, wherein, Before the outputting of the alarm information for the target scene when the third image region containing smoke in each first video frame satisfies a preset alarm condition, the method further includes: For each first video frame, if the median of the absolute values of the difference means corresponding to the first image regions in the first video frame is greater than a seventh threshold, determine that there is no image region containing smoke in the first video frame.
5. The method of claim 1, wherein, Before the outputting of the alarm information for the target scene when the third image region containing smoke in each first video frame satisfies a preset alarm condition, the method further includes: For each first video frame, if the number of third image regions in the first video frame is less than a first number, determine that there is no image region containing smoke in the first video frame.
6. The method of claim 1, wherein, The alarm condition is that there is a third image region containing smoke in a second number of consecutive video frames in the to-be-processed video; or the alarm condition is that the number of video frames in the to-be-processed video that contain a third image region containing smoke is greater than a third number.
7. A smoke detection apparatus, characterized by The device includes: A to-be-processed video acquisition module configured to acquire a video containing a target scene collected by an image collection device as a to-be-processed video; wherein the image collection device is a device with infrared light supplementing function; A first image region determination module configured to divide each first video frame in the to-be-processed video into a plurality of image regions as first image regions; The difference mean determination module is configured to calculate, for each first image region, a difference value of pixel values of the first image region and a corresponding image region in a second video frame as a difference pixel value of the first image region, and calculate an average value of the difference pixel values of the first image region as a difference mean value of the first image region, wherein the second video frame is a video frame located before the first video frame; The second image region determination module is configured to determine, from each first image region in the first video frame, an image region satisfying a first smoke detection condition as a second image region based on the difference mean value of each first image region; The third image region determination module is configured to determine, from each second image region in the first video frame, an image region satisfying a second smoke detection condition as a third image region based on a position of each second image region in the first video frame; The alarm module is configured to output alarm information for the target scene when the third image region containing smoke in each first video frame satisfies a preset alarm condition. The third image region determination module is specifically configured to perform target detection on each video frame in the to-be-processed video to obtain an image region containing a specified object in each video as a fourth image region. For each second image region in the first video frame, it is determined whether the second image region and the fourth image region in the first video frame have an overlapping region based on the position of the second image region in the first video frame. If the second image region and the fourth image region in the first video frame do not have an overlapping region, it is determined whether the second image region and the fourth image region in the second video frame have an overlapping region based on the position of the second image region in the first video frame. If the second image region and the fourth image region in the second video frame do not have an overlapping region, the second image region is determined as the third image region containing smoke. The device further includes: The first processing module is configured to determine that the second image region does not contain smoke if the second image region and the fourth image region in the first video frame have an overlapping region, or the second image region and the fourth image region in the second video frame have an overlapping region.
8. The apparatus of claim 7, wherein, The second image region determination module is specifically configured to determine, from each first image region in the first video frame, an image region whose absolute value of the corresponding difference mean value is greater than a first threshold value and whose standard deviation of the corresponding difference mean value is less than a second threshold value as a second image region. Alternatively, From each first image region in the first video frame, an image region whose absolute value of the corresponding difference mean value is greater than a first threshold value, whose standard deviation of the corresponding difference mean value is less than a second threshold value, and whose quotient of the absolute value and the standard deviation of the corresponding difference mean value is greater than a third threshold value is determined as a second image region.
9. The apparatus of claim 7, wherein, The second image region determination module is specifically configured to acquire a median of absolute values of the difference mean values corresponding to the first image regions in the first video frame as a first median, and acquire a median of standard deviations of the difference mean values corresponding to the first image regions in the first video frame as a second median; For each first image region in the first video frame, the absolute value of the difference mean value corresponding to the first image region is divided by the first median to obtain a first quotient value, and the standard deviation of the difference mean value corresponding to the first image region is divided by the second median to obtain a second quotient value; From the first image regions in the first video frame, an image region corresponding to the first quotient value and the second quotient value satisfying a first smoke detection condition is determined as a second image region; the first smoke detection condition is that the corresponding first quotient value is greater than a fourth threshold value, and the corresponding second quotient value is less than a fifth threshold value; or the first smoke detection condition is that the corresponding first quotient value is greater than the fourth threshold value, the corresponding second quotient value is less than the fifth threshold value, and the quotient of the corresponding first quotient value and the second quotient value is greater than a sixth threshold value.
10. The apparatus of claim 7, wherein, The device further comprises: The second processing module is configured to, before the alarm module outputs the alarm information for the target scene when the third image region containing smoke in each first video frame satisfies a preset alarm condition, perform, for each first video frame, if the median of the absolute values of the difference mean values corresponding to the first image regions in the first video frame is greater than a seventh threshold value, determining that there is no image region containing smoke in the first video frame.
11. The apparatus of claim 7, wherein, The device further comprises: The third processing module is configured to, before the alarm module outputs the alarm information for the target scene when the third image region containing smoke in each first video frame satisfies a preset alarm condition, perform, for each first video frame, if the number of the third image regions in the first video frame is less than a first number, determining that there is no image region containing smoke in the first video frame.
12. The apparatus of claim 7, wherein, The alarm condition is that there is a third image region containing smoke in a second number of continuous video frames in the to-be-processed video; or the alarm condition is that the number of video frames containing smoke in the to-be-processed video is greater than a third number.
13. An electronic device, comprising: The device comprises a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; The memory is configured to store a computer program; The processor is configured to execute the program stored in the memory to implement the method steps of any one of claims 1-6.
14. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the method steps of any one of claims 1-6. The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the method steps of any one of claims 1-6.
Citation Information
Patent Citations
Active visual attention monitoring video significant event intelligent detection and early warning method
CN106951870A
Method and device for detecting scene change frame
JP1997284702A