A method for face recognition of coal miners
By extracting coal mine dust style, style conversion and simulating coal mine scene lighting, the coal miner face recognition model is trained, which solves the problem of poor face recognition effect of coal miners and improves the recognition accuracy and adaptability.
Patent Information
- Application Number
- CN202210597262.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-30
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2042-05-30
AI Technical Summary
Existing face recognition technology has poor performance in face recognition of coal miners, mainly due to the complex lighting environment of coal mines, the influence of coal mine dust and safety helmets, the difficulty of data acquisition, and the difficulty of improving recognition accuracy with general models.
By collecting background images of miners' faces, background images of ordinary people's faces and foreground images of hard hats, we extract the style of coal mine dust, conduct style conversion and locate key points on faces, synthesize and simulate the lighting conditions of real coal mine scenes, and train coal miners' face recognition models. .
It improves the adaptability and accuracy of the coal miners' face recognition model, reduces the difficulty of data acquisition, improves the accuracy of coal miners' face recognition, while retaining the model's generalization ability.
Smart Images

Figure CN115050068B
Abstract
Description
Technical Field
[0001] The present application belongs to the field of face recognition technology, and more specifically, to a method for face recognition of coal miners. Background Art
[0002] Due to the rapid development of deep learning, face recognition has also developed rapidly, with greatly improved accuracy and speed. However, in the application of face recognition, face recognition often plays a very important role in specific scenarios and specific groups, such as coal miners, and general face recognition models have poor recognition effects in these characteristic scenarios and groups. Existing face recognition technologies are mainly divided into two categories. The first category is based on traditional manually designed face features to obtain face recognition results; the second category is based on deep learning to automatically extract features, and the features automatically extracted from the training data are trained to obtain a face recognition model.
[0003] Both the early traditional methods and the latest deep learning facial feature extraction are aimed at general scenarios. For miners in coal mine environments, the light environment is dim, the light direction is complex, and the coal dust and safety helmets on the faces of coal miners have a great impact on facial recognition, so the recognition effect is not good. In addition, since the data of coal miners is difficult to collect in large quantities, and the difference between them and normal faces in general situations is also relatively large, therefore, collecting the corresponding data and adding it to the training set cannot improve the accuracy of the model very well. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a method for face recognition of coal miners, so as to solve the technical problems existing in the prior art of face recognition of coal miners, such as difficulty in acquiring image data and poor recognition effect.
[0005] To achieve the above purpose, the technical solution adopted in this application is: to provide a coal miner face recognition method, comprising the following steps:
[0006] Collect a number of miner face background images, a number of ordinary human face background images, and a number of miner helmet foreground images;
[0007] Extract the coal dust style from any miner's face background image, and perform style transfer on any normal person's face background image;
[0008] The facial key points of the style-converted image are first located, and then synthesized with the foreground image of the miner's helmet;
[0009] Simulate real coal mine scenes to adjust the lighting conditions of the synthetic images;
[0010] The adjusted image is used together with the initial miner face background image, the ordinary face background image, and the style-converted image to train the coal miner face recognition model.
[0011] Preferably, the method for extracting the coal mine dust style from any miner's face background image comprises the following steps:
[0012] Input any miner face background image;
[0013] Multiple convolutional layers conv for extracting features extract makeup;
[0014] Perform a nonlinear mapping on the latent code and map it to a decoupling space;
[0015] Divide it into three components: mouth, eyes, and skin, and map these three components separately.
[0016] Preferably, the method for extracting the coal mine dust style from any miner's face background image comprises the following steps:
[0017] Input any miner face background image;
[0018] Face ID information is extracted by multiple convolutional layers conv for extracting features and multiple resblocks.
[0019] Preferably, the method of first locating facial key points on an image after style conversion comprises the following steps:
[0020] Detect the face in the style-converted image and obtain the face position (x, y) as well as the width w and height h of the face;
[0021] The face area of the image is expanded and cropped according to the face position (x, y) and the width w and height h of the face. The width W and height H of the face expansion area are calculated by the following formula:
[0022] W = 1.2 × w, H = 1.15 × h;
[0023] The key point detection is performed on the expanded face area obtained after expansion and cropping, and the coordinates of 108 key points of the face {[x1, y1], [x2, y2], ..., [x 108 ,y 108 ]}; Calculate the coordinates of the highest point of the eyebrow position [x n ,y n ], where y n As the lowest point of the miner's helmet occluded in the face expansion area in the synthesis of the face wearing the miner's helmet;
[0024] The actual face width w is calculated based on the coordinate distribution of 108 key points face ,Right now:
[0025] w face =|max({x1,x2,...,x 108})-min({x1,x2,...,x 108})|.
[0026] Preferably, the method for synthesizing the foreground image with the miner's helmet comprises the following steps:
[0027] Choose any miner helmet foreground image and the corresponding mask image;
[0028] According to w face Calculate the width w of the miner's helmet foreground image helmet , where: w helmet =1.28×w face ; Calculate the height h of the miner's helmet foreground image by proportionality helmet ,Right now: Among them, H ori_helmet is the original height of the miner helmet foreground image, W ori_helmet is the original width of the miner’s helmet foreground image;
[0029] According to the calculation, w helmet and h helmet The miner's helmet foreground image and the corresponding mask image are scaled in equal proportion to obtain a miner's helmet foreground image that matches the size of a human face wearing a helmet.
[0030] Perform edge erosion and Gaussian blur processing on the scaled mask image;
[0031] The processed mask image, the miner's helmet foreground image and the image after the facial key points are located are pasted and synthesized.
[0032] Preferably, after pasting and synthesizing the processed mask image, the miner's helmet foreground image and the image after the facial key points are located, the method further comprises the steps of:
[0033] The processed mask image and the area of the miner's helmet foreground image that exceeds the image after the facial key points are located are cut off.
[0034] Preferably, the method for simulating a real coal mine scene to adjust the lighting conditions of a synthetic image comprises the following steps:
[0035] Detect the average brightness L of the left half of the face in the composite image l1 and the average brightness L of the right half of the face r1 ;
[0036] Detect the average brightness L of the left half of the miner's helmet in the synthetic image l2 and the average brightness L of the right half of the miner's helmet r2 ;
[0037] Adjust the average brightness of the left half of the face and the left half of the miner's helmet in the composite image to Adjust the average brightness of the right half of the face and the right half of the miner's helmet in the composite image to
[0038] Preferably, the method for simulating a real coal mine scene to adjust the lighting conditions of the synthetic image further comprises the following steps:
[0039] Extract multiple composite images in proportion;
[0040] Select the center point on the miner's helmet in the composite image;
[0041] Dividing the composite image into a plurality of stepped regions according to the distance from the center point;
[0042] The brightness of the synthesized image is globally increased, wherein the brightness of the step area closer to the center point is increased more.
[0043] Preferably, the method of selecting the center point on the miner's helmet in the composite image comprises the following steps:
[0044] Select a rectangular frame for the miner's helmet in the composite image;
[0045] Get the vertex coordinates of the rectangular box;
[0046] Find the center point of the rectangular box.
[0047] Preferably, the method for simulating a real coal mine scene to adjust the lighting conditions of the synthetic image further comprises the following steps:
[0048] Extract multiple composite images in proportion;
[0049] A boundary line is randomly generated in the synthetic image, and the boundary line passes through any area of the face or the miner's helmet;
[0050] The area on one side of the boundary line in the composite image is randomly selected to reduce or increase the brightness.
[0051] Compared with the prior art, the coal miner face recognition method provided by the present application extracts and migrates the coal mine dust style of the real miner face background image based on the characteristics of the real coal mine scene, synthesizes the miner's helmet after locating the key points of face detection, simulates the real coal mine scene to adjust the lighting conditions of the synthesized image, and makes the coal mine dust style match the lighting conditions of the background, thereby improving the adaptability of the coal miner face recognition model, reducing the difficulty of data acquisition, and improving the accuracy of the coal miner face recognition model in coal miner face recognition, while retaining the generalization ability of the coal miner face recognition model. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0053] Figure 1 A schematic diagram of the process of the face recognition method for coal miners provided in the embodiment of the present application;
[0054] Figure 2 This is a schematic diagram of step S02 in the method for face recognition of coal miners;
[0055] Figure 3 This is a schematic diagram of step S03 in the face recognition method for coal miners;
[0056] Figure 4 A schematic diagram of extracting the coal mine dust style in step S02 of the coal miner face recognition method;
[0057] Figure 5 Another schematic diagram of extracting the coal mine dust style in step S02 of the coal miner face recognition method. DETAILED DESCRIPTION
[0058] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0059] It should be noted that when an element is referred to as being "fixed to" or "disposed on" another element, it can be directly on the other element or indirectly on the other element. When an element is referred to as being "connected to" another element, it can be directly connected to the other element or indirectly connected to the other element.
[0060] It should be understood that the terms "length", "width", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating the orientation or position relationship, are based on the orientation or position relationship shown in the drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present application.
[0061] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0062] Please also read Figures 1 to 3 The face recognition method for coal miners provided in the embodiment of the present application is now described. The face recognition method for coal miners comprises the following steps:
[0063] Step S01, collecting a number of miner face background images, a number of ordinary human face background images, and a number of miner helmet foreground images;
[0064] Step S02, extracting the coal mine dust style from any miner face background image, and performing style conversion on any ordinary person face background image;
[0065] Step S03, first locate the key points of the face in the image after style conversion, and then synthesize it with the foreground image of the miner's helmet;
[0066] Step S04, simulating a real coal mine scene to adjust the lighting conditions of the synthetic image;
[0067] Step S05, training a coal miner face recognition model by using the adjusted image together with the initial coal miner face background image, the ordinary person face background image, and the image after style conversion.
[0068] It can be understood that in step S01, the miner's face background image should be understood as a miner's face image taken in a real coal mine scene, and the ordinary person's face background image should be understood as all publicly and legally taken face images other than coal mine scenes. The miner's face background image and the ordinary person's face background image are opposite to each other.
[0069] In step S02, since the positions of the miners' mouths, eyes, skin, etc. in the real coal mine scene generally have obvious coal mine dust styles compared to people in natural scenes, the GAN model can be used to extract the coal mine dust style in the miner's face background image, and perform style conversion on the ordinary face background image, so that the ordinary face background image has an obvious coal mine dust style. Assuming that 100 miner's face background images and 100 ordinary face background images are collected, by extracting the coal mine dust style from any miner's face background image and performing style conversion on any ordinary face background image, a maximum of 10,000 style-converted images can be obtained.
[0070] In step S03, the facial key points of the image after style conversion are first located, and then synthesized with the foreground image of the miner's helmet, so that the size and angle of the miner's helmet can be adjusted according to the person's face shape, which can make the synthesized image more reasonable and help improve the accuracy of the coal miner face recognition model.
[0071] In step S04, since the light intensity and angle in a real coal mine scene are much more complicated than those in common natural scenes, in order to make the coal mine dust style match the lighting conditions of the background, the lighting conditions of the synthetic image are adjusted by simulating the real coal mine scene. This can improve the adaptability of the coal miner face recognition model and reduce the difficulty of data acquisition, so that the coal miner face recognition model can achieve high accuracy in the task of coal miner face recognition.
[0072] In step S05, what is different from the conventional situation is that when training the coal miner face recognition model, several initial miner face background images, several ordinary face background images, and style-converted images are also added. For example, the coal miner face recognition model adopts the ResNet-50 residual network structure, which can retain the generalization ability of the coal miner face recognition model.
[0073] Compared with the prior art, the coal miner face recognition method provided by the present application extracts and migrates the coal mine dust style of the real miner face background image based on the characteristics of the real coal mine scene, synthesizes the miner's helmet after locating the key points of face detection, simulates the real coal mine scene to adjust the lighting conditions of the synthesized image, and makes the coal mine dust style match the lighting conditions of the background, thereby improving the adaptability of the coal miner face recognition model, reducing the difficulty of data acquisition, and improving the accuracy of the coal miner face recognition model in coal miner face recognition, while retaining the generalization ability of the coal miner face recognition model.
[0074] In another embodiment of the present application, please refer to Figure 4In step S01, the method for extracting the coal mine dust style in any miner's face background image comprises the following steps:
[0075] Input any miner face background image;
[0076] Multiple convolutional layers conv for extracting features extract makeup;
[0077] Perform a nonlinear mapping on the latent code and map it to a decoupling space;
[0078] Divide it into three components: mouth, eyes, and skin, and map these three components separately.
[0079] It is understandable that in order to decouple the various styles (variables) of makeup, the same approach as Style GAN is adopted here, which is divided into three components: mouth, eyes, and skin. Mouth, eyes, and skin are not only the three key features of the human face, but also the unique features of miners in the coal mine environment. They play an important role in improving the recognition rate of the coal miner face recognition model.
[0080] For further information, please also refer to Figure 5 The method for extracting the coal mine dust style from any miner's face background image comprises the following steps:
[0081] Input any miner face background image;
[0082] Face ID information is extracted by multiple convolutional layers conv for extracting features and multiple resblocks.
[0083] It can be understood that resblock is composed of a convolutional layer conv and a residual layer res. The miner's face background image first passes through multiple convolutional layers conv for extracting features, and then passes through resblock to extract the face ID information. The extracted face ID information can be fused with the makeup style information and migrated to the ordinary face background image. Compared with traditional algorithms, it can transfer more details and more complete styles.
[0084] In another embodiment of the present application, please refer to Figure 3 In step S03, the method of first locating facial key points on the image after style conversion includes the following steps:
[0085] Detect the face in the image after style conversion, obtain the face position (x, y) and the width w and height h of the face;
[0086] The face area of the image is expanded and cropped according to the face position (x, y) and the width w and height h of the face. The width W and height H of the face expansion area are calculated by the following formula:
[0087] W = 1.2 × w, H = 1.15 × h;
[0088] The key point detection is performed on the expanded face area obtained after expansion and cropping, and the coordinates of 108 key points of the face {[x1, y1], [x2, y2], ..., [x 108 ,y 108 ]}; Calculate the coordinates of the highest point of the eyebrow position [x n ,y n ], where y n As the lowest point of the miner's helmet occluded in the face expansion area in the synthesis of the face wearing the miner's helmet;
[0089] The actual face width w is calculated based on the coordinate distribution of 108 key points face ,Right now:
[0090] w face =|max({x1,x2,...,x 108})-min({x1,x2,...,x 108})|.
[0091] It can be understood that, for example, the ScrFD network model detects the face in the background image to obtain the face position (x, y) and the width w and height h of the face; uses the face key point model to detect the key points of the face area map obtained after cropping, and obtains the coordinates of 108 key points of the face; calculates the coordinates of the highest point of the eyebrow position to prevent the helmet from blocking the face.
[0092] Further, in step S03, the method for synthesizing the foreground image with the miner's helmet comprises the following steps:
[0093] Choose any miner helmet foreground image and the corresponding mask image;
[0094] According to w face Calculate the width w of the miner's helmet foreground image helmet , where: w helmet =1.28×w face ; Calculate the height h of the miner's helmet foreground image by proportionality helmet ,Right now: Among them, H ori_helmet is the original height of the miner helmet foreground image, W ori_helmet is the original width of the miner’s helmet foreground image;
[0095] According to the calculation, whelmet and h helmet The miner's helmet foreground image and the corresponding mask image are scaled in equal proportion to obtain a miner's helmet foreground image that matches the size of a human face wearing a helmet.
[0096] Perform edge erosion and Gaussian blur processing on the scaled mask image;
[0097] The processed mask image, the miner's helmet foreground image and the image after the facial key points are located are pasted and synthesized.
[0098] It is understandable that through face Calculate w separately he lmet, and then calculate the height h of the foreground image of the miner's helmet according to the equal proportion helmet , instead of through w face Calculate w separately helmet and h helmet , we can obtain a foreground image that matches the size of the face wearing a miner's helmet, avoid the sense of disobedience, and accurately synthesize it, while ensuring that the miner's helmet itself does not deform and maintains its original shape. The scaled mask image is processed with edge corrosion and Gaussian blur to ensure that the edge area of the helmet is smooth after synthesis, so that the edge of the foreground and background synthesis is not abrupt.
[0099] Furthermore, in step S03, after pasting and synthesizing the processed mask image, the miner's helmet foreground image and the image after the facial key points are located, the method further includes the following steps:
[0100] The processed mask image and the area of the miner's helmet foreground image that exceeds the image after the facial key points are located are cut off.
[0101] In another embodiment of the present application, in step S04, the method for simulating a real coal mine scene to adjust the lighting conditions of the synthetic image includes the following steps:
[0102] Detect the average brightness L of the left half of the face in the composite image l1 and the average brightness L of the right half of the face r1 ;
[0103] Detect the average brightness L of the left half of the miner's helmet in the synthetic image l2 and the average brightness L of the right half of the miner's helmet r2 ;
[0104] Adjust the average brightness of the left half of the face and the left half of the miner's helmet in the composite image to Adjust the average brightness of the right half of the face and the right half of the miner's helmet in the composite image to
[0105] It is understandable that in real coal mine scenes, the ambient light is usually uneven, mostly emitted by a single light source. The brightness of the side of the head facing the light is higher than the brightness of the side facing away from the light, and the brightness on the same side is relatively uniform. However, in the composite image, the face and the miner's helmet in the composite image are obtained by taking pictures under different conditions and then synthesizing them. To avoid the problem of uneven brightness, the average brightness of the left half of the face and the left half of the miner's helmet in the composite image is adjusted to Adjust the average brightness of the right half of the face and the right half of the miner's helmet in the composite image to The illumination features in the initial image are retained, and the characteristics of the light difference on both sides of the miner's head are inherited, so that the average brightness of the face and the miner's helmet on the same side is the same. When adjusting the brightness of the face and the miner's helmet on the same side, the average value is taken, that is, the brightness is lowered for high brightness and increased for low brightness, so as to achieve the purpose of uniform brightness, thereby avoiding overexposure or frame loss caused by excessive brightness adjustment of a single object, and retaining the original features as much as possible.
[0106] Furthermore, in step S04, the method for simulating a real coal mine scene to adjust the lighting conditions of the synthetic image further includes the following steps:
[0107] Extract multiple composite images in proportion;
[0108] Select the center point on the miner's helmet in the composite image;
[0109] Dividing the composite image into a plurality of stepped regions according to the distance from the center point;
[0110] The brightness of the synthesized image is globally increased, wherein the brightness of the step area closer to the center point is increased more.
[0111] It is understandable that, based on the real coal mine scene, some miners have mining lamps installed on their helmets. When the mining lamps are turned on, the face will be exposed, which is difficult for conventional face recognition models to identify. Therefore, by selecting the center point on the miner's helmet in the synthetic image to simulate the position of the mining lamp, the brightness of the synthetic image is increased globally, and the closer the stepped area is to the center point, the greater the brightness is increased, which is used to simulate the scene where the face is exposed when the mining lamp is turned on. In this way, it is possible to obtain scene training data for scenes where the face is exposed when the mining lamps are turned on in batches. When it is used to train the coal miner face recognition model, it can improve the ability of the coal miner face recognition model to recognize faces in overexposed scenes.
[0112] Further, in step S04, the method of selecting the center point on the miner's helmet in the composite image comprises the following steps:
[0113] Select a rectangular frame for the miner's helmet in the composite image;
[0114] Get the vertex coordinates of the rectangular box;
[0115] Find the center point of the rectangular box.
[0116] It is understandable that, based on the real coal mine scene, the mining lamp is located at the center of the mining helmet. Thus, by selecting a rectangular frame for the miner's helmet in the synthetic image and taking the average value of any pair of relative vertex coordinates of the rectangular frame, the coordinates of the center point can be obtained.
[0117] Furthermore, in step S04, the method for simulating a real coal mine scene to adjust the lighting conditions of the synthetic image further includes the following steps:
[0118] Extract multiple composite images in proportion;
[0119] A boundary line is randomly generated in the synthetic image, and the boundary line passes through any area of the face or the miner's helmet;
[0120] The area on one side of the boundary line in the composite image is randomly selected to reduce or increase the brightness.
[0121] It is understandable that, in real coal mine scenes, the ambient light is usually uneven, mostly emitted by a single light source. The mine is composed of vertical tunnels, horizontal tunnels, inclined tunnels, chambers, etc., which are interconnected. The light emitted by the light source is partially blocked by equipment, stone walls, etc. during the propagation process. The brightness of the part where the light source directly shines on the face is high, and the brightness of the part where there is no light source directly shining on the face is low. There is an obvious boundary between the two areas with high brightness and low brightness. In this way, by extracting multiple synthetic images in proportion, a straight line of intersection is randomly generated in the synthetic image, and the straight line of intersection is used to simulate the above-mentioned boundary line; by randomly selecting the area on one side of the straight line of intersection in the synthetic image to reduce or increase the brightness, a clear light brightness difference is formed on both sides of the straight line of intersection, simulating the scene where the light of the face is partially blocked. In this way, batch training data simulating the scene where the light of the face is partially blocked can be obtained. When it is used to train the face recognition model of coal miners, the ability of the face recognition model of coal miners to recognize faces in complex lighting scenes can be improved.
[0122] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A method for face recognition of coal miners, characterized in that: The following steps are involved: Collect a number of miner face background images, a number of ordinary human face background images, and a number of miner helmet foreground images; Extracting the coal mine dust style from any miner's face background image, and performing style conversion on any ordinary human face background image based on the coal mine dust style; The facial key points of the style-converted image are first located, and then synthesized with the foreground image of the miner's helmet; Simulate real coal mine scenes to adjust the lighting conditions of the synthetic images; The adjusted synthetic image is used together with the initial miner face background image, ordinary face background image, and style-transferred image to train the coal miner face recognition model.
2. The method for face recognition of coal miners according to claim 1, characterized in that: The method for extracting the coal mine dust style from any miner's face background image comprises the following steps: Input any miner face background image; Multiple convolutional layers conv for extracting features extract makeup; Perform a nonlinear mapping on the latent code and map it to a decoupling space; Divide it into three components: mouth, eyes, and skin, and map these three components separately.
3. The method for face recognition of coal miners as claimed in claim 2, characterized in that: The method for extracting the coal mine dust style from any miner's face background image comprises the following steps: Input any miner face background image; Face ID information is extracted by multiple convolutional layers conv for extracting features and multiple resblocks.
4. The method for face recognition of coal miners according to claim 1, characterized in that: The method of first locating facial key points on the image after style conversion includes the following steps: Detect faces in the style-converted image and obtain the face position (x, y) as well as the width w and height h of the face; The face area of the image is expanded and cropped according to the face position (x, y) and the width w and height h of the face. The width W and height H of the face expansion area are calculated by the following formula: ; Perform key point detection on the expanded face area obtained after expansion and cropping to obtain the coordinates of 108 key points of the face ; Calculate the coordinates of the highest point of the eyebrow ,in As the lowest point of the miner's helmet occluded in the face expansion area in the synthesis of the face wearing the miner's helmet; The actual width of the face is calculated based on the coordinate distribution of 108 key points ,Right now: 。 5. The method for face recognition of coal miners as claimed in claim 4, characterized in that: The method for synthesizing the foreground image with the miner's helmet comprises the following steps: Choose any miner helmet foreground image and the corresponding mask image; according to Calculate the width of the foreground image of the miner's helmet ,in: ; Calculate the height of the miner's helmet foreground image by proportionality ,Right now: ,in, is the original height of the miner's helmet foreground image, is the original width of the miner’s helmet foreground image; According to the calculation and The miner's helmet foreground image and the corresponding mask image are scaled in equal proportion to obtain a miner's helmet foreground image that matches the size of a human face wearing a helmet. Perform edge erosion and Gaussian blur processing on the scaled mask image; The processed mask image, the miner's helmet foreground image and the image after the facial key points are located are pasted and synthesized.
6. The method for face recognition of coal miners as claimed in claim 5, characterized in that: After pasting and synthesizing the processed mask image, the miner's helmet foreground image and the image after the facial key points are located, the method further includes the following steps: The processed mask image and the area of the miner's helmet foreground image that exceeds the image after the facial key points are located are cut off.
7. The method for face recognition of coal miners according to claim 1, characterized in that: The method for simulating a real coal mine scene to adjust the lighting conditions of a synthetic image comprises the following steps: Detect the average brightness L of the left half of the face in the composite image l1 and the average brightness L of the right half of the face r1 ; Detect the average brightness L of the left half of the miner's helmet in the synthetic image l2 and the average brightness L of the right half of the miner's helmet r2 ; Adjust the average brightness of the left half of the face and the left half of the miner's helmet in the composite image to , respectively adjust the average brightness of the right half of the face and the right half of the miner's helmet in the composite image to .
8. The method for face recognition of coal miners according to any one of claims 1 to 7, characterized in that: The method for simulating a real coal mine scene to adjust the lighting conditions of the synthetic image also includes the following steps: Extract multiple composite images in proportion; Select the center point on the miner's helmet in the composite image; Dividing the composite image into a plurality of stepped regions according to the distance from the center point; The brightness of the synthesized image is globally increased, wherein the brightness of the step area closer to the center point is increased more.
9. The method for face recognition of coal miners as claimed in claim 8, characterized in that: The method for selecting the center point on the miner's helmet in the composite image comprises the following steps: Select a rectangular frame for the miner's helmet in the composite image; Get the vertex coordinates of the rectangular box; Find the center point of the rectangular box.
10. The method for face recognition of coal miners according to any one of claims 1 to 7, characterized in that: The method for simulating a real coal mine scene to adjust the lighting conditions of the synthetic image also includes the following steps: Extract multiple composite images in proportion; A boundary line is randomly generated in the synthetic image, and the boundary line passes through any area of the face or the miner's helmet; The area on one side of the boundary line in the composite image is randomly selected to reduce or increase the brightness.
