Personnel safety protection equipment detection method and system based on image recognition

Through the improved dark channel prior dehazing algorithm, brightness and gradient information are used to adjust the sliding window, which solves the problem of poor dehazing effect of underground coal mine images and improves the accuracy of safety protection equipment detection.

CN118397288BActive Publication Date: 2024-08-27SHAANXI SHANMEI HUANGLING MINING IND CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410868811.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-01
Publication Date
2024-08-27
Estimated Expiration
2044-07-01

AI Technical Summary

Technical Problem

Due to the influence of dust and strong searchlight light in coal mines, the existing dark channel prior defogging algorithm is difficult to accurately defogging, resulting in poor image defogging effect and affecting the accuracy of safety protection equipment detection.

Method used

An improved dark channel prior dehazing algorithm is adopted, by introducing brightness information and gradient information, adjusting the size of the sliding window, distinguishing the smoke area and the searchlight area, avoiding the loss of detailed information and improving the filtering effect.

Benefits of technology

It improves the image defogging effect, enhances the accuracy of identifying workers' protective equipment, and ensures the reliability of underground coal mine safety detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118397288B
    Figure CN118397288B
Patent Text Reader

Abstract

The present invention relates to the field of image recognition technology, and in particular to a personnel safety protection equipment detection method and system based on image recognition, wherein the method comprises: using an improved dark channel priori defogging algorithm to perform defogging processing on a target image collected underground in a coal mine to obtain a result image; and performing image recognition on the result image to obtain a recognition result. That is, the scheme of the present invention can improve the defogging effect of the image, thereby improving the accuracy of the detection of coal mine personnel safety protection equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image recognition technology, and more specifically, to a personnel safety protection equipment detection method and system based on image recognition. Background Art

[0002] When mining underground in coal mines, a large amount of dust will be generated. Since dust has the effects of scattering, refraction and reflection on light, the light that reacts with dust mixes with the reflected light of the target object, causing the image capture device to capture images with a sharp decrease in clarity and contrast, making it impossible to accurately capture real image information, and thus unable to accurately identify different people or objects and judge abnormal situations in the monitoring screen image. In particular, safety detection of staff, such as identifying whether staff are wearing safety protection equipment as required. Therefore, it is necessary to perform defogging on the collected image information.

[0003] There are several techniques for dehazing images:

[0004] First, a dark channel prior dehazing algorithm is usually used to remove the smoke effect in the image. The dark channel prior dehazing algorithm is a commonly used dehazing technology for image restoration, which specifically includes four steps: the first step is to estimate the dark channel map; the second step is to estimate the atmospheric light A; the third step is to estimate the transmission map; the fourth step is to remove the fog according to the atmospheric scattering model. Among them, the specific process of estimating the dark channel map in the first step is to first obtain the initial dark channel map, and then use the minimum value filter to filter the initial dark channel map to obtain the dark channel map.

[0005] Secondly, the patent application document with application publication number CN117314760A and titled “A method for restoring coal mine underground images with clarity” discloses obtaining a low-frequency image of the original image of a coal mine underground, and then using a dark channel priori defogging algorithm to process the image. Specifically, the initial dark channel is first obtained, and then it is smoothed through a large window guided filter to obtain an accurate dark channel, and the ambient luminosity and ambient atmospheric light of each pixel are calculated using an empirical formula to obtain an accurate transmittance, and the resulting image is obtained to obtain a clear image. The above scheme uses guided filtering instead of minimum filtering to process the initial dark channel image.

[0006] It should be noted that although the dark channel prior defogging algorithm or the improved dark channel prior defogging algorithm can improve image clarity, both methods do not take into account the situation that the light of the searchlights installed in the coal mine is very strong. At this time, there are often large bright areas in the image area close to the searchlights. The pixel values ​​of the bright areas are generally large, which are easily interfered by the searchlights, making it difficult to find the grayscale values ​​of the pixels corresponding to the smoke concentration, which often leads to the suppression of the dark areas in the acquired dark channel image, making the subsequent global atmospheric light value estimation inaccurate, and causing the bright areas of the image after defogging to be distorted; therefore, the above scheme has the problem of poor defogging effect.

[0007] Therefore, it is particularly important to improve the defogging effect of images and thus improve the accuracy of detection of safety protection equipment for coal mine personnel. Summary of the invention

[0008] The purpose of the present invention is to propose a personnel safety protection equipment detection method and system based on image recognition, so as to solve the problem in the prior art that due to the strong light conditions in coal mines, the defogging effect is poor when the traditional dark channel prior algorithm is used for image defogging; to this end, the present invention provides solutions in the following two aspects.

[0009] In a first aspect, the present invention provides a method for detecting personnel safety protection equipment based on image recognition, comprising:

