A method and system for classifying and identifying combustion smoke, an electronic device and a medium
By determining the area ratio of the target region and pixels, and combining smoke distance and SVM model, the problem of the inability to identify combustion smoke levels in existing technologies has been solved, achieving accurate smoke level judgment and identification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SICHUAN HONGHE COMM CO LTD
- Filing Date
- 2022-06-17
- Publication Date
- 2026-04-10
AI Technical Summary
Current technology cannot accurately identify the level of smoke from combustion; it can only determine whether smoke exists, but cannot perform precise identification.
By acquiring the image to be identified from the image acquisition device, the target region and target pixels are determined, the target area ratio is calculated, and the smoke level is judged by combining the smoke distance and the pre-trained SVM model.
It achieves accurate identification of combustion smoke levels, improves identification accuracy and work efficiency, and adapts to different environments and equipment deviations.
Smart Images

Figure CN115223153B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of neural networks, and particularly relates to a combustion smoke grading identification method and system, an electronic device and a medium. BACKGROUND
[0002] A large amount of smoke is generated when a combustible is burned. Identifying the grade (size) of the smoke is conducive to making preparations in advance. The prior art mainly uses a deep learning method to perform one-time target identification on the smoke. However, the method has the disadvantage that it can only identify whether there is smoke in the image, but cannot accurately determine the grade of the smoke, and cannot accurately identify the grade of the smoke. SUMMARY
[0003] In order to overcome the problem that the prior art can only identify whether there is smoke in the image, but cannot accurately determine the grade of the smoke, and cannot accurately identify the grade of the smoke, the present application provides a combustion smoke grading identification method and system, an electronic device and a medium.
[0004] In a first aspect, in order to solve the above technical problem, the present application provides a combustion smoke grading identification method, comprising the following steps:
[0005] Obtaining a first to-be-identified image collected by an image collection device, the first to-be-identified image including smoke;
[0006] Determining a target region in the first to-be-identified image, the target region being a region including smoke;
[0007] Determining target pixel points in each pixel point in the target region according to the gray value of each pixel point in the first to-be-identified image, the gray value of the target pixel points being greater than a set threshold value;
[0008] Determining a ratio of the total number of the target pixel points to the total number of each pixel point in the first to-be-identified image, and taking the ratio as a target area proportion;
[0009] Determining the grade of the smoke in the first to-be-identified image according to the target area proportion.
[0010] The combustion smoke grading identification method provided by the present application has the beneficial effects that the target region is first determined from the first to-be-identified image, and then the target pixel points are determined from the target region. The target pixel points can be regarded as the coverage area of the smoke. The area proportion of the target pixel points is determined through the ratio of the total number of the target pixel points to the total number of each pixel point in the first to-be-identified image, so as to determine the grade of the smoke in the first to-be-identified image. The problem that the prior art can only identify whether there is smoke in the image, but cannot accurately determine the grade of the smoke, and cannot accurately identify the grade of the smoke, is solved.
[0011] On the basis of the above technical solutions, the combustion type smoke grading identification method can be further improved as follows.
[0012] Further, the method further comprises:
[0013] The smoke distance is the distance between the image acquisition device and the smoke.
[0014] According to the target area ratio, the grade of the smoke in the first to-be-identified image is determined, comprising:
[0015] According to the target area ratio and the smoke distance, the grade of the smoke in the first to-be-identified image is determined.
[0016] The beneficial effects of the above further scheme are: in order to reduce the error induction of different imaging areas formed by different smoke distances on the actual area size, correct the induction relationship, by introducing the smoke distance as the distance between the image acquisition device and the smoke as a judgment parameter, the error induction is reduced, and the induction relationship is corrected.
[0017] Further, the method further comprises:
[0018] The first position of the first center pixel point of the target area is determined, and the first center pixel point is the pixel point at the center position of the target area.
[0019] The second position of the second center pixel point of the first to-be-identified image is determined, and the second center pixel point is the pixel point at the center position of the first to-be-identified image.
[0020] According to the first position and the second position, the interval distance between the first center pixel point and the second center pixel point is determined.
[0021] The first shooting angle of the image acquisition device is obtained, and according to the interval distance, the first shooting angle and the pre-established conversion relationship, the second shooting angle corresponding to the first center pixel point as a new second center pixel point is determined, the first shooting angle is the shooting angle corresponding to the first to-be-identified image, and the conversion relationship is the conversion relationship between the interval distance and the shooting angle.
[0022] According to the second shooting angle, the second to-be-identified image is obtained through the image acquisition device.
[0023] According to the second to-be-identified image, the first area ratio is determined.
[0024] According to the first area ratio, the zoom of the image acquisition device is performed.
[0025] The third to-be-identified image is obtained according to the zoomed image acquisition device.
[0026] identify whether the third to-be-identified image contains smoke, if the third to-be-identified image contains smoke, determine a second area ratio corresponding to the third to-be-identified image, and take the second area ratio as a target area ratio;
[0027] If the third to-be-identified image does not contain smoke, the fourth to-be-identified image is acquired by the image acquisition device.
[0028] The beneficial effects of the above further scheme are: since the smoke in the first to-be-identified image is far away from the image acquisition device, it is necessary to perform secondary identification on the smoke after focusing to obtain a more accurate smoke identification result. By converting from the first shooting angle of the image acquisition device to the second shooting angle, the first center pixel point on the first to-be-identified image is moved to the second center pixel point to obtain the second to-be-identified image. At this time, the center pixel point of the second to-be-identified image is the second center pixel point, i.e., the smoke is placed at the center pixel point of the second to-be-identified image. Finally, zooming operation is performed according to the first area ratio to obtain the third to-be-identified image. In the third to-be-identified image, the smoke is clearer and closer to the image acquisition device, which can more accurately identify the smoke and more accurately determine the smoke level.
[0029] Further, the first position includes a first coordinate point in the horizontal direction and a second coordinate point in the vertical direction, and the second position includes a third coordinate point in the horizontal direction and a fourth coordinate point in the vertical direction.
[0030] According to the first position and the second position, the interval distance between the first center pixel point and the second center pixel point is determined, including:
[0031] According to the first coordinate point and the third coordinate point, a first distance between the first center pixel point and the second center pixel point in the horizontal direction is determined.
[0032] According to the second coordinate point and the fourth coordinate point, a second distance between the first center pixel point and the second center pixel point in the vertical direction is determined, and the interval distance includes the first distance and the second distance.
[0033] The first shooting angle includes a third shooting angle in the horizontal direction and a fourth shooting angle in the vertical direction, and the conversion relationship includes a first conversion relationship between the interval distance in the horizontal direction and the shooting angle in the horizontal direction, and a second conversion relationship between the interval distance in the vertical direction and the shooting angle in the vertical direction.
[0034] According to the interval distance, the first shooting angle, and the pre-established conversion relationship, the second shooting angle corresponding to the image acquisition device when the first center pixel point is a new second center pixel point is determined, including:
[0035] According to the first distance, the third shooting angle and the first conversion relationship, a fifth shooting angle corresponding to the horizontal direction is determined when the image acquisition device takes the first center pixel point as a new second center pixel point;
[0036] According to the second distance, the fourth shooting angle and the second conversion relationship, a sixth shooting angle corresponding to the vertical direction is determined when the image acquisition device takes the first center pixel point as a new second center pixel point, and the second shooting angle includes the fifth shooting angle and the sixth shooting angle.
[0037] The beneficial effect of the above further scheme is that the fifth shooting angle is determined according to the first distance, the third shooting angle and the first conversion relationship, the sixth shooting angle is determined according to the second distance, the fourth shooting angle and the second conversion relationship, the first shooting angle is adjusted in the horizontal direction by the image acquisition device according to the fifth shooting angle, the first shooting angle is adjusted in the vertical direction by the image acquisition device according to the sixth shooting angle, and thus the second shooting angle is obtained, the second to-be-recognized image can be obtained through the second shooting angle, and the second shooting angle can be accurately determined through the preset conversion relationship.
[0038] Further, the zooming of the image acquisition device according to the first area ratio includes:
[0039] When the first area ratio is not less than the set value, a first zooming multiple is determined, and the image acquisition device is zoomed according to the first zooming multiple;
[0040] When the first area ratio is less than the set value, a second zooming multiple is determined, and the image acquisition device is zoomed according to the second zooming multiple.
[0041] The beneficial effect of the above further scheme is that the zooming multiple of the image acquisition device is determined according to the comparison between the first area ratio and the set value, and thus a clearer third to-be-recognized image is obtained.
[0042] Further, the determination of the grade of the smoke in the first to-be-recognized image according to the target area ratio and the smoke distance is determined by a pre-trained grade recognition model, and the grade recognition model is trained in the following manner:
[0043] A training sample set is obtained, the training sample set includes smoke images corresponding to multiple scenes and smoke distances corresponding to each smoke image, each smoke image and smoke distance corresponding to each scene is taken as a training sample, each training sample corresponds to a label result, and the label result is used to represent the grade of the smoke in the smoke image;
[0044] Each smoke image is enhanced to obtain an enhanced image, and each enhanced image and the corresponding smoke distance are taken as a new training sample;
[0045] According to each new training sample, the initial SVM model is trained to obtain a predicted smoke grade corresponding to each new training sample;
[0046] For each new training sample, a first loss value is determined according to the predicted smoke grade and the labeled result;
[0047] According to each first loss value, a total loss value of the initial SVM model is determined;
[0048] If the total loss value meets a preset training end condition, an SVM model at the time of training end is taken as the grade recognition model, and if the total loss value does not meet the preset training end condition, a training parameter of the initial SVM model is adjusted to retrain the initial SVM model according to the adjusted training parameter until the total loss value meets the preset training end condition.
[0049] The beneficial effect of the above further scheme is that through the trained grade recognition model, the grade judgment of smoke in the batch of first to-be-recognized images can be realized, and the work efficiency of smoke judgment is higher.
[0050] Further, the above reinforcement processing includes at least one of Gaussian blur, mean blur, median blur, bilateral blur, noise interference, natural fog effect and slight raindrop effect, and the multiple scenes include forests, grasslands, highways, squares and communities at different time periods, and the different time periods include noon, night, evening and dawn.
[0051] The beneficial effect of the above further scheme is that through the reinforcement processing, the fitting and environmental adaptability of the grade recognition model are increased, the color preference of various brand image acquisition devices is maximized, and the image deviation caused by the damage of the image acquisition device to a certain extent can be coped with.
[0052] In a second aspect, the present application provides a combustion type smoke grading recognition system, comprising a first to-be-recognized image acquisition module, a target region acquisition module, a target pixel point acquisition module, a target area proportion acquisition module and a smoke grade acquisition module.
[0053] The first to-be-recognized image acquisition module is used to acquire a first to-be-recognized image acquired by an image acquisition device, and the first to-be-recognized image includes smoke.
[0054] The target region acquisition module is used to determine a target region in the first to-be-recognized image, and the target region is a region including smoke.
[0055] The target pixel point acquisition module is used to determine a target pixel point in each pixel point in the target region according to a gray value of each pixel point in the first to-be-recognized image, and the gray value of the target pixel point is greater than a set threshold value.
[0056] The target area ratio acquisition module is used to determine the ratio of the total number of each target pixel to the total number of each pixel in the first image to be identified, and uses the ratio as the target area ratio.
[0057] The smoke level acquisition module is used to determine the smoke level in the first image to be identified based on the target area ratio.
[0058] The beneficial effects of the combustion smoke classification recognition system provided by this invention are as follows: First, the target area is determined from the first image to be recognized, and then the target pixel is determined from the target area. The target pixel can be regarded as the smoke coverage area. By the ratio of the total number of target pixels to the total number of pixels in the first image to be recognized, the area ratio of the target pixels is determined, thereby determining the smoke level in the first image to be recognized. This solves the problem that the prior art can only identify whether there is smoke in the image, but cannot accurately judge the smoke level and cannot accurately identify the smoke level.
[0059] Thirdly, the present invention also provides an electronic device, including a memory, a processor, and a program stored in the memory and running on the processor, wherein the processor executes the program to implement the steps of the combustion smoke classification identification method described above.
[0060] Fourthly, the present invention also provides a computer-readable storage medium storing instructions that, when executed on a terminal device, cause the terminal device to perform the steps of the combustion smoke classification identification method described above. Attached Figure Description
[0061] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0062] Figure 1 This is a flowchart illustrating a method for classifying and identifying combustion-type smoke according to an embodiment of the present invention.
[0063] Figure 2 This is a schematic diagram of a combustion smoke classification and identification system according to an embodiment of the present invention. Detailed Implementation
[0064] The following embodiments are further explanations and supplements to the present invention and do not constitute any limitation on the present invention.
[0065] The following describes, with reference to the accompanying drawings, a method, system, electronic device, and medium for classifying and identifying combustion-type smoke according to an embodiment of the present invention.
[0066] like Figure 1 As shown, an embodiment of the present invention provides a method for classifying and identifying combustion-related smoke, comprising the following steps:
[0067] S1, acquire a first to-be-recognized image collected by an image collection device, the first to-be-recognized image including smoke.
[0068] S2, determine a target region in the first to-be-recognized image, the target region being a region including smoke.
[0069] S3, determine, according to a gray value of each pixel point in the first to-be-recognized image, a target pixel point in each pixel point in the target region and having a gray value greater than a set threshold value.
[0070] Optionally, the Monte Carlo sampling method is used to screen out the pixel point with the gray value greater than 150 as the target pixel point.
[0071] S4, determine a ratio of a total number of the target pixel points to a total number of each pixel point in the first to-be-recognized image, and take the ratio as a target area proportion.
[0072] Optionally, S4 further includes:
[0073] S41, determine a first position of a first center pixel point of the target region, the first center pixel point being a pixel point at a center position of the target region, wherein the first position includes a first coordinate point in a horizontal direction and a second coordinate point in a vertical direction.
[0074] S42, determine a second position of a second center pixel point of the first to-be-recognized image, the second center pixel point being a pixel point at a center position of the first to-be-recognized image, wherein the second position includes a third coordinate point in the horizontal direction and a fourth coordinate point in the vertical direction.
[0075] S43, determine, according to the first position and the second position, a separation distance between the first center pixel point and the second center pixel point, specifically:
[0076] determine a first distance between the first center pixel point and the second center pixel point in the horizontal direction according to the first coordinate point and the third coordinate point, and determine a second distance between the first center pixel point and the second center pixel point in the vertical direction according to the second coordinate point and the fourth coordinate point, the separation distance including the first distance and the second distance.
[0077] S44, acquire a first shooting angle of the image acquisition device, and determine a second shooting angle corresponding to the image acquisition device taking the first center pixel point as a new second center pixel point according to the interval distance, the first shooting angle and a conversion relationship, the first shooting angle being a shooting angle corresponding to the first to-be-identified image, and the conversion relationship being a conversion relationship between the interval distance and the shooting angle, wherein the first shooting angle includes a third shooting angle in a horizontal direction and a fourth shooting angle in a vertical direction, the conversion relationship includes a first conversion relationship between the interval distance in the horizontal direction and the shooting angle in the horizontal direction, and a second conversion relationship between the interval distance in the vertical direction and the shooting angle in the vertical direction, and the implementation process of determining the second shooting angle corresponding to the image acquisition device taking the first center pixel point as the new second center pixel point includes:
[0078] S441, determine a fifth shooting angle corresponding to the image acquisition device in the horizontal direction when taking the first center pixel point as the new second center pixel point according to the first distance, the third shooting angle and the first conversion relationship, wherein the first conversion relationship can be represented by Formula One, and the Formula One is as follows:
[0079] α x =k x *p x ;
[0080] wherein p x represents the first distance, k x represents the first conversion relationship, and a x represents the fifth shooting angle obtained by the third shooting angle through the Formula One;
[0081] S442, determine a sixth shooting angle corresponding to the image acquisition device in the vertical direction when taking the first center pixel point as the new second center pixel point according to the second distance, the fourth shooting angle and the second conversion relationship, wherein the second conversion relationship can be represented by Formula Two, and the Formula Two is as follows:
[0082] α z =k z *p z ;
[0083] wherein p x represents the second distance, k x represents the second conversion relationship, and a x represents the sixth shooting angle obtained by the fourth shooting angle through the Formula Two;
[0084] S445, determine the second shooting angle according to the fifth shooting angle and the sixth shooting angle.
[0085] S45, acquire a second to-be-identified image through the image acquisition device according to the second shooting angle.
[0086] S46, determining the first area ratio according to the second to-be-identified image.
[0087] S47, zooming the image acquisition device according to the first area ratio, specifically as follows:
[0088] when the first area ratio is not less than the set value, determining a first zooming multiple, and zooming the image acquisition device according to the first zooming multiple;
[0089] when the first area ratio is less than the set value, determining a second zooming multiple, and zooming the image acquisition device according to the second zooming multiple;
[0090] In addition, the set value in the embodiment is 0.5, the first zooming multiple is 2 times zooming, and the second zooming multiple is 4 times zooming, that is, when the first area ratio is not less than 0.5, 2 times zooming is determined, and when the second area ratio is less than 0.5, 4 times zooming is determined.
[0091] The implementation process of zooming the image acquisition device according to the first area ratio can be represented by the following formula three:
[0092]
[0093] wherein P represents the first area ratio.
[0094] S48, obtaining a third to-be-identified image according to the zoomed image acquisition device.
[0095] S49, identifying whether the third to-be-identified image contains smoke, if the third to-be-identified image contains smoke, determining a second area ratio corresponding to the third to-be-identified image, and taking the second area ratio as a target area ratio.
[0096] S50, if the third to-be-identified image does not contain smoke, obtaining a fourth to-be-identified image through the image acquisition device.
[0097] S5, determining the level of the smoke in the first to-be-identified image according to the target area ratio, wherein the level of the smoke is determined according to the size of the target area ratio, the larger the target area ratio is, the higher the level is, and the greater the fire is, the more dangerous it is, and optionally, the above level can be divided into three levels of large, medium and small.
[0098] Optionally, the above S5 can specifically include:
[0099] obtaining a smoke distance, the smoke distance being the distance between the image acquisition device and the smoke, and determining the level of the smoke in the first to-be-identified image according to the target area ratio and the smoke distance.
[0100] Optionally, the smoke distance can be obtained by using a laser range finder, specifically:
[0101] The 20 first to be recognized images randomly acquired by the laser range finder for 2 seconds are acquired, and the actual distances of the 20 first to be recognized images are recorded, 20 actual distances are sorted from small to large, and the average value of the actual distances at the middle 2 / 3 position is selected as the smoke distance. The middle 2 / 3 position can be the actual distance ranked 4th to 16th.
[0102] Optionally, the S5 can be realized by a pre-trained grade recognition model, and the grade recognition model is trained by the following method:
[0103] S51, a training sample set is acquired, the training sample set includes smoke images corresponding to multiple scenes and smoke distances corresponding to each smoke image, each smoke image corresponds to a target region, each smoke image and smoke distance corresponding to each scene are taken as a training sample, each training sample corresponds to a marked result, the marked result is used to represent the grade of smoke in the smoke image, including three grades of large smoke, medium smoke and small smoke; the target region is determined by a target frame.
[0104] In this embodiment, smoke images corresponding to various scenes are collected, the scenes include noon, night, evening and dawn, the scenes include forest, grassland, highway, square and community, the smoke distance is different from 10M to 20KM, the time and region distribution are evenly distributed, the data diversity and balance are ensured, and 300,000 smoke images are selected as training samples.
[0105] The marked result is divided into three grades of large, medium and small by the on-site personnel of the burning smoke point according to the prior experience of the volume, area and diffusion of the smoke.
[0106] S52, each smoke image is enhanced to obtain an enhanced image, and each enhanced image and the corresponding smoke distance are taken as a new training sample;
[0107] The enhancement process in this embodiment includes at least one of Gaussian blur, mean blur, median blur, bilateral blur, noise interference, natural fog effect and slight raindrop effect. After the enhancement of 300,000 smoke images, the number of smoke images is expanded to 900,000, which greatly enriches the diversity of data, and the 900,000 smoke images are divided into a training set and a test set according to 8:2.
[0108] S53, the initial SVM model is trained according to each new training sample to obtain a predicted smoke grade corresponding to each new training sample.
[0109] S54, for each new training sample, a first loss value is determined according to the predicted smoke grade and the marked result.
[0110] S55, determining a total loss value of the initial SVM model according to each first loss value.
[0111] S56, if the total loss value meets a preset training end condition, taking the SVM model at the time of training end as the grade recognition model, and if the total loss value does not meet the preset training end condition, adjusting a training parameter of the initial SVM model to retrain the initial SVM model according to the adjusted training parameter until the total loss value meets the preset training end condition.
[0112] Optionally, for the image after the reinforcement processing in each new training sample, the Monte Carlo sampling method can also be used to screen out the pixel points with the gray value greater than 150 in the target area of the image as the target pixel points for subsequent processing.
[0113] In the scheme of the present application, the initial SVM model can be a Yolov5x model structure, wherein Batchsize = 256, epochs = 20000+, and in the training process, the test set can also be tested, so that the recognition effect of the finally obtained grade recognition model is better, and the grade recognition model can be directly used for smoke target detection. As shown in the following table, the model is trained without considering the smoke distance, and the training effect of the obtained grade recognition model is:
[0114] Accuracy Precision Recall 94.7% 95.1% 93.9%
[0115] The model is trained considering the smoke distance, and the training effect of the obtained grade recognition model is:
[0116] Accuracy Precision Recall 93.3% 92.1% 92.9%
[0117] As shown in the following table, the model is trained without considering the smoke distance, and the training effect of the obtained grade recognition model is: Figure 2
[0118] The first to-be-recognized image acquisition module 202 is configured to acquire a first to-be-recognized image acquired by an image acquisition device, and the first to-be-recognized image includes smoke.
[0119] The target area acquisition module 203 is configured to determine a target area in the first to-be-recognized image, and the target area is a region including smoke.
[0120] The target pixel point acquisition module 204 is configured to determine, according to the gray values of the pixel points in the first to-be-recognized image, target pixel points with a gray value greater than a set threshold in the pixel points in the target area.
[0121] The target area proportion obtaining module 205 is configured to determine a ratio of the total number of target pixel points to the total number of pixel points in the first to-be-identified image, and take the ratio as the target area proportion.
[0122] The smoke level obtaining module 206 is configured to determine the level of the smoke in the first to-be-identified image according to the target area proportion.
[0123] Optionally, the system further comprises a smoke distance obtaining module configured to obtain a smoke distance, the smoke distance being a distance between the image acquisition device and the smoke.
[0124] Optionally, the system further comprises a first position determining module, a second position determining module, an interval distance determining module, a second shooting angle determining module, a second to-be-identified image determining module, a first area proportion determining module, a zooming module, a smoke secondary identification module, a third to-be-identified image determining module, and a fourth to-be-identified image determining module, wherein:
[0125] The first position determining module is configured to determine a first position of a first center pixel point of the target region, the first center pixel point being a pixel point at a center position of the target region, and the first position comprising a first coordinate point in a horizontal direction and a second coordinate point in a vertical direction.
[0126] The second position determining module is configured to determine a second position of a second center pixel point of the first to-be-identified image, the second center pixel point being a pixel point at a center position of the first to-be-identified image, and the second position comprising a third coordinate point in a horizontal direction and a fourth coordinate point in a vertical direction.
[0127] The interval distance determining module is configured to determine an interval distance between the first center pixel point and the second center pixel point according to the first position and the second position.
[0128] The second shooting angle determining module is configured to obtain a first shooting angle of the image acquisition device, determine a second shooting angle of the image acquisition device corresponding to the first center pixel point as a new second center pixel point according to the interval distance, the first shooting angle, and a pre-established conversion relationship, the first shooting angle being a shooting angle corresponding to the first to-be-identified image, and the conversion relationship being a conversion relationship between the interval distance and the shooting angle, wherein the first shooting angle comprises a third shooting angle in a horizontal direction and a fourth shooting angle in a vertical direction, and the conversion relationship comprises a first conversion relationship between the interval distance in the horizontal direction and the shooting angle in the horizontal direction, and a second conversion relationship between the interval distance in the vertical direction and the shooting angle in the vertical direction.
[0129] The second to-be-identified image determining module is configured to obtain a second to-be-identified image by the image acquisition device according to the second shooting angle.
[0130] The first area ratio determination module is configured to determine a first area ratio according to the second to-be-identified image.
[0131] The zoom module is configured to zoom the image acquisition device according to the first area ratio.
[0132] The third to-be-identified image determination module is configured to acquire a third to-be-identified image according to the zoomed image acquisition device.
[0133] The smoke secondary identification module is configured to identify whether the third to-be-identified image contains smoke, and if the third to-be-identified image contains smoke, determine a second area ratio corresponding to the third to-be-identified image, and take the second area ratio as a target area ratio.
[0134] The fourth to-be-identified image determination module is configured to acquire a fourth to-be-identified image through the image acquisition device if the third to-be-identified image does not contain smoke.
[0135] Optionally, the interval distance determination module further comprises a first distance module and a second distance module, wherein:
[0136] The first distance module is configured to determine a first distance between the first center pixel point and the second center pixel point in a horizontal direction according to the first coordinate point and the third coordinate point.
[0137] The second distance module is configured to determine a second distance between the first center pixel point and the second center pixel point in a vertical direction according to the second coordinate point and the fourth coordinate point, and the interval distance comprises the first distance and the second distance.
[0138] Optionally, the second shooting angle determination module further comprises a fifth shooting angle module and a sixth shooting angle module, wherein:
[0139] The fifth angle shooting module is configured to determine a fifth shooting angle corresponding to the image acquisition device in the horizontal direction when the first center pixel point is taken as a new second center pixel point according to the first distance, the third shooting angle and a first conversion relationship, wherein the first conversion relationship can be represented by Formula One, which is as follows:
[0140] α x =k x *p x ;
[0141] Wherein, p x represents the first distance, k x represents the first conversion relationship, and a x represents the fifth shooting angle obtained from the third shooting angle through Formula One.
[0142] The sixth shooting angle module is configured to determine a sixth shooting angle corresponding to the vertical direction when the image acquisition device takes the first center pixel point as a new second center pixel point according to the second distance, the fourth shooting angle and a second conversion relationship, wherein the second conversion relationship can be represented by Formula Two, which is as follows:
[0143] α z = k z * p z ;
[0144] wherein p x represents the second distance, k x represents the second conversion relationship, and a x represents the sixth shooting angle obtained by the fourth shooting angle through Formula Two.
[0145] Optionally, the zoom module further comprises a first zoom multiple determining module and a second zoom multiple determining module, wherein:
[0146] The first zoom multiple determining module is configured to determine a first zoom multiple when the first area ratio is not less than a set value, and zoom the image acquisition device according to the first zoom multiple.
[0147] The second zoom multiple determining module is configured to determine a second zoom multiple when the first area ratio is less than the set value, and zoom the image acquisition device according to the second zoom multiple.
[0148] Optionally, the smoke level obtaining module 206 further comprises a model training module, which is configured to obtain a training sample set, wherein the training sample set comprises smoke images corresponding to multiple scenes and smoke distances corresponding to each smoke image, take each smoke image and the corresponding smoke distance as a training sample, and each training sample corresponds to a marked result, wherein the marked result is used to represent the level of smoke in the smoke image.
[0149] Each smoke image is subjected to reinforcement processing to obtain a reinforced image, and each reinforced image and the corresponding smoke distance are taken as a new training sample.
[0150] The initial SVM model is trained according to each new training sample to obtain a predicted smoke level corresponding to each new training sample.
[0151] For each new training sample, a first loss value is determined according to the predicted smoke level and the marked result.
[0152] A total loss value of the initial SVM model is determined according to each first loss value.
[0153] If the total loss value meets the preset training end condition, the SVM model at the training end is taken as the grade recognition model, and if the total loss value does not meet the preset training end condition, the training parameters of the initial SVM model are adjusted to retrain the initial SVM model according to the adjusted training parameters until the total loss value meets the preset training end condition.
[0154] Optionally, the model training module further comprises a reinforcement processing module, the reinforcement processing module is configured to perform reinforcement processing on each smoke image, the reinforcement processing comprises at least one of Gaussian blur, mean blur, median blur, bilateral blur, noise interference, natural fog effect and slight raindrop effect, and the multiple scenes comprise forests, grasslands, highways, squares and communities at different time periods, and the different time periods comprise noon, night, evening and dawn.
[0155] An electronic device according to an embodiment of the present application includes a memory, a processor, and a program stored in the memory and running on the processor, and the processor implements part or all steps of the above-mentioned method for identifying grades of combustion-type smokes when executing the program.
[0156] Correspondingly, the program is computer software, and the parameters and steps in the above-mentioned electronic device can refer to the parameters and steps in the above-mentioned method for identifying grades of combustion-type smokes, and will not be described here.
[0157] Those skilled in the art know that the present application can be implemented as a system, a method or a computer program product. Therefore, the present disclosure can be embodied in the form of a complete hardware, a complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software, which are generally referred to as "circuitry", "module" or "system" herein. In addition, in some embodiments, the present application can also be implemented as a computer program product in one or more computer readable media, which contains computer readable program codes. The computer readable storage medium may, for example, be but not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination of the above.
[0158] In the description of the specification, the description of the terms "one embodiment", "some embodiments", "an example", "a specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are contained in at least one embodiment or example of the present application. In the specification, the illustrative description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any suitable manner in any one or more embodiments or examples. In addition, the person skilled in the art can combine and combine the different embodiments or examples described in the specification and the features of the different embodiments or examples without contradiction.
[0159] Although the embodiments of the present application have been shown and described above, it is understood that the above-described embodiments are exemplary and are not to be construed as limiting the present application, and those skilled in the art can make changes, modifications, replacements and variations to the above-described embodiments within the scope of the present application.
Claims
1. A method for classifying and identifying combustion-related smoke, characterized in that, The method comprises the following steps: acquiring a first to-be-recognized image collected by an image collection device, the first to-be-recognized image comprising smoke; determining a target region in the first to-be-recognized image, the target region being a region comprising smoke; determining, according to the gray values of each pixel point in the first to-be-recognized image, a target pixel point in each pixel point in the target region, the gray value of the target pixel point being greater than a set threshold value; determining a ratio of the total number of each target pixel point to the total number of each pixel point in the first to-be-recognized image, and taking the ratio as a target area proportion; determining a level of the smoke in the first to-be-recognized image according to the target area proportion; The method further comprises: determining a first position of a first center pixel point of the target region, the first center pixel point being a pixel point at the center position of the target region; determining a second position of a second center pixel point of the first to-be-recognized image, the second center pixel point being a pixel point at the center position of the first to-be-recognized image; determining an interval distance between the first center pixel point and the second center pixel point according to the first position and the second position; acquiring a first shooting angle of the image collection device, determining a second shooting angle corresponding to the image collection device when the first center pixel point is taken as a new second center pixel point according to the interval distance, the first shooting angle, and a pre-established conversion relationship, the first shooting angle being a shooting angle corresponding to the first to-be-recognized image, and the conversion relationship being a conversion relationship between an interval distance and a shooting angle; acquiring a second to-be-recognized image by the image collection device according to the second shooting angle; determining a first area proportion according to the second to-be-recognized image; zooming the image collection device according to the first area proportion; acquiring a third to-be-recognized image according to the zoomed image collection device; determining whether the third to-be-recognized image contains smoke, and if the third to-be-recognized image contains smoke, determining a second area proportion corresponding to the third to-be-recognized image, and taking the second area proportion as the target area proportion; if the third to-be-recognized image does not contain smoke, acquiring a fourth to-be-recognized image by the image collection device.
2. The method of claim 1, wherein, The method further comprises: acquiring a smoke distance, the smoke distance being a distance between the image collection device and the smoke; The step of determining a level of the smoke in the first to-be-recognized image according to the target area proportion comprises: determining a level of the smoke in the first to-be-recognized image according to the target area proportion and the smoke distance.
3. The method of claim 1, wherein, The first position comprises a first coordinate point in a horizontal direction and a second coordinate point in a vertical direction, and the second position comprises a third coordinate point in a horizontal direction and a fourth coordinate point in a vertical direction; The step of determining an interval distance between the first center pixel point and the second center pixel point according to the first position and the second position comprises: determining a first distance between the first center pixel point and the second center pixel point in a horizontal direction according to the first coordinate point and the third coordinate point; According to the second coordinate point and the fourth coordinate point, a second distance of the first center pixel point and the second center pixel point in a vertical direction is determined, and the interval distance includes the first distance and the second distance; The first shooting angle includes a third shooting angle in a horizontal direction and a fourth shooting angle in a vertical direction, and the conversion relationship includes a first conversion relationship between an interval distance in the horizontal direction and a shooting angle in the horizontal direction, and a second conversion relationship between an interval distance in the vertical direction and a shooting angle in the vertical direction; The determination of the second shooting angle of the image acquisition device with the first center pixel point as a new second center pixel point according to the interval distance, the first shooting angle, and the pre-established conversion relationship includes: According to the first distance, the third shooting angle, and the first conversion relationship, a fifth shooting angle in the horizontal direction when the image acquisition device takes the first center pixel point as a new second center pixel point is determined; According to the second distance, the fourth shooting angle, and the second conversion relationship, a sixth shooting angle in the vertical direction when the image acquisition device takes the first center pixel point as a new second center pixel point is determined, and the second shooting angle includes the fifth shooting angle and the sixth shooting angle.
4. The method of claim 1, wherein, The zooming of the image acquisition device according to the first area ratio includes: When the first area ratio is not less than a set value, a first zooming multiple is determined, and the image acquisition device is zoomed according to the first zooming multiple; When the first area ratio is less than the set value, a second zooming multiple is determined, and the image acquisition device is zoomed according to the second zooming multiple.
5. The method of claim 2, wherein, The determination of the grade of smoke in the first to-be-recognized image according to the target area ratio and the smoke distance is determined by a pre-trained grade recognition model, and the grade recognition model is trained in the following way: A training sample set is obtained, which includes smoke images corresponding to multiple scenes and smoke distances corresponding to each smoke image, and each smoke image and smoke distance corresponding to each scene are taken as a training sample, each training sample corresponds to a label result, and the label result is used to represent the grade of smoke in the smoke image; Each smoke image is enhanced to obtain an enhanced image, and each enhanced image and the corresponding smoke distance are taken as a new training sample; An initial SVM model is trained according to each new training sample to obtain a predicted smoke grade corresponding to each new training sample; For each new training sample, a first loss value is determined according to the predicted smoke grade and the label result; According to each first loss value, a total loss value of the initial SVM model is determined; If the total loss value meets the preset training end condition, the SVM model at the end of the training is taken as the grade recognition model; if the total loss value does not meet the preset training end condition, the training parameters of the initial SVM model are adjusted, and the initial SVM model is retrained according to the adjusted training parameters until the total loss value meets the preset training end condition.
6. The method of claim 5, wherein, The reinforcement processing includes at least one of Gaussian blur, mean blur, median blur, bilateral blur, noise interference, natural fog effect and slight raindrop effect, and the multiple scenes include forests, grasslands, highways, squares and communities at different time periods, and the different time periods include noon, night, evening and dawn.
7. A combustion smoke class classification system, comprising: The first to-be-recognized image acquisition module, the target region acquisition module, the target pixel point acquisition module, the target area proportion acquisition module and the smoke grade acquisition module are included. The first to-be-recognized image acquisition module is configured to acquire a first to-be-recognized image collected by an image collection device, and the first to-be-recognized image includes smoke. The target region acquisition module is configured to determine a target region in the first to-be-recognized image, and the target region is a region including smoke. The target pixel point acquisition module is configured to determine target pixel points in each pixel point in the target region according to a gray value of each pixel point in the first to-be-recognized image. The target area proportion acquisition module is configured to determine a ratio of a total number of each target pixel point to a total number of each pixel point in the first to-be-recognized image, and take the ratio as a target area proportion. The smoke grade acquisition module is configured to determine a grade of smoke in the first to-be-recognized image according to the target area proportion. The system further includes a first position determination module, a second position determination module, an interval distance determination module, a second shooting angle determination module, a second recognized image determination module, a first area proportion determination module, a zoom module, a smoke secondary recognition module, a third to-be-recognized image determination module and a fourth to-be-recognized image determination module, wherein: The first position determination module is configured to determine a first position of a first center pixel point of the target region, and the first center pixel point is a pixel point at a center position of the target region, and the first position includes a first coordinate point in a horizontal direction and a second coordinate point in a vertical direction. The second position determination module is configured to determine a second position of a second center pixel point of the first to-be-recognized image, and the second center pixel point is a pixel point at a center position of the first to-be-recognized image, and the second position includes a third coordinate point in a horizontal direction and a fourth coordinate point in a vertical direction. The interval distance determination module is configured to determine an interval distance between the first center pixel point and the second center pixel point according to the first position and the second position. The second shooting angle determination module is configured to obtain a first shooting angle of the image acquisition device, and determine a second shooting angle corresponding to the image acquisition device with the first center pixel point as a new second center pixel point according to the interval distance, the first shooting angle, and a conversion relationship, the first shooting angle being a shooting angle corresponding to the first to-be-identified image, and the conversion relationship being a conversion relationship between the interval distance and the shooting angle, wherein the first shooting angle includes a third shooting angle in a horizontal direction and a fourth shooting angle in a vertical direction, the conversion relationship includes a first conversion relationship between the interval distance in the horizontal direction and the shooting angle in the horizontal direction, and a second conversion relationship between the interval distance in the vertical direction and the shooting angle in the vertical direction; The second to-be-identified image determination module is configured to obtain a second to-be-identified image through the image acquisition device according to the second shooting angle; The first area ratio determination module is configured to determine a first area ratio according to the second to-be-identified image; The zoom module is configured to zoom the image acquisition device according to the first area ratio; The third to-be-identified image determination module is configured to obtain a third to-be-identified image according to the zoomed image acquisition device; The smoke secondary identification module is configured to identify whether the third to-be-identified image contains smoke, and if the third to-be-identified image contains smoke, determine a second area ratio corresponding to the third to-be-identified image, and take the second area ratio as a target area ratio. The fourth to-be-identified image determination module is configured to obtain a fourth to-be-identified image through the image acquisition device if the third to-be-identified image does not contain smoke.
8. An electronic device comprising a memory, a processor, and a program stored on the memory and running on the processor, characterized in that, The processor implements the steps of the combustion smoke grading identification method according to any one of claims 1 to 6 when executing the program.
9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores instructions, and when the instructions run on the terminal device, the terminal device executes the steps of the combustion smoke grading identification method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Method and apparatus for adjusting identification range of camera device
CN107517344A
Fire identification and early warning method and device
CN114332587A