Flame detection methods, apparatus, equipment and storage media
By extracting image frames from video stream data and performing preliminary and secondary detections, combined with frequency domain feature information and classification models, the false detection problem in flame detection is solved, and the accuracy of flame detection is improved.
Patent Information
- Application Number
- CN202210753095.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-29
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2042-06-29
AI Technical Summary
Existing flame detection technologies are prone to false detections and have low accuracy, especially in scenarios with warm lighting and sunset glow. Furthermore, deep learning networks suffer from low detection accuracy due to insufficient sample data.
By extracting video stream data from the target image acquisition device, capturing image frames and performing preliminary target detection, obtaining adjacent image frames, performing secondary detection based on adjacent image frames, eliminating static interference, and using frequency domain feature information and a preset classification model for final flame detection.
It improves the accuracy of flame detection, effectively eliminates the influence of static interference, and enhances the precision of detection.
Smart Images

Figure CN117392573B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of target detection technology, and in particular to a flame detection method, apparatus, equipment and storage medium. Background Technology
[0002] Currently, the approaches to flame detection in image processing can be broadly divided into two types. One, represented by traditional algorithms, utilizes the color features of flames. It extracts suspected flame areas from an image and combines them with other static features (such as texture and shape features). For example, using the HSV color space to represent color features, it first identifies the red, orange, and yellow regions commonly covered by flames, extracts the foreground as suspected flame areas, and then further utilizes static features to determine whether the region is indeed a flame. The other approach, represented by various neural network models, relies on training with large amounts of labeled data. It directly extracts features from foreground objects and performs detection and classification using the trained model, completing the process in one step.
[0003] However, both of these methods only use static feature information of flames, which makes it very easy to misidentify some warm-colored lights, sunset glow, etc. In addition, due to the special nature of the target, there is a lack of clear sample data of flames and fires in different scenarios, and the training sample size of the model is insufficient, resulting in low accuracy of flame detection for various deep learning networks.
[0004] The above content is only used to help understand the technical solution of the present invention and does not represent an admission that the above content is prior art. Summary of the Invention
[0005] The main objective of this invention is to provide a flame detection method, apparatus, device, and storage medium, aiming to solve the technical problems of false detection and low accuracy in existing flame detection technologies.
[0006] To achieve the above objectives, the present invention provides a flame detection method, the method comprising the following steps:
[0007] Video stream data is extracted from the target image acquisition device, and image frames are extracted from the video stream data to obtain the image frames to be detected.
[0008] Preliminary target detection is performed on the image frame to be detected to obtain a suspected flame target;
[0009] Obtain the adjacent image frames corresponding to the image frame to be detected;
[0010] The suspected flame target is then subjected to secondary detection based on the adjacent image frames to obtain the flame detection result.
[0011] Optionally, before the step of extracting video stream data from the target image acquisition device and performing image frame segmentation on the video stream data to obtain the image frame to be detected, the method further includes:
[0012] A model sample set is constructed based on the sample video data;
[0013] The initial target detection model is trained using a model sample set to obtain a preset target detection model;
[0014] Accordingly, the step of performing preliminary target detection on the image frame to be detected to obtain a suspected flame target includes:
[0015] The preset target detection model is used to perform preliminary target detection on the image frame to be detected, and a suspected flame target is obtained.
[0016] Optionally, the step of constructing a model sample set based on sample video data includes:
[0017] The sample video data is processed to extract image frames, resulting in multiple video image frames;
[0018] The video image frames are displayed, and the target annotation data corresponding to each video image frame is obtained. The target annotation data is generated by the user to annotate the displayed video image frames.
[0019] The video image frames are compressed to obtain compressed image data;
[0020] A model sample set is constructed based on the compressed image data and the target annotation data.
[0021] Optionally, the step of compressing the video image frames to obtain compressed image data includes:
[0022] The resolution of the video image frames is adjusted using a preset size adjustment function to obtain an adjusted image.
[0023] The image that was adjusted once is subjected to image dimensionality reduction processing to obtain a one-dimensional array;
[0024] The array elements in the one-dimensional array are normalized to obtain compressed image data.
[0025] Optionally, the step of performing secondary detection on the suspected flame target based on the adjacent image frames to obtain the flame detection result includes:
[0026] The suspected flame target is eliminated by removing interference from the adjacent image frames to obtain the target to be detected;
[0027] Based on the adjacent image frames and the image frame to be detected, determine the frequency domain feature information corresponding to the target to be detected;
[0028] The frequency domain feature information is classified using a preset classification model to obtain flame detection results.
[0029] Optionally, the step of determining the frequency domain feature information corresponding to the target to be detected based on the adjacent image frames and the image frame to be detected includes:
[0030] Transform the image corresponding to the target to be detected in the image frame to the frequency domain to obtain first frequency domain data;
[0031] Transform the image corresponding to the target to be detected in the adjacent image frame to the frequency domain to obtain second frequency domain data;
[0032] The frequency domain feature information corresponding to the target to be detected is determined based on the first frequency domain data and the second frequency domain data.
[0033] Optionally, the step of eliminating interference from the suspected flame target based on the adjacent image frames to obtain the target to be detected includes:
[0034] Dynamic change information is determined based on the adjacent image frames and the image frame to be detected;
[0035] The dynamic change status of each suspected flame target is determined based on the dynamic change information.
[0036] The suspected flame targets whose corresponding dynamic change state is non-dynamic movement are excluded to obtain the target to be detected.
[0037] Furthermore, to achieve the above objectives, the present invention also proposes a flame detection device, which includes the following modules:
[0038] The image extraction module is used to extract video stream data from the target image acquisition device and to extract image frames from the video stream data to obtain the image frames to be detected.
[0039] The preliminary detection module is used to perform preliminary target detection on the image frame to be detected to obtain suspected flame targets;
[0040] The data lookup module is used to obtain the adjacent image frames corresponding to the image frame to be detected;
[0041] The result determination module is used to perform secondary detection on the suspected flame target based on the adjacent image frames to obtain the flame detection result.
[0042] In addition, to achieve the above objectives, the present invention also proposes a flame detection device, which includes: a processor, a memory, and a flame detection program stored in the memory and executable on the processor. When the flame detection program is executed by the processor, it implements the steps of the flame detection method as described above.
[0043] Furthermore, to achieve the above objectives, the present invention also proposes a computer-readable storage medium storing a flame detection program, wherein the flame detection program, when executed, implements the steps of the flame detection method as described above.
[0044] This invention extracts video stream data from a target image acquisition device and extracts image frames from the video stream data to obtain the image frame to be detected. Preliminary target detection is performed on the image frame to be detected to obtain a suspected flame target. Adjacent image frames corresponding to the image frame to be detected are then acquired. A secondary detection is performed on the suspected flame target based on the adjacent image frames to obtain the flame detection result. Because the actual detection process first performs preliminary target detection to obtain a suspected flame target, and then acquires adjacent image frames corresponding to the image frame to be detected, and performs a secondary detection on the suspected flame target using the adjacent image frames to determine whether the suspected flame target is a static interference object, and obtains the final flame detection result, the interference of static interference objects on the detection result is eliminated, improving the accuracy of flame detection. Attached Figure Description
[0045] Figure 1 This is a schematic diagram of the structure of an electronic device in the hardware operating environment involved in the embodiments of the present invention;
[0046] Figure 2 This is a flowchart illustrating the first embodiment of the flame detection method of the present invention;
[0047] Figure 3 This is a flowchart illustrating the second embodiment of the flame detection method of the present invention;
[0048] Figure 4 This is a structural block diagram of the first embodiment of the flame detection device of the present invention.
[0049] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0050] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.
[0051] Reference Figure 1 , Figure 1 This is a schematic diagram of the structure of a flame detection device in the hardware operating environment involved in an embodiment of the present invention.
[0052] like Figure 1 As shown, the electronic device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen or an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wireless-Fidelity (Wi-Fi) interface). The memory 1005 may be high-speed random access memory (RAM) or stable non-volatile memory (NVM), such as a disk drive. The memory 1005 may also optionally be a storage device independent of the aforementioned processor 1001.
[0053] Those skilled in the art will understand that Figure 1 The structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0054] like Figure 1 As shown, the memory 1005, which serves as a storage medium, may include an operating system, a network communication module, a user interface module, and a flame detection program.
[0055] exist Figure 1 In the electronic device shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the electronic device of the present invention can be set in the flame detection device. The electronic device calls the flame detection program stored in the memory 1005 through the processor 1001 and executes the flame detection method provided in the embodiment of the present invention.
[0056] This invention provides a flame detection method, referring to... Figure 2 , Figure 2 This is a schematic flowchart of a first embodiment of a flame detection method according to the present invention.
[0057] In this embodiment, the flame detection method includes the following steps:
[0058] Step S10: Extract video stream data from the target image acquisition device, and perform image frame segmentation on the video stream data to obtain the image frame to be detected.
[0059] It should be noted that the execution subject of this embodiment can be the flame detection device, which can be a personal computer, server or other electronic device, or other devices that can achieve the same or similar functions. This embodiment does not limit this. In this embodiment and the following embodiments, the flame detection device is used as an example to describe the flame detection method of the present invention.
[0060] It should be noted that the target image acquisition device can be an image acquisition device placed in the area where flame detection is required, such as a high-definition camera or video camera. The flame detection device can establish communication with the target image acquisition device in advance and extract the images acquired by the target image acquisition device to obtain video stream data.
[0061] In practical use, since the human eye can hardly observe the difference between still images and videos when the video frame rate reaches 25fps or higher, and retains information on the dynamic changes of flames in two consecutive frames, this embodiment performs image frame extraction on the video stream data to obtain the image frame to be detected. This can be done by using the Nyquist sampling frequency, taking 40ms*2=80ms as the interval to sample and extract frames from the video stream data, and using the collected image frames as the image frames to be detected.
[0062] Step S20: Perform preliminary target detection on the image frame to be detected to obtain a suspected flame target.
[0063] It should be noted that preliminary target detection of the image frame to be detected to obtain suspected flame targets can be achieved by performing preliminary flame target detection on the image frame to be detected, filtering out targets that are suspected to be flames, and using the filtered targets as suspected flame targets.
[0064] In specific implementation, to ensure the comprehensiveness of the initial screening as much as possible, a pre-trained model can be used to perform preliminary target detection on the image frame to be detected. Therefore, before step S20 in this embodiment, the following may be included:
[0065] A model sample set is constructed based on the sample video data;
[0066] The initial target detection model is trained using a model sample set to obtain a preset target detection model;
[0067] Accordingly, step S20 in this embodiment may include:
[0068] The preset target detection model is used to perform preliminary target detection on the image frame to be detected, and a suspected flame target is obtained.
[0069] It should be noted that the sample video data can be video stream data used to construct model training samples. Constructing a model sample set based on the sample video data can involve extracting video frames from the sample video data, labeling the extracted video frames to form model training samples, and then aggregating the obtained model training samples to obtain the model sample set. The initial object detection model can be the YOLO v5s model; of course, it can also be other models with similar functionality, and this embodiment does not impose any restrictions on this.
[0070] In practical applications, training an initial object detection model using a model sample set to obtain a preset object detection model can be achieved by dividing the model sample set into a training set and a validation set in a 4:1 ratio. At the beginning of training, as many layers and epochs as possible should be added. To prevent overfitting, parameters such as the learning rate, dropout ratio, and batch size can be adjusted appropriately. During training, the loss values corresponding to the training set and validation set should be continuously monitored. Finally, when a local optimum is reached, the trained initial object detection model can be used as the preset object detection model.
[0071] In a specific implementation, a preliminary target detection is performed on the image frame to be detected by a preset target detection model to obtain a suspected flame target. This can be achieved by inputting the image frame to be detected into the preset target detection model for analysis, receiving the target detection results fed back by the preset target detection model, and determining the suspected flame target based on the target detection results.
[0072] It should be noted that the target detection results may include the image coordinates and confidence scores of each flame target. Based on the target detection results, suspected flame targets can be identified by taking flame targets with confidence scores greater than or equal to a preset confidence threshold as suspected flame targets. The preset confidence threshold can be set in advance by the administrator of the flame detection equipment according to actual needs. In order to ensure the effectiveness of the detection, the preset confidence threshold can be set relatively low.
[0073] Furthermore, to simplify the user's operation, the step of constructing a model sample set based on sample video data described in this embodiment may include:
[0074] The sample video data is processed to extract image frames, resulting in multiple video image frames;
[0075] The video image frames are displayed, and the target annotation data corresponding to each video image frame is obtained. The target annotation data is generated by the user to annotate the displayed video image frames.
[0076] The video image frames are compressed to obtain compressed image data;
[0077] A model sample set is constructed based on the compressed image data and the target annotation data.
[0078] It should be noted that to obtain multiple video image frames by extracting image frames from sample video data, the Nyquist sampling frequency can be used, with an interval of 40ms*2=80ms to sample and extract frames from the sample video data, thereby obtaining multiple video image frames.
[0079] In practical use, displaying video image frames can involve showing them to a user, who can then use a preset annotation tool to annotate the displayed video image frames, generating bounding boxes that are stored in an XML file, thus obtaining the target annotation file corresponding to the video image frame. Obtaining the target annotation data for the video image frame can be done by reading the data from the corresponding target annotation file. The preset annotation tool can be Labelme, or other similar annotation tools.
[0080] Since manual annotation sometimes results in the bounding box of the annotation not completely covering the entire flame area, in order to avoid this phenomenon, after reading the data in the target annotation file, the data can be adjusted appropriately and the adjusted data can be used as the target annotation data. For example, read the data in the target annotation file, determine the bounding box of the annotation target based on the data, expand the bounding box by 5 pixels or more, and then use the data corresponding to the adjusted bounding box as the target annotation data.
[0081] It is understandable that the original video image frames have too high a resolution. Using them for model training may result in slow training speed because the model needs to spend time processing the video image frames. To avoid this, the video image frames can be compressed to reduce their resolution. The compressed video image frames are then used as compressed image data. A model sample set can be constructed based on the compressed image data and the target annotation data. The model can then be trained based on the model sample set, which can improve the training speed.
[0082] Furthermore, conventional image compression typically uses linear scaling to compress video image frames, which can distort the target object and potentially affect model training. To overcome this drawback, the step of compressing the video image frames to obtain compressed image data, as described in this embodiment, may include:
[0083] The resolution of the video image frames is adjusted using a preset size adjustment function to obtain an adjusted image.
[0084] The image that was adjusted once is subjected to image dimensionality reduction processing to obtain a one-dimensional array;
[0085] The array elements in the one-dimensional array are normalized to obtain compressed image data.
[0086] It should be noted that the preset resizing function can be a letterbox function, or other similar functions. Adjusting the resolution of video image frames using the preset resizing function can ensure the original aspect ratio of objects in the image and prevent distortion of the target objects.
[0087] In practical applications, image dimensionality reduction to obtain a one-dimensional array for a single-adjustment image can be achieved by adjusting the two-dimensional matrix data corresponding to the single-adjustment image, converting the precision of its matrix elements to floating-point, and then compressing it into a one-dimensional array. Normalizing the array elements in the one-dimensional array to obtain compressed image data can be achieved by dividing each element of the one-dimensional array by 255 to normalize its values to the interval [0,1], and then using the normalized one-dimensional array as the compressed image data.
[0088] Understandably, adjusting the resolution of video image frames before performing dimensionality reduction and normalization can further reduce the data complexity of video image frames, thereby further improving the processing speed of the model and thus improving the training efficiency of the model.
[0089] Step S30: Obtain the adjacent image frames corresponding to the image frame to be detected.
[0090] It should be noted that adjacent image frames can be multiple image frames whose corresponding image time sequence in the video stream data is adjacent to the image frame to be detected.
[0091] Step S40: Perform secondary detection on the suspected flame target based on the adjacent image frames to obtain the flame detection result.
[0092] It should be noted that the secondary detection of suspected flame targets based on adjacent image frames can obtain the flame detection result by determining the changes of suspected flame targets in consecutive frames based on adjacent image frames using the video frame difference method. This determines whether the suspected flame target is in motion, thereby eliminating the influence of static interference on flame detection and avoiding false detection or misjudgment.
[0093] In practical use, if it is determined that the suspected flame target is not in the process of change between consecutive frames, it means that the suspected flame target is a static interference. In this case, the corresponding flame detection result can be: non-flame target. However, if the suspected flame target is in the process of change, it means that the suspected flame target is not a static interference. In this case, the corresponding flame detection result can be: flame target.
[0094] This embodiment extracts video stream data from the target image acquisition device and extracts image frames from the video stream data to obtain the image frame to be detected. Preliminary target detection is performed on the image frame to be detected to obtain a suspected flame target. Adjacent image frames corresponding to the image frame to be detected are then acquired. A secondary detection is performed on the suspected flame target based on the adjacent image frames to obtain the flame detection result. Since the actual detection process first performs preliminary target detection to obtain a suspected flame target, and then acquires adjacent image frames corresponding to the image frame to be detected, and performs a secondary detection on the suspected flame target using the adjacent image frames, it determines whether the suspected flame target is a static interference object and obtains the final flame detection result. This eliminates the interference of static interference objects on the detection result and improves the accuracy of flame detection.
[0095] refer to Figure 3 , Figure 3 This is a schematic flowchart of a second embodiment of a flame detection method according to the present invention.
[0096] Based on the first embodiment described above, step S40 of the flame detection method in this embodiment includes:
[0097] Step S401: Based on the adjacent image frames, interference is eliminated from the suspected flame target to obtain the target to be detected.
[0098] It should be noted that, based on adjacent image frames, interference elimination of suspected flame targets can be performed to obtain the target to be detected. This can be achieved by determining whether each suspected flame target is a static interference object based on adjacent image frames, then eliminating the suspected flame targets that are determined to be static interference objects, and using the remaining suspected flame targets as the target to be detected.
[0099] Furthermore, since the movement of the outer flame portion of the flame has a certain frequency, static interference can be eliminated based on the motion changes of the suspected flame target across multiple frames. Therefore, step S401 in this embodiment can include:
[0100] Dynamic change information is determined based on the adjacent image frames and the image frame to be detected;
[0101] The dynamic change status of each suspected flame target is determined based on the dynamic change information.
[0102] The suspected flame targets whose corresponding dynamic change state is non-dynamic movement are excluded to obtain the target to be detected.
[0103] It should be noted that determining dynamic change information based on adjacent image frames and the image frame to be detected can be achieved by using the video frame difference method to determine the differences between multiple adjacent image frames, thereby obtaining dynamic change information. Then, based on the dynamic change information, it can be determined whether there is a change in the area corresponding to the suspected flame target, thus determining the dynamic change state of each suspected flame target in one go.
[0104] It is understandable that if the movement of the outer flame of a flame has a certain frequency, that is, the dynamic change state of the outer flame of a flame must be dynamic movement over time, and if the dynamic change state corresponding to a suspected flame target is non-dynamic movement, then the suspected flame target is a static interference object. Therefore, suspected flame targets with non-dynamic movement can be excluded, and the remaining suspected flame targets can be used as the targets to be detected.
[0105] Step S402: Determine the frequency domain feature information corresponding to the target to be detected based on the adjacent image frames and the image frame to be detected.
[0106] It should be noted that frequency domain feature information can include expected values such as the mean, standard deviation, skewness, and kurtosis of the frequency domain data corresponding to multiple adjacent image frames. Because of the presence of inner and outer flames, open flames exhibit certain texture patterns. These texture features can serve as an effective means of classification, and frequency domain feature information can be used to characterize these texture patterns. Therefore, the frequency domain feature information corresponding to the target to be detected can be determined based on adjacent image frames and the image frame to be detected, facilitating subsequent classification of the target.
[0107] Furthermore, in order to accurately extract the frequency domain feature information corresponding to each target to be detected, step S401 in this embodiment may include:
[0108] Transform the image corresponding to the target to be detected in the image frame to the frequency domain to obtain first frequency domain data;
[0109] Transform the image corresponding to the target to be detected in the adjacent image frame to the frequency domain to obtain second frequency domain data;
[0110] The frequency domain feature information corresponding to the target to be detected is determined based on the first frequency domain data and the second frequency domain data.
[0111] It should be noted that obtaining the image corresponding to the target in the image frame to be detected can be done by cropping the corresponding image from the image frame based on the bounding box of the target. Similarly, obtaining the image corresponding to the target in an adjacent image frame can also be done by cropping the corresponding image from the adjacent image frame based on the bounding box of the target.
[0112] In practical applications, transforming the image corresponding to the target in the image frame to be detected to obtain the first frequency domain data can be achieved by using the Fast Fourier Transform (FFT) algorithm to transform the image corresponding to the target in the image frame to the frequency domain, and then using the transformed data as the first frequency domain data. Similarly, transforming the image corresponding to the target in adjacent image frames to obtain the second frequency domain data can also be achieved by using the FFT algorithm to transform the image corresponding to the target in adjacent image frames to the frequency domain, and then using the transformed data as the second frequency domain data.
[0113] In a specific implementation, determining the frequency domain feature information corresponding to the target to be detected based on the first frequency domain data and the second frequency domain data can be achieved by subtracting the first frequency domain data and the second frequency domain data, and then obtaining the mean, standard deviation, skewness, and kurtosis of the frequency domain data, thereby obtaining the frequency domain feature information.
[0114] Step S403: Classify the frequency domain feature information using a preset classification model to obtain flame detection results.
[0115] It should be noted that the preset classification model can be a pre-trained SVM classifier. The preset classification model can perform feature classification on the input frequency domain feature information, thereby determining whether the target to be detected corresponding to the frequency domain feature information is a flame.
[0116] In practical applications, the preset classification model can be a linear classifier with RBF as the kernel function. When training the preset classification model, grid search can be used to traverse as many combinations as possible to determine the optimal regularization parameters and kernel function parameters. During training, it is necessary to ensure that the training set and validation set are as comprehensive as possible to avoid overfitting to non-flame features.
[0117] This embodiment obtains the target to be detected by eliminating interference from suspected flame targets based on adjacent image frames; determines the frequency domain feature information corresponding to the target to be detected based on the adjacent image frames and the image frame to be detected; and classifies the frequency domain feature information using a preset classification model to obtain the flame detection result. Because the suspected flame target is first eliminated by eliminating interference from static interference objects during flame detection, and then frequency domain feature information that can be used to characterize texture patterns is extracted and further classified using a pre-trained preset classification model, the final flame detection result is more accurate, further improving the accuracy of flame detection.
[0118] Furthermore, this embodiment of the invention also proposes a storage medium storing a flame detection program, which, when executed by a processor, implements the steps of the flame detection method described above.
[0119] Reference Figure 4 , Figure 4 This is a structural block diagram of the first embodiment of the flame detection device of the present invention.
[0120] like Figure 4 As shown, the flame detection device proposed in this embodiment of the invention includes:
[0121] The image extraction module 10 is used to extract video stream data from the target image acquisition device and perform image frame extraction on the video stream data to obtain the image frame to be detected.
[0122] The preliminary detection module 20 is used to perform preliminary target detection on the image frame to be detected to obtain suspected flame targets;
[0123] Data lookup module 30 is used to obtain adjacent image frames corresponding to the image frame to be detected;
[0124] The result determination module 40 is used to perform secondary detection on the suspected flame target based on the adjacent image frames to obtain the flame detection result.
[0125] This embodiment extracts video stream data from the target image acquisition device and extracts image frames from the video stream data to obtain the image frame to be detected. Preliminary target detection is performed on the image frame to be detected to obtain a suspected flame target. Adjacent image frames corresponding to the image frame to be detected are then acquired. A secondary detection is performed on the suspected flame target based on the adjacent image frames to obtain the flame detection result. Since the actual detection process first performs preliminary target detection to obtain a suspected flame target, and then acquires adjacent image frames corresponding to the image frame to be detected, and performs a secondary detection on the suspected flame target using the adjacent image frames, it determines whether the suspected flame target is a static interference object and obtains the final flame detection result. This eliminates the interference of static interference objects on the detection result and improves the accuracy of flame detection.
[0126] Furthermore, the image extraction module 10 is also used to construct a model sample set based on the sample video data; and to train the initial target detection model using the model sample set to obtain a preset target detection model.
[0127] The image extraction module 10 is also used to perform preliminary target detection on the image frame to be detected through the preset target detection model to obtain a suspected flame target.
[0128] Furthermore, the image extraction module 10 is also used to extract image frames from the sample video data to obtain multiple video image frames; display the video image frames and obtain target annotation data corresponding to each video image frame, wherein the target annotation data is generated by the user to annotate the displayed video image frames; compress the video image frames to obtain compressed image data; and construct a model sample set based on the compressed image data and the target annotation data.
[0129] Furthermore, the image extraction module 10 is also used to adjust the resolution of the video image frame using a preset size adjustment function to obtain an adjusted image; to perform image dimensionality reduction processing on the adjusted image to obtain a one-dimensional array; and to normalize the array elements in the one-dimensional array to obtain compressed image data.
[0130] Furthermore, the result determination module 40 is also used to eliminate interference from the suspected flame target based on the adjacent image frames to obtain the target to be detected; determine the frequency domain feature information corresponding to the target to be detected based on the adjacent image frames and the image frame to be detected; and classify the frequency domain feature information through a preset classification model to obtain the flame detection result.
[0131] Furthermore, the result determination module 40 is also used to transform the image corresponding to the target to be detected in the image frame to be detected to the frequency domain to obtain first frequency domain data; transform the image corresponding to the target to be detected in the adjacent image frame to the frequency domain to obtain second frequency domain data; and determine the frequency domain feature information corresponding to the target to be detected based on the first frequency domain data and the second frequency domain data.
[0132] Furthermore, the result determination module 40 is also used to determine dynamic change information based on the adjacent image frames and the image frame to be detected; determine the dynamic change state corresponding to each suspected flame target based on the dynamic change information; exclude the suspected flame targets whose corresponding dynamic change state is non-dynamic movement, and obtain the target to be detected.
[0133] It should be understood that the above are merely illustrative examples and do not constitute any limitation on the technical solutions of the present invention. In specific applications, those skilled in the art can make settings as needed, and the present invention does not impose any restrictions on this.
[0134] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of this invention. In practical applications, those skilled in the art can select some or all of the workflow to achieve the purpose of this embodiment according to actual needs, and no restrictions are imposed here.
[0135] In addition, for technical details not described in detail in this embodiment, please refer to the flame detection method provided in any embodiment of the present invention, which will not be repeated here.
[0136] Furthermore, it should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0137] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0138] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as read-only memory (ROM) / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0139] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.
Claims
1. A flame detection method, characterized in that, The flame detection method includes the following steps: Video stream data is extracted from the target image acquisition device, and image frames are extracted from the video stream data to obtain the image frames to be detected. Preliminary target detection is performed on the image frame to be detected to obtain a suspected flame target; Obtain the adjacent image frames corresponding to the image frame to be detected; The suspected flame target is then detected a second time based on the adjacent image frames to obtain the flame detection result. The step of performing secondary detection on the suspected flame target based on the adjacent image frames to obtain the flame detection result includes: The suspected flame target is eliminated by removing interference from the adjacent image frames to obtain the target to be detected; Based on the adjacent image frames and the image frame to be detected, determine the frequency domain feature information corresponding to the target to be detected; The frequency domain feature information is classified using a preset classification model to obtain flame detection results; The step of determining the frequency domain feature information corresponding to the target to be detected based on the adjacent image frames and the image frame to be detected includes: Transform the image corresponding to the target to be detected in the image frame to the frequency domain to obtain first frequency domain data; Transform the image corresponding to the target to be detected in the adjacent image frame to the frequency domain to obtain second frequency domain data; The frequency domain feature information corresponding to the target to be detected is determined based on the first frequency domain data and the second frequency domain data.
2. The flame detection method as described in claim 1, characterized in that, Before the step of extracting video stream data from the target image acquisition device and extracting image frames from the video stream data to obtain the image frame to be detected, the method further includes: A model sample set is constructed based on the sample video data; The initial target detection model is trained using a model sample set to obtain a preset target detection model; Accordingly, the step of performing preliminary target detection on the image frame to be detected to obtain a suspected flame target includes: The preset target detection model is used to perform preliminary target detection on the image frame to be detected, and a suspected flame target is obtained.
3. The flame detection method as described in claim 2, characterized in that, The step of constructing a model sample set based on sample video data includes: The sample video data is processed to extract image frames, resulting in multiple video image frames; The video image frames are displayed, and the target annotation data corresponding to each video image frame is obtained. The target annotation data is generated by the user to annotate the displayed video image frames. The video image frames are compressed to obtain compressed image data; A model sample set is constructed based on the compressed image data and the target annotation data.
4. The flame detection method as described in claim 3, characterized in that, The step of compressing the video image frames to obtain compressed image data includes: The resolution of the video image frames is adjusted using a preset size adjustment function to obtain an adjusted image. The image that was adjusted once is subjected to image dimensionality reduction processing to obtain a one-dimensional array; The array elements in the one-dimensional array are normalized to obtain compressed image data.
5. The flame detection method as described in claim 1, characterized in that, The step of eliminating interference from the suspected flame target based on the adjacent image frames to obtain the target to be detected includes: Dynamic change information is determined based on the adjacent image frames and the image frame to be detected; The dynamic change status of each suspected flame target is determined based on the dynamic change information. The suspected flame targets whose corresponding dynamic change state is non-dynamic movement are excluded to obtain the target to be detected.
6. A flame detection device, characterized in that, The flame detection device includes the following modules: The image extraction module is used to extract video stream data from the target image acquisition device and to extract image frames from the video stream data to obtain the image frames to be detected. The preliminary detection module is used to perform preliminary target detection on the image frame to be detected to obtain suspected flame targets; The data lookup module is used to obtain the adjacent image frames corresponding to the image frame to be detected; The result determination module is used to perform secondary detection on the suspected flame target based on the adjacent image frames to obtain the flame detection result; The result determination module is further configured to perform interference elimination on the suspected flame target based on the adjacent image frames to obtain the target to be detected; and to determine the frequency domain feature information corresponding to the target to be detected based on the adjacent image frames and the image frame to be detected. The frequency domain feature information is classified using a preset classification model to obtain flame detection results; The result determination module is further configured to transform the image corresponding to the target to be detected in the image frame to be detected to the frequency domain to obtain first frequency domain data; transform the image corresponding to the target to be detected in the adjacent image frame to the frequency domain to obtain second frequency domain data; and determine the frequency domain feature information corresponding to the target to be detected based on the first frequency domain data and the second frequency domain data.
7. A flame detection device, characterized in that, The flame detection device includes: a processor, a memory, and a flame detection program stored in the memory and executable on the processor. When the flame detection program is executed by the processor, it implements the steps of the flame detection method as described in any one of claims 1-5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a flame detection program, which, when executed, implements the steps of the flame detection method as described in any one of claims 1-5.
Citation Information
Patent Citations
Video-based fire image detection method, system and device, and storage medium
CN113947744A