[0010] Using an improved dark channel priori defogging algorithm to perform defogging processing on the target image collected in the coal mine, to obtain a result image; performing image recognition on the result image, to obtain a recognition result;

[0011] The process of estimating the dark channel map in the improved dark channel priori defogging algorithm is as follows:

[0012] Acquire an initial dark channel image of the target image;

[0013] Obtain a sliding window of each pixel point in the initial dark channel image, and use the sliding window to filter the corresponding pixel points in the initial dark channel image to obtain a dark channel image;

[0014] The size of the sliding window for: ; is the initial window size, is the first index of the i-th pixel in the initial dark channel image, is the second index of the i-th pixel in the initial dark channel image, is the upward rounding function, exp( ) is the exponential function with the natural constant e as the base, To set parameters; the first indicator is negatively correlated with the grayscale difference and positively correlated with the brightness difference; the second indicator is positively correlated with the gradient difference; the grayscale difference, brightness difference and gradient difference respectively represent the grayscale change, brightness change and gradient change of the reference pixel in the target image, and the reference pixel has the same pixel position as the i-th pixel.

[0015] The above scheme introduces brightness information and grayscale information to judge the searchlight area in the captured image, and introduces gradient information to further distinguish the smoke area and the searchlight area. Then, during the subsequent filtering process, the window size of the pixel points belonging to the searchlight area is enlarged to avoid losing detail information, thereby improving the filtering effect and the accuracy of identifying the protective equipment of the staff.

[0016] In one embodiment, the brightness difference is: taking any pixel point in the initial dark channel image as a target pixel point; obtaining an initial window and its neighborhood window with the target pixel point as the center point;

[0017] Calculate the brightness mean of the initial window where the reference pixel corresponding to the target pixel is located and all its neighborhood windows; take the ratio of the brightness mean to the maximum brightness value of the initial window as the brightness degree; take the difference between the local maximum brightness value and the brightness mean of the initial window as the initial unevenness; take the difference between the local maximum brightness value and the corresponding brightness mean of each neighborhood window as the neighborhood unevenness; take the extreme difference of all neighborhood unevenness as the brightness difference; obtain the brightness difference according to the brightness degree, the initial unevenness and the brightness difference; the brightness difference is positively correlated with the initial unevenness, and negatively correlated with the brightness degree and the brightness difference.

[0018] By analyzing the brightness of the target image corresponding to the initial dark channel image, the searchlight area can be extracted.

[0019] In one embodiment, the brightness difference is:

[0020] ;

[0021] in, is the brightness difference of the i-th pixel in the initial dark channel image, is the brightness of the initial window where the i-th pixel is located, is the brightness difference, exp( ) is an exponential function with the natural constant e as the base, is the initial unevenness of the initial window where the i-th pixel is located.

[0022] In one embodiment, the grayscale difference is the mean of the sum of the horizontal gradient grayscale change and the vertical gradient grayscale change; wherein the horizontal gradient grayscale change and the vertical gradient grayscale change are as follows: the initial window where the reference pixel in the target image is located and all its neighborhood windows are divided in the row direction and the column direction respectively, wherein the reference pixel in the target image corresponds to the target pixel; the windows in the same row direction are divided into one group to obtain three groups, the grayscale means of all pixels in each group are calculated respectively, and the absolute value of the difference between the grayscale means of any two adjacent groups is calculated, and the absolute value of the difference between the two absolute values ​​of the difference is used as the horizontal gradient grayscale change; the windows in the same column direction are divided into one group to obtain three groups, the grayscale means of all pixels in each group are calculated respectively, and the absolute value of the difference between the grayscale means of any two adjacent groups is calculated, and the absolute value of the difference between the two absolute values ​​of the difference is used as the vertical gradient grayscale change.

[0023] In the above scheme, by analyzing the combination of windows in the same row and column direction in the window of the target pixel point, the grayscale change of the pixel point in the same direction can be determined, thereby determining the possibility of belonging to the searchlight area.

[0024] In one embodiment, the second indicator for:

[0025] ;in, is the brightness of the initial window where the i-th pixel is located, is the gradient difference of the i-th pixel, , J is the total number of neighborhood windows, is the maximum gradient value of the pixel in the target image, is the gradient mean of all pixels in the initial window where the i-th pixel is located, is the gradient mean of all pixels in the jth neighborhood window of the initial window where the i-th pixel is located, and exp( ) is an exponential function with the natural constant e as the base.

[0026] The above solution provides a method for accurately calculating the second indicator.

[0027] In one embodiment, the specific process of performing image recognition on the result image to obtain the recognition result is:

[0028] The dehazed image is input into the trained target detection model to identify the target personnel who are not wearing protective equipment and give reminders.

[0029] In the above, by using the target detection model to recognize the defogged image, the recognition efficiency can be improved.

[0030] In one embodiment, the target detection model is a YOLO network model.

[0031] In a second aspect, a personnel safety protection equipment detection system based on image recognition is characterized by comprising:

[0032] processor;

[0033] A memory stores computer instructions for detecting personnel safety protection equipment based on image recognition. When the computer instructions are executed by the processor, the system executes the above-mentioned method for detecting personnel safety protection equipment based on image recognition.

[0034] The beneficial effects of the present invention are as follows: the scheme of the present invention judges the searchlight area existing in the captured image by introducing brightness information and grayscale information, and introduces gradient information to further distinguish the smoke area and the searchlight area, and then in the subsequent filtering processing, the window size of the pixel points belonging to the searchlight area is enlarged to avoid the loss of detail information, thereby improving the filtering effect and the accuracy of identifying the protective equipment of the staff. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:

[0036] Figure 1 The following is a schematic flowchart of the steps of the personnel safety protection equipment detection method based on image recognition in this embodiment;

[0037] Figure 2 The schematic diagram of the initial window and the neighborhood window in this embodiment is schematically shown;

[0038] Figure 3 The structural block diagram of the personnel safety protection equipment detection system based on image recognition in this embodiment is schematically shown. DETAILED DESCRIPTION

[0039] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0040] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0041] The present invention is aimed at safety inspection of equipment or personnel in coal mine scenes. Before the safety inspection is carried out, due to the influence of the smoke effect generated by the dust in the coal mine scene, the collected target image has a smoke effect, so defogging processing is required.

[0042] However, in the prior art, since the light from the searchlights installed in the coal mine is very strong, the dark areas in the acquired dark channel image are often suppressed, making the subsequent global atmospheric light value estimation inaccurate, and thus making it impossible to obtain a high-quality dehazed image.

[0043] Based on the above problems, the present invention provides a personnel safety protection equipment detection method and system based on image recognition to improve the defogging effect of the collected images and avoid inaccurate global atmospheric light value estimation due to external ambient light, thereby failing to accurately detect abnormalities of personnel safety protection equipment.

[0044] Specifically, taking workers in coal mines as an example, the personnel safety protection equipment detection method based on image recognition of the present invention is introduced.

[0045] like Figure 1 As shown, the personnel safety protection equipment detection method based on image recognition in this embodiment includes the following steps:

[0046] In step S1, an improved dark channel prior defogging algorithm is used to perform defogging processing on the collected target image of the coal mine to obtain a result image.

[0047] In this embodiment, a monitoring device disposed underground in a coal mine is used to collect a target image in a coal mine scene in real time; the target image is specifically an image of a worker underground in the coal mine.

[0048] The improved dark channel priori defogging algorithm in this embodiment mainly improves the estimated dark channel map in the first step, while the second to fourth steps are not improved.

[0049] The improved dark channel prior defogging algorithm estimates the dark channel map, including steps S11-S12, which are as follows:

[0050] Step S11, obtaining an initial dark channel map of the target image; specifically, taking the minimum value of the three RGB channels in the target image as the initial dark channel map.

[0051] Step S12, obtaining a sliding window of each pixel point in the initial dark channel image, and using the sliding window to perform filtering processing on the corresponding pixel points in the initial dark channel image to obtain a dark channel image.

[0052] Since the collected target image is easily affected by external environmental factors, the detail information of the areas where different pixels are located is also different. When estimating the dark channel map, if the initial dark channel map is filtered according to a window of a fixed size, there may be a problem of detail loss. Therefore, it is necessary to determine the sliding window of each pixel in the initial dark channel map, and the size of the sliding window of each pixel may be different or the same.

[0053] The process of obtaining the sliding window in this embodiment is as follows:

[0054] First, any pixel point in the initial dark channel image is taken as a target pixel point, the brightness difference and grayscale difference of the target pixel point are obtained, and the first index is obtained based on the brightness difference and grayscale difference.

[0055] Since the searchlight has a higher brightness in the target image, and compared with the brightness of the smoke area, the brightness of the searchlight area is higher and more uniform, the possibility of the area in the target image that may be the searchlight can be obtained according to the brightness of each pixel in the target image, that is, by calculating the brightness difference of any pixel in the initial dark channel image, the possibility of the pixel being the searchlight area can be characterized.

[0056] The process of obtaining the brightness difference is:

[0057] First, any pixel in the initial dark channel image is taken as the target pixel; an initial window with the target pixel as the center point and its neighborhood window are obtained. Specifically, the initial window is a manually set window, such as the size of the initial window can be , The value may be 5. Of course, as other implementations, it may be adjusted according to actual conditions, such as taking a value of 3 or 7.

[0058] For example, taking eight neighborhoods as an example, Figure 2 As shown, the initial window ( Figure 2 The neighbor window (the window on the left in Figure 2 There are eight neighboring windows (in the dashed part on the right side of the figure), namely, neighborhood window ①, neighborhood window ②, neighborhood window ③, neighborhood window ④, neighborhood window ⑤, neighborhood window ⑥, neighborhood window ⑦ and neighborhood window ⑧. Of course, there can be 4 neighboring windows, namely Figure 2 It should be noted that the sequence numbers in the above are only used to distinguish the numbering of the neighborhood windows, and are not limited to the above sequence.

[0059] Second, calculate the brightness mean of the initial window and all its neighboring windows where the reference pixel point in the target image corresponding to the target pixel point is located; and take the ratio of the brightness mean of the initial window to the maximum brightness value in the target image as the brightness degree.

[0060] Specifically, since the initial dark channel image and the target image are of the same size, each pixel in the initial dark channel image corresponds one-to-one to the corresponding reference pixel in the target image (one-to-one correspondence refers to the pixel and reference pixel having the same position coordinates). Therefore, in this embodiment, the brightness information of each reference pixel in the target image is obtained to reflect the brightness of the pixel in the initial dark channel image.

[0061] The above brightness information is obtained by converting the target image of the coal mine scene collected in real time from the RGB color space to the HSV color space to obtain the corresponding brightness image, and then obtain the brightness of each pixel in the brightness image; then obtain the brightness information of the reference pixel in the target image with the same position as the pixel in the brightness image.

[0062] In this embodiment, all pixels in the initial window and each neighborhood window have corresponding reference pixels in the target image, and each reference pixel corresponds to a brightness. Therefore, the average brightness corresponding to each window can be calculated, and each brightness average is used as the brightness of the target pixel to the window.

[0063] Third, the difference between the local maximum brightness value and the brightness mean of the initial window is taken as the initial unevenness; the difference between the local maximum brightness value and the corresponding brightness mean of each neighborhood window is taken as the neighborhood unevenness; and the extreme difference of all neighborhood unevenness is taken as the brightness difference.

[0064] The initial unevenness can be the ratio of the difference between the local maximum brightness value and the brightness mean value of the initial window to the corresponding local maximum brightness value. It is the ratio of the difference between the local maximum brightness value and the brightness mean value of the neighborhood window to the corresponding local maximum brightness value.

[0065] Of course, as another implementation, the initial unevenness can also be: taking the i-th pixel as the target pixel and the target pixel as the center of the initial window as an example, the initial unevenness of the initial window where the i-th pixel is located is calculated as for: ;in, represents the mean brightness of the initial window where the i-th pixel is located, Represents the local maximum brightness value of the pixel in the initial window where the i-th pixel is located. is the maximum brightness value.

[0066] The above is the brightness difference corresponding to the initial window. The larger the value, the more uneven the image brightness within the range, and the less likely this area is to be a searchlight area. In this case, it may be necessary to ensure that the sliding window is as small as possible to retain the information in the initial dark channel image. On the contrary, the more uniform the image brightness, the more likely this area is to be a searchlight area, and in this case, the sliding window needs to be enlarged. is the difference between the maximum brightness value of the global pixel of the image and the brightness within the original image range corresponding to the initial window. This value is used to Normalization is performed to obtain the initial unevenness of the initial window corresponding to the original image position.

[0067] Among them, the neighborhood unevenness You can also: ;in, is the local maximum brightness value of the pixel in the jth neighborhood window of the initial window where the i-th pixel is located, is the brightness mean of the jth neighborhood window of the initial window where the i-th pixel is located, is the maximum brightness value.

[0068] As the initial window slides to the edge of the searchlight, the initial unevenness It will suddenly increase and affect the judgment of the searchlight area. Therefore, it is also necessary to determine the neighborhood unevenness to correct the inaccuracy of edge judgment.

[0069] Fourth, the brightness difference is obtained according to the brightness level, the initial non-uniformity and the brightness difference.

[0070] The brightness difference in this embodiment is: ;in, is the brightness difference of the i-th pixel in the initial dark channel image, is the brightness of the i-th pixel, is the brightness difference, exp( ) is an exponential function with the natural constant e as the base, is the initial unevenness of the initial window where the i-th pixel is located.

[0071] The brightness difference above is the difference between the maximum brightness unevenness and the minimum brightness unevenness in the neighborhood unevenness in all neighborhood windows. The larger the value, the more likely the initial window is at the edge of the searchlight area. The smaller the value, the more likely the initial window is not near the searchlight area or within the searchlight range. Because the brightness of the image within the searchlight range is higher than the global brightness of the image, when The larger the value, the more likely the initial window is in the searchlight area. The smaller the initial window is, the more likely it is to be in an area other than the searchlight area, so the brightness difference is multiplied by , so that When the value is larger, the brightness difference is greater, and vice versa, the brightness difference is caused by Decide.

[0072] In another embodiment, the brightness difference may also be: ;in, is the brightness difference of the i-th pixel in the initial dark channel image, is the brightness of the i-th pixel, is the brightness difference, exp( ) is an exponential function with the natural constant e as the base, is the initial unevenness of the initial window where the i-th pixel is located.

[0073] Furthermore, since there may be some white objects in the target image whose brightness features are similar to those of a searchlight, such as pipes and walls, if the brightness difference is directly used to adjust the size of the initial window, these features may be corroded, thereby causing the dark channel image to lose certain detail information. Therefore, based on the fact that the smoke and dust concentration in the coal mine scene is relatively high, a certain light gradient effect will be produced under the illumination of the searchlight, and this embodiment also calculates the grayscale difference.

[0074] Specifically, the grayscale difference of the target pixel is the average of the sum of the horizontal gradient grayscale change and the vertical gradient grayscale change of the target pixel.

[0075] Specifically, the process of obtaining the horizontal gradient grayscale change and the vertical gradient grayscale change is as follows:

[0076] For the initial window and neighborhood window centered on any pixel point, the windows are divided according to the row and column directions of the image. The windows corresponding to the same row direction are divided into one group to obtain three groups. The mean of the sum of the grayscale means of all windows in each group is calculated, and the absolute value of the difference between the means of any two adjacent groups is calculated, and the absolute value of the difference between the two difference absolute values ​​is used as the horizontal gradient grayscale change; the windows corresponding to the same column direction are divided into one group to obtain three groups. The mean of the sum of the grayscale means of all windows in each group is calculated, and the absolute value of the difference between the means of any two adjacent groups is calculated, and the absolute value of the difference between the two difference absolute values ​​is used as the vertical gradient grayscale change.

[0077] The neighborhood window in this embodiment can be an eight-neighborhood window or a four-neighborhood window. Figure 2As shown, taking eight neighborhood windows as an example, three groups of windows in the row direction and three groups of windows in the column direction are introduced, that is, the first group of windows of the horizontal gradient grayscale feature includes neighborhood window ①, neighborhood window ② and neighborhood window ③ in the row direction, the second group of windows includes neighborhood window ④, initial window and neighborhood window ⑧, and the third group of windows includes neighborhood window ⑤, neighborhood window ⑥ and neighborhood window ⑦; wherein the first group of windows and the second group of windows are adjacent to each other up and down, and the second group of windows and the third group of windows are adjacent to each other up and down; similarly, the first group of windows in the column direction includes neighborhood window ①, neighborhood window ⑦ and neighborhood window ⑧, the second group of windows includes neighborhood window ②, initial window and neighborhood window ⑥, and the third group of windows includes neighborhood window ③, neighborhood window ④ and neighborhood window ⑤; wherein the first group of windows and the second group of windows are adjacent to each other left and right, and the second group of windows and the third group of windows are adjacent to each other left and right. Of course, it should be noted that the first, second and third of the three groups of windows in this embodiment are only for distinction, and they do not have a specific physical meaning. Taking the three groups of windows in the row direction as an example, the first group can also be neighborhood window ⑤, neighborhood window ⑥ and neighborhood window ⑦, and the third group can also be neighborhood window ①, neighborhood window ② and neighborhood window ③. Furthermore, in order to reduce the amount of calculation, it is also necessary to normalize the horizontal gradient grayscale change and the vertical gradient grayscale change to obtain the normalized horizontal gradient grayscale change and the normalized vertical gradient grayscale change, as follows:

[0078] Normalized horizontal gradient grayscale change for:

[0079] ;in, , , They are respectively the grayscale mean of the pixels in the target image corresponding to the first group of windows when the i-th pixel is located in the initial window, the grayscale mean of the pixels in the target image corresponding to the second group of windows, and the grayscale mean of the pixels in the target image corresponding to the third group of windows, and h is the row direction.

[0080] Among them, the normalized vertical gradient grayscale change for:

[0081] ;

[0082] in, , , They are respectively the grayscale mean of the pixels in the target image corresponding to the first group of windows when the i-th pixel is located in the initial window, the grayscale mean of the pixels in the target image corresponding to the second group of windows, and the grayscale mean of the pixels in the target image corresponding to the third group of windows, and z is the column direction.

[0083] For the horizontal gradient grayscale change, Indicates the grayscale value on the upper side of the initial window. Indicates the grayscale value on the middle of the initial window. Indicates the grayscale value at the bottom of the initial window. and They represent the grayscale value difference between the grayscale value on the upper side of the initial window and the grayscale value in the middle of the initial window, and the grayscale value difference between the grayscale value in the middle of the initial window and the grayscale value in the lower side of the initial window. Since the grayscale value of the image in the light gradient effect area changes gradually, when The smaller it is, the more likely the corresponding area is to be a light gradient effect area, and the more likely it is to be near the searchlight area. Otherwise, the corresponding area is more likely to be other areas.

[0084] For the vertical gradient grayscale change, the grayscale value difference between the grayscale value on the left side of the initial window and the grayscale value on the right side has a similar effect on whether the corresponding image area is a gradient area, and the vertical gradient grayscale change is obtained by similar calculation. , I will not go into details here.

[0085] The first indicator in this embodiment is: ;in, is the first index of the i-th pixel, is the brightness difference of the i-th pixel, is the grayscale difference of the i-th pixel, and are the normalized horizontal gradient grayscale change and vertical gradient grayscale change respectively, and exp( ) is an exponential function with the natural constant e as the base.

[0086] In the above formula, the grayscale difference represents the possibility that there is a gradient area (searchlight area) near the initial window where the target pixel is located. When the grayscale difference is smaller, The larger the value of , the more likely the corresponding area is the gradient light area near the searchlight area. Conversely, the more likely the corresponding area is other areas outside the searchlight area. right Make corrections.

[0087] In this embodiment, by introducing brightness information and grayscale information, the searchlight area in the captured image is judged, and the window size of the pixel points belonging to the searchlight area can be enlarged during subsequent filtering processing to avoid losing detail information.

[0088] Secondly, a second index is obtained, wherein the second index is related to the ratio of the brightness mean value of the initial window where the target pixel point is located to the maximum brightness value in the target image and the gradient difference.

[0089] Among them, the second indicator for: ;in, is the brightness of the initial window where the i-th pixel is located, is the gradient difference of the i-th pixel, , J is the total number of neighborhood windows, is the maximum gradient value of the pixel in the target image, is the gradient mean of all pixels in the initial window where the i-th pixel is located, is the gradient mean of all pixels in the jth neighborhood window of the initial window where the i-th pixel is located, and exp( ) is an exponential function with the natural constant e as the base.

[0090] The value of J in the above description is 8, but it can also be 4.

[0091] Among them, the brightness The larger the value, the more likely the area corresponding to the initial window is a high-brightness area of ​​smoke or searchlights. Conversely, it is more likely to be a low-brightness area. Compared with other high-brightness areas (such as searchlight areas), smoke has irregular shapes and uneven concentrations, so the gradient difference is introduced. , that is, the larger the gradient difference, the more complex the edge of the area corresponding to all neighboring windows in the target image corresponding to the initial window, and the more likely the range in the target image corresponding to the initial window is a smoke area. Therefore, through the gradient difference Brightness Make corrections.

[0092] Right now Represents the average value of the gradient difference between the initial window and its corresponding neighborhood window. The larger the value, the more likely the initial window corresponds to the original image in the smoke area. right The greater the amplification, the larger the second indicator; conversely, the less likely it is to be in the smoke area, right The smaller the reduction, the more the size of the second indicator depends on .

[0093] is the difference between the mean gradient of the initial window and the mean gradient of any neighboring window corresponding to the initial window. right Normalize it, The larger it is, the more complex the edge of the area corresponding to the jth neighborhood window in the target image corresponding to the initial window is, and the more likely the range in the target image corresponding to the initial window is to be a smoke area, otherwise, it is less likely to be in a smoke area.

[0094] Among them, since the first index is obtained based on the searchlight area, and the smoke area is the main body of the image processing of the dark channel prior algorithm. Since there are usually complex air flows in coal mine areas, the wind speed and direction will change continuously. These airflows have a great influence on the diffusion and shape of smoke, so the smoke in the image usually presents an irregular shape and uneven concentration. At this time, there is also a certain gradient in the smoke part of the low-concentration area, which makes it impossible to reduce the window in places with high smoke concentration when using brightness and grayscale to determine the window size. Therefore, it is easy to mistake some smoke areas for searchlight areas. Due to the introduction of gradient information (relative to the searchlight area, the smoke has the property of uneven concentration, and the uneven concentration of smoke is reflected in the image features as having more edges, that is, having a higher gradient; while the gradient of the gradient area generated by the searchlight is relatively uniform), when the window slides to the high-concentration smoke area, the window can be reduced to retain the smoke details.

[0095] Then, the initial window of the target pixel is adjusted based on the first index and the second index to obtain a sliding window. Specifically, the size of the sliding window is for:

[0096] ;

[0097] in, is the initial window size, is the first index of the i-th pixel in the initial dark channel image, is the second index of the i-th pixel in the initial dark channel image, is the upward rounding function, exp( ) is the exponential function with the natural constant e as the base, To set parameters.

[0098] Among the above The smaller it is, the more likely the area where the initial window is located is the searchlight area, so the size of the sliding window should be increased, and the enlarged sliding window should be used for corrosion operation to reduce the impact of the searchlight area on the dark channel image. The larger it is, the less likely the area where the initial window is located is to be a searchlight area, and the size of the sliding window should be reduced to retain the image details in the dark channel image. The smaller the value, the more likely the area where the initial window is located is a smoke area. In this case, the size of the sliding window should be reduced, and a small window should be used for corrosion operation to retain more smoke details in the dark channel image. The larger the value is, the more likely the area where the initial window is located is outside the smoke area. In this case, the size of the sliding window should be increased, and a large window should be used for corrosion operations to reduce the impact of the searchlight on the dark channel image and weaken the impact of other high-brightness areas in the image on the generated dark channel image. As the adjustment factor of the initial window, the initial window is adjusted. When the value is larger, the adjusted window should be larger, and when the value is smaller, the adjusted window should be smaller.

[0099] The above The value may be 5, and of course it may be set according to actual conditions. In order to facilitate the adjustment of the sliding window size, the form of dividing by 2, rounding up, and then multiplying by 2 plus 1 is used in the formula to limit the size of the sliding window to an odd number.

[0100] At this point, the initial dark channel image is minimum filtered using the sliding window corresponding to each pixel in the initial dark channel image to obtain a dark channel image, and then the atmospheric light is estimated, the transmission map is estimated, and the target image is defogged according to the atmospheric scattering model. Since the atmospheric light estimation, the transmission map estimation, and the target image defogging according to the atmospheric scattering model are prior arts, they will not be described in detail here.

[0101] Compared with the minimum value filtering adopted in the prior art which uses a fixed local window to filter the initial dark channel image, the solution in this embodiment can analyze the grayscale difference, brightness difference and gradient difference corresponding to each pixel point in the target image, adjust the initial window, and use the adjusted sliding window to perform minimum value filtering on the initial dark channel image, so that when calculating the dark channel image, not only the neighborhood information around the pixel point is considered, but also the influence of the searchlight on the dark channel image is weakened, thereby improving the defogging effect of the target image.

[0102] In step S2, image recognition is performed on the result image to obtain a recognition result. In this embodiment, the detection of personnel safety protection equipment is achieved by constructing a target detection model. Specifically, the defogging result image is input into the trained target detection model to obtain a recognition result, and a reminder or notification is performed based on the recognition result.

[0103] The training process of the target detection model mentioned above is:

[0104] Construct a training set, where the training set is a plurality of collected defogging images or a plurality of historically stored images. And manually annotate the training set, such as marking the wearing of protective equipment as 1, and marking the non-wearing of protective equipment as 0. The wearing of protective equipment can be one or more combinations of helmets, protective glasses, and protective masks, etc., which can be determined according to the actual scene in the coal mine.

[0105] The target detection model is trained using the training set and the corresponding labels to obtain a trained target detection model; the loss function uses the cross entropy loss.

[0106] The recognition results in the above steps classify the result images to obtain people who are not wearing protective equipment. Specifically, when a target who is not wearing protective equipment is detected, a reminder is required.

[0107] The target detection model in the above steps can be a YOLO (You nolly look once) series model or a Faster R-CNN (Region with CNN feature) model.

[0108] The reminders in the above steps can warn relevant personnel via sound, text message, email, etc.

[0109] The solution of the present invention performs image processing on the collected target image during the detection of personnel safety protection equipment in coal mines. During the image defogging process, the influence of searchlights in the environment can be avoided, the accuracy of the global atmospheric light value estimated according to the dark channel map is improved, and the image can be defogged more effectively, thereby improving the accuracy of personnel safety protection equipment detection in the image.

[0110] The present invention also provides a personnel safety protection equipment detection system based on image recognition. Figure 3 As shown, the detection system includes a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the above-mentioned personnel safety protection equipment detection method based on image recognition according to the present invention is implemented.

[0111] The detection system also includes other components familiar to those skilled in the art, such as a communication bus and a communication interface, whose configuration and functions are known in the art and thus will not be described in detail here.

[0112] In the present invention, the aforementioned memory may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, apparatus or device. For example, a computer-readable storage medium may be any appropriate magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory RRAM (Resistive Random Access Memory), a dynamic random access memory DRAM (Dynamic Random Access Memory), a static random access memory SRAM (Static Random-Access Memory), an enhanced dynamic random access memory EDRAM (Enhanced Dynamic Random Access Memory), a high-bandwidth memory HBM (High-Bandwidth Memory), a hybrid memory cube HMC (Hybrid Memory Cube), etc., or any other medium that can be used to store the required information and can be accessed by an application, a module, or both. Any such computer storage medium may be part of a device or accessible or connectable to a device. Any application or module described in the present invention may be implemented using computer-readable / executable instructions that may be stored or otherwise maintained by such a computer-readable medium.

[0113] In the description of this specification, “plurality” means at least two, such as two, three or more, etc., unless otherwise clearly and specifically defined.

[0114] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, various alternatives to the embodiments of the present invention described herein may be employed.

Claims

1. A personnel safety protection equipment detection method based on image recognition, characterized in that: include: The improved dark channel prior defogging algorithm is used to defog the target image collected in the coal mine to obtain the result image. The dehazed image is input into the trained target detection model to identify the target personnel who are not wearing protective equipment and give a reminder. The process of estimating the dark channel map in the improved dark channel priori defogging algorithm is as follows: Acquire an initial dark channel image of the target image; Obtain a sliding window of each pixel point in the initial dark channel image, and use the sliding window to filter the corresponding pixel points in the initial dark channel image to obtain a dark channel image; The size of the sliding window for: ; is the initial window size, is the first index of the i-th pixel in the initial dark channel image, is the second index of the i-th pixel in the initial dark channel image, is the upward rounding function, exp( ) is the exponential function with the natural constant e as the base, To set the parameters; the first index is negatively correlated with the grayscale difference and positively correlated with the brightness difference; The second index is positively correlated with gradient difference; Grayscale difference, brightness difference and gradient difference respectively represent the grayscale change, brightness change and gradient change of the reference pixel in the target image, and the reference pixel has the same pixel position as the i-th pixel; The brightness difference is: taking any pixel point in the initial dark channel image as the target pixel point; obtaining an initial window with the target pixel point as the center point and its neighborhood window; Calculate the brightness mean of the initial window where the reference pixel corresponding to the target pixel is located and all its neighborhood windows; take the ratio of the brightness mean of the initial window to the maximum brightness value in the target image as the brightness degree; take the difference between the local maximum brightness value of the initial window and the brightness mean as the initial unevenness; take the difference between the local maximum brightness value of each neighborhood window and the corresponding brightness mean as the neighborhood unevenness; take the extreme difference of all neighborhood unevenness as the brightness difference; obtain the brightness difference according to the brightness degree, initial unevenness and brightness difference; The brightness difference is positively correlated with the initial unevenness, and negatively correlated with the brightness level and the brightness difference.

2. The method for detecting personnel safety protection equipment based on image recognition according to claim 1, characterized in that: The brightness difference is: ; in, is the brightness difference of the i-th pixel in the initial dark channel image, is the brightness of the initial window where the i-th pixel is located, is the brightness difference, exp( ) is an exponential function with the natural constant e as the base, is the initial unevenness of the initial window where the i-th pixel is located.

3. The method for detecting personnel safety protection equipment based on image recognition according to claim 1, characterized in that: The grayscale difference is the mean of the sum of the horizontal gradient grayscale change and the vertical gradient grayscale change; wherein, the horizontal gradient grayscale change and the vertical gradient grayscale change are: the initial window where the reference pixel point in the target image is located and all its neighborhood windows are divided in the row direction and the column direction respectively, wherein the reference pixel point in the target image corresponds to the target pixel point; the windows in the same row direction are divided into one group to obtain three groups, the grayscale mean of all pixels in each group is calculated respectively, and the absolute value of the difference between the grayscale means of any two adjacent groups is calculated, and the absolute value of the difference between the two difference absolute values ​​is used as the horizontal gradient grayscale change; the windows in the same column direction are divided into one group to obtain three groups, the grayscale mean of all pixels in each group is calculated respectively, and the absolute value of the difference between the grayscale means of any two adjacent groups is calculated, and the absolute value of the difference between the two difference absolute values ​​is used as the vertical gradient grayscale change.

4. The method for detecting personnel safety protection equipment based on image recognition according to claim 1, characterized in that: The second indicator for: ;in, is the brightness of the initial window where the i-th pixel is located, is the gradient difference of the i-th pixel, , J is the total number of neighborhood windows, is the maximum gradient value of the pixel in the target image, is the gradient mean of all pixels in the initial window where the i-th pixel is located, is the gradient mean of all pixels in the jth neighborhood window of the initial window where the i-th pixel is located, and exp( ) is an exponential function with the natural constant e as the base.

5. The method for detecting personnel safety protection equipment based on image recognition according to claim 1, characterized in that: The target detection model is a YOLO network model.

6. Personnel safety protection equipment detection system based on image recognition, characterized in that: include: processor; A memory storing computer instructions for detecting personnel safety protection equipment based on image recognition, wherein when the computer instructions are executed by the processor, the system executes the method for detecting personnel safety protection equipment based on image recognition according to any one of claims 1 to 5.