WO2022252737A1 - Image processing method and apparatus, processor, electronic device, and storage medium - Google Patents
Image processing method and apparatus, processor, electronic device, and storage medium Download PDFInfo
- Publication number
- WO2022252737A1 WO2022252737A1 PCT/CN2022/080403 CN2022080403W WO2022252737A1 WO 2022252737 A1 WO2022252737 A1 WO 2022252737A1 CN 2022080403 W CN2022080403 W CN 2022080403W WO 2022252737 A1 WO2022252737 A1 WO 2022252737A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- area
- threshold
- image
- pixel
- processed
- Prior art date
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 15
- 238000001514 detection method Methods 0.000 claims abstract description 142
- 238000000034 method Methods 0.000 claims abstract description 62
- 238000012545 processing Methods 0.000 claims description 136
- 210000004709 eyebrow Anatomy 0.000 claims description 134
- 210000001061 forehead Anatomy 0.000 claims description 101
- 210000000744 eyelid Anatomy 0.000 claims description 30
- 230000015654 memory Effects 0.000 claims description 20
- 238000004590 computer program Methods 0.000 claims description 18
- 230000036760 body temperature Effects 0.000 claims description 13
- 238000013527 convolutional neural network Methods 0.000 description 21
- 238000009529 body temperature measurement Methods 0.000 description 19
- 238000012549 training Methods 0.000 description 15
- 238000013528 artificial neural network Methods 0.000 description 13
- 238000004422 calculation algorithm Methods 0.000 description 11
- 238000000605 extraction Methods 0.000 description 10
- 230000006870 function Effects 0.000 description 10
- 238000010586 diagram Methods 0.000 description 7
- 238000001931 thermography Methods 0.000 description 6
- 230000008878 coupling Effects 0.000 description 4
- 238000010168 coupling process Methods 0.000 description 4
- 238000005859 coupling reaction Methods 0.000 description 4
- 230000005540 biological transmission Effects 0.000 description 3
- 239000000284 extract Substances 0.000 description 3
- 238000013473 artificial intelligence Methods 0.000 description 2
- 230000000903 blocking effect Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 238000013461 design Methods 0.000 description 2
- 238000002372 labelling Methods 0.000 description 2
- 238000013507 mapping Methods 0.000 description 2
- 238000005259 measurement Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000005855 radiation Effects 0.000 description 2
- 239000007787 solid Substances 0.000 description 2
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000007635 classification algorithm Methods 0.000 description 1
- 238000012937 correction Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 210000000887 face Anatomy 0.000 description 1
- 230000001815 facial effect Effects 0.000 description 1
- 238000007477 logistic regression Methods 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 239000011159 matrix material Substances 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 238000003062 neural network model Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000012216 screening Methods 0.000 description 1
- 230000011218 segmentation Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/187—Segmentation; Edge detection involving region growing; involving region merging; involving connected component labelling
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/90—Determination of colour characteristics
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30196—Human being; Person
- G06T2207/30201—Face
Definitions
- the present application relates to the technical field of image processing, and in particular to an image processing method and device, a processor, electronic equipment, and a storage medium.
- non-contact detection of skin is applied in more and more scenarios.
- the detection accuracy of this type of non-contact detection is largely affected by the state of skin occlusion. For example, if the covered area of the skin area is relatively large, the accuracy of the detection result of the non-contact detection on the skin area may be low. Therefore, how to detect the state of skin occlusion is of great significance.
- the present application provides an image processing method and device, a processor, electronic equipment and a storage medium to determine whether the skin is in a blocking state.
- the present application provides an image processing method, the method comprising: acquiring an image to be processed, a first threshold, a second threshold, and a third threshold, the first threshold is different from the second threshold, and the first threshold Different from the third threshold, the second threshold is less than or equal to the third threshold; determine the first number of first pixels in the region to be detected of the image to be processed; the first pixel is a color value Pixels greater than or equal to the second threshold and less than or equal to the third threshold; according to the first ratio of the first number to the number of pixels in the region to be tested and the first threshold, the obtained Describe the skin occlusion detection results of the image to be processed.
- the determining the first number of first pixels in the skin area of the image to be processed includes: performing face detection processing on the image to be processed to obtain a first face frame; Determining the region to be detected from the image to be processed according to the first face frame; determining a first number of the first pixels in the region to be detected.
- the first face frame includes an upper frame line and a lower frame line; both the upper frame line and the lower frame line are in the first face frame parallel to the Process the side of the horizontal axis of the pixel coordinate system of the image, and the ordinate of the upper frame line is smaller than the ordinate of the lower frame line; according to the first face frame, determine from the image to be processed
- the area to be tested includes: performing human face key point detection on the image to be processed to obtain at least one human face key point; the at least one human face key point includes a left eyebrow key point and a right eyebrow key point;
- the lower frame line is moved along the negative direction of the vertical axis of the pixel coordinate system of the image to be processed, so that the line where the lower frame line is located is the same as the first straight line.
- the lines overlap to obtain the second human face frame; the first straight line is a straight line passing through the left eyebrow key point and the right eyebrow key point; according to the area included in the second human
- the obtaining the area to be tested according to the area contained in the second face frame includes: keeping the ordinate of the lower frame line of the second face frame unchanged case, move the upper frame line of the second face frame along the vertical axis of the pixel coordinate system of the image to be processed, so that the upper frame line of the second face frame and the second face frame
- the distance between the lower frame lines is a preset distance to obtain a third human face frame; according to the area included in the third human face frame, the region to be tested is obtained.
- the at least one human face key point also includes a left mouth corner key point and a right mouth corner key point
- the first human face frame also includes a left frame line and a right frame line
- the left frame line and the right frame line are sides parallel to the vertical axis of the pixel coordinate system of the image to be processed in the first face frame, and the abscissa of the left frame line is smaller than the abscissa of the right frame line Coordinates
- said obtaining the region to be tested according to the region included in the third human face frame includes: keeping the abscissa of the left frame line of the third human face frame unchanged, The right frame line of the third human face frame moves along the horizontal axis of the pixel coordinate system of the image to be processed, so that between the right frame line of the third human face frame and the left frame line of the third human face frame
- the distance is the reference distance to obtain the fourth human face frame; the reference distance is the distance between the two intersection points of the second straight line and the human face contour contained
- the acquiring the second threshold and the third threshold includes: determining the skin pixel area from the pixel area contained in the first human face frame; acquiring the second skin pixel area in the skin pixel area The color value of two pixels; the difference between the color value of the second pixel and the first value is used as the second threshold, and the sum of the color value of the second pixel and the second value is used as the first threshold Three thresholds; wherein, neither the first value nor the second value exceeds the maximum value among the color values of the image to be processed.
- the determining the skin pixel point area from the pixel point area contained in the first human face frame includes: when it is detected that the face area in the image to be processed is not wearing a mask , using the pixel point area in the face area except the forehead area, mouth area, eyebrow area and eye area as the skin pixel point area; Under normal circumstances, the pixel point area between the first straight line and the fourth straight line is used as the skin pixel point area; the fourth straight line is a straight line passing through the key point of the lower eyelid of the left eye and the key point of the lower eyelid of the right eye; Both the key points of the lower eyelid of the left eye and the key points of the lower eyelid of the right eye belong to the at least one human face key point.
- the acquiring the color value of the second pixel in the skin pixel area includes: including at least one first key belonging to the inner left eyebrow area in the at least one human face key point point, and the at least one face key point contains at least one second key point belonging to the inner area of the right eyebrow, determine the rectangular area according to the at least one first key point and the at least one second key point ; Perform grayscale processing on the rectangular area to obtain a grayscale image of the rectangular area; use the color value of the intersection point of the first row and the first column as the color value of the second pixel point; the first The line is the row with the largest sum of grayscale values in the grayscale image, and the first column is the column with the largest sum of grayscale values in the grayscale image.
- the skin occlusion detection result of the image to be processed is obtained according to the first ratio of the first number to the number of pixels in the region to be detected and the first threshold
- the method includes: when the first ratio does not exceed the first threshold, determining that the skin occlusion detection result indicates that the skin area corresponding to the region to be detected is in an occlusion state; when the first ratio exceeds the first threshold, In the case of a threshold value, it is determined that the skin occlusion detection result indicates that the skin area corresponding to the area to be detected is in an unoccluded state.
- the skin area belongs to the person to be detected, and the method further includes: acquiring a temperature thermodynamic map of the image to be processed; In the case of , the temperature of the skin area is read from the temperature thermodynamic map as the body temperature of the person to be detected.
- the present application also provides an image processing device, which includes: an acquisition unit, configured to acquire an image to be processed, a first threshold, a second threshold, and a third threshold, the first threshold Different from the second threshold, the first threshold is different from the third threshold, the second threshold is less than or equal to the third threshold; a first processing unit, configured to determine the image to be processed The first quantity of the first pixel in the area; the first pixel is a pixel whose color value is greater than or equal to the second threshold and less than or equal to the third threshold; the detection unit is configured to use the first quantity
- the skin occlusion detection result of the image to be processed is obtained by the first ratio with the number of pixels in the region to be detected and the first threshold.
- the area to be tested includes a human face area
- the skin occlusion detection result includes a human face occlusion detection result
- the image processing device further includes: a second processing unit, configured to determine Before the first number of first pixels in the area to be detected of the image to be processed, perform face detection processing on the image to be processed to obtain a first face frame; according to the first face frame, from the Determine the face area in the image to be processed.
- the face area includes a forehead area
- the face occlusion detection result includes a forehead occlusion detection result
- the first face frame includes: an upper frame line and a lower frame line; Both the frame line and the lower frame line are sides parallel to the horizontal axis of the pixel coordinate system of the image to be processed in the first face frame, and the ordinate of the upper frame line is smaller than the lower frame line The ordinate;
- the second processing unit is used to: perform face key point detection on the image to be processed to obtain at least one face key point;
- the at least one face key point includes a left eyebrow key point and a right eyebrow Key point: under the condition of keeping the ordinate of the upper frame line unchanged, move the lower frame line along the negative direction of the vertical axis of the pixel coordinate system of the image to be processed, so that the lower frame line is located
- the straight line coincides with the first straight line to obtain a second human face frame;
- the first straight line is a straight line passing through the left eyebrow key point and the right eyebrow key point;
- the second processing unit is configured to: keep the ordinate of the lower frame line of the second face frame unchanged, and convert the upper frame of the second face frame to The line moves along the vertical axis of the pixel coordinate system of the image to be processed, so that the distance between the upper frame line of the second human face frame and the lower frame line of the second human face frame is a preset distance, and the third A face frame: obtain the forehead area according to the area included in the third face frame.
- the at least one human face key point also includes a left mouth corner key point and a right mouth corner key point
- the first human face frame further includes: a left frame line and a right frame line
- the left frame line and the right frame line are both sides parallel to the vertical axis of the pixel coordinate system of the image to be processed in the first face frame, and the abscissa of the left frame line is smaller than that of the right frame line abscissa
- the second processing unit is configured to: keep the abscissa of the left frame line of the third face frame unchanged, and place the right frame line of the third face frame along the Process the horizontal axis of the pixel coordinate system of the image to move, so that the distance between the right frame line of the third human face frame and the left frame line of the third human face frame is a reference distance, and obtain the fourth human face frame
- the reference distance is the distance between the second straight line and the two intersection points of the human face contour contained in the third human face frame
- the second straight line is
- the image device further includes: a determining unit, configured to, before determining the first number of first pixels in the region to be detected of the image to be processed, from the first person Determining the skin pixel point area in the pixel point area included in the face frame; the acquisition unit is also used to acquire the color value of the second pixel point in the skin pixel point area; the first processing unit is also used to convert the The difference between the color value of the second pixel point and the first value is used as the second threshold, and the sum of the color value of the second pixel point and the second value is used as the third threshold; the first value and None of the second values exceeds the maximum value among the color values of the image to be processed.
- a determining unit configured to, before determining the first number of first pixels in the region to be detected of the image to be processed, from the first person Determining the skin pixel point area in the pixel point area included in the face frame
- the acquisition unit is also used to acquire the color value of the second pixel point in the skin pixel point area
- the image processing device further includes: a third processing unit, configured to, before determining the skin pixel area from the pixel area included in the first human face frame, process the The image to be processed is subjected to mask wearing detection processing to obtain the detection result; the determination unit is used to: when it is detected that the face area in the image to be processed is not wearing a mask, remove the forehead from the face area area, mouth area, eyebrow area and pixel area outside the eye area, as the skin pixel area; when it is detected that the face area in the image to be processed is wearing a mask, the first straight line The pixel point area between and the fourth straight line is used as the skin pixel point area.
- a third processing unit configured to, before determining the skin pixel area from the pixel area included in the first human face frame, process the The image to be processed is subjected to mask wearing detection processing to obtain the detection result; the determination unit is used to: when it is detected that the face area in the image to be processed is not wearing a mask, remove the forehead from the face area area, mouth area
- the fourth straight line is a straight line passing through the key points of the lower eyelid of the left eye and the key point of the lower eyelid of the right eye; both the key points of the lower eyelid of the left eye and the key points of the lower eyelid of the right eye belong to the at least one human face key point.
- the acquisition unit is configured to: include at least one first key point belonging to the inner area of the left eyebrow in the at least one key point of the human face, and include at least one key point belonging to the inner area of the right eyebrow
- a rectangular area is determined according to the at least one first key point and the at least one second key point
- grayscale processing is performed on the rectangular area to obtain a grayscale image of the rectangular area
- the color value of the intersection point of the first row and the first column in the grayscale image of the rectangular area is used as the color value of the second pixel point
- the first row is the row with the largest sum of grayscale values in the grayscale image
- the first column is the column with the largest sum of gray values in the gray scale image.
- the detection unit is configured to: if the first ratio does not exceed the first threshold, determine that the skin occlusion detection result indicates that the skin region corresponding to the region to be detected is in the Blocking state: when the first ratio exceeds the first threshold, determine that the skin blockage detection result is that the skin area corresponding to the region to be detected is in an unblocked state.
- the skin area belongs to a person to be detected
- the acquiring unit is further configured to: acquire a temperature thermodynamic map of the image to be processed
- the image processing device further includes: a fourth processing unit configured to If the skin occlusion detection result shows that the skin area is in an unoccluded state, read the temperature of the skin area from the temperature thermodynamic map as the body temperature of the person to be detected.
- the present application also provides a processor, configured to execute the method in the above first aspect and any possible implementation manner thereof.
- the present application also provides an electronic device, including: a processor, a sending device, an input device, an output device, and a memory, the memory is used to store computer program codes, the computer program codes include computer instructions, and the processor In the case of executing the computer instructions, the electronic device executes the method in the above first aspect and any possible implementation manner thereof.
- the present application also provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, the computer program includes program instructions, and when the program instructions are executed by a processor, the The processor executes the method in the above first aspect and any possible implementation manner thereof.
- the present application also provides a computer program product, the computer program product includes a computer program or an instruction, and when the computer program or instruction is run on a computer, it causes the computer to perform the above-mentioned first aspect and any one thereof.
- a possible method of implementation includes a computer program or an instruction, and when the computer program or instruction is run on a computer, it causes the computer to perform the above-mentioned first aspect and any one thereof.
- FIG. 1 is a schematic diagram of a pixel coordinate system provided by an embodiment of the present application.
- FIG. 2 is a schematic flow chart of an image processing method provided in an embodiment of the present application.
- FIG. 3 is a schematic flow diagram of another image processing method provided in the embodiment of the present application.
- Fig. 4 is a schematic diagram of key points of a human face provided by the embodiment of the present application.
- FIG. 5 is a schematic structural diagram of an image processing device provided in an embodiment of the present application.
- FIG. 6 is a schematic diagram of a hardware structure of an image processing device provided by an embodiment of the present application.
- the pixel coordinate system xoy is constructed with the upper left corner of the image as the origin o of the pixel coordinate system, the direction parallel to the row of the image as the direction of the x-axis, and the direction parallel to the column of the image as the direction of the y-axis .
- the abscissa is used to indicate the number of columns of the pixels in the image
- the ordinate is used to indicate the number of rows of the pixels in the image.
- the units of both the abscissa and the ordinate can be pixels.
- non-contact detection of skin is applied in more and more scenarios.
- the detection accuracy of this type of non-contact detection is largely affected by the state of skin occlusion. For example, if the covered area of the skin area is relatively large, the accuracy of the detection result of the non-contact detection on the skin area may be low. Therefore, how to detect the state of skin occlusion is of great significance.
- non-contact temperature measurement is widely used in the field of body temperature detection.
- the non-contact temperature measurement tool has the advantages of fast measurement speed and over-temperature voice alarm. It is suitable for rapid screening of human body temperature in public places with a particularly large flow of people.
- Thermal imaging equipment mainly detects the thermal radiation emitted by objects by collecting light in the thermal infrared band, and finally establishes an accurate correspondence between thermal radiation and temperature to realize the temperature measurement function.
- thermal imaging equipment can cover a large area. It can increase the speed of traffic and reduce the gathering time of groups in detection scenarios with a large flow of people.
- the thermal imaging device mainly recognizes the position of the forehead of the pedestrian, and then measures the body temperature according to the forehead area. However, in the case of pedestrians wearing hats or bangs, it is impossible to determine whether the forehead area is blocked. At this time, whether or not the covering state of the forehead can be determined has a great influence on the accuracy of body temperature detection.
- an embodiment of the present application provides an image processing method to realize skin occlusion detection of, for example, an object to be measured.
- the object to be measured can be a human face, or specifically the forehead area of a human face, or more specifically a specific position in the forehead area.
- the area corresponding to the object to be measured in the image to be processed is referred to as the area to be measured.
- the temperature-measuring object is usually a skin area corresponding to the to-be-measured area in the image to be processed, and the skin occlusion detection result of the temperature-measuring object includes whether the corresponding skin area is occluded.
- the execution subject of the embodiment of the present application is an image processing device, and the image processing device may be one of the following: a mobile phone, a computer, a server, and a tablet computer.
- FIG. 2 is a schematic flowchart of an image processing method provided in an embodiment of the present application.
- 201 Acquire an image to be processed, a first threshold, a second threshold, and a third threshold, the first threshold is different from the second threshold, the first threshold is different from the third threshold, and the second threshold is less than or equal to the third threshold threshold.
- the image to be processed includes an image block containing a human face and an image block not containing a human face.
- the first threshold is a standard ratio between the number of skin pixels in the forehead area and the number of pixels in the forehead area preset according to specific implementation conditions, and is a criterion for evaluating whether the forehead area is blocked.
- the first threshold in this embodiment of the present application is related to the accuracy of temperature detection or other embodiments. For example, assuming that the temperature measurement operation is performed on the forehead area of pedestrians, the more exposed skin areas in the forehead area, the more accurate the temperature measurement result will be. In the case that the exposed skin area of the forehead area accounts for more than 60%, the result of the temperature measurement is considered to be accurate. If such accuracy is required in the temperature detection scenario, then the first threshold can be set to 60%. If higher accuracy is required in the temperature detection scenario, the first threshold can be set above 60%. If it is considered that the requirement of setting the first threshold to 60% is too high and an over-accurate result is actually not needed, then the first threshold can be set below 60%. In this case, the accuracy of the corresponding temperature measurement results will be reduced. Therefore, the setting of the first threshold needs to be performed in specific implementation, which is not limited in this embodiment of the present application.
- the image processing apparatus receives an image to be processed input by a user through an input component.
- the above-mentioned input components include: a keyboard, a mouse, a touch screen, a touch panel, an audio and video input device, and the like.
- the image processing device receives the image to be processed sent by the data terminal.
- the above-mentioned data terminal may be any of the following: mobile phone, computer, tablet computer, server, etc.
- the image processing device receives the image to be processed sent by the surveillance camera.
- the monitoring camera may be deployed on non-contact temperature measurement products such as artificial intelligence (AI) infrared imagers and security gates (such products are mainly placed in stations, airports, subways, shops, supermarkets, Scenes with dense traffic such as schools, company halls, and community gates).
- AI artificial intelligence
- the image processing device receives the video stream sent by the surveillance camera, decodes the video stream, and uses the obtained image as the image to be processed.
- the surveillance camera may be deployed on non-contact temperature measurement products such as AI infrared imagers and security gates (such products are mainly placed at stations, airports, subways, shops, supermarkets, schools, company halls and community gates) These crowded scenes).
- the image processing device is connected to the cameras, and the image processing device can obtain real-time collected data frames from each camera, and the data frames may include images and/or videos.
- the number of cameras connected to the image processing device is not fixed, and the collected data frames can be obtained from the cameras by inputting the network addresses of the cameras into the image processing device.
- a person in place A wants to use the technical solution provided by this application, he only needs to input the network address of the camera in place A into the image processing device, and the data frame collected by the camera in place A can be obtained by the image processing device , and subsequent processing can be performed on the data frames collected by the camera at A, and the image processing device outputs the detection result of whether the forehead is blocked.
- the color value is a parameter of the hexagonal pyramid model ((hue, saturation, value, HSV).
- the three parameters of the color value in this model are: hue (hue, H), saturation (saturation, S ), brightness (value, V). That is to say, the color value carries three kinds of information of chroma, saturation and brightness. Because this application involves skin detection, it is necessary to detect the number of skin pixels in the area to be tested, that is, the first The first number of pixels in a pixel.
- the image processing device regards pixels whose color values are greater than or equal to the second threshold and less than or equal to the third threshold as skin pixels. That is, in the embodiment of the present application, the second threshold and the third threshold are used to determine whether the pixel is a skin pixel.
- the pixel can be considered as a skin pixel corresponding to an unoccluded skin area. For example, suppose the H of the second threshold is 26, the S is 43, and the V is 46; the H of the third threshold is 34, the S is 255, and the V is 255. Then, the color value range of the skin pixel is 26 to 34 for H, 43 to 255 for S, and 46 to 255 for V.
- the image processing device determines the first pixel points in the region to be detected, it further determines the number of the first pixel points to obtain the first number.
- the skin occlusion detection result includes that the skin area is in an occluded state or that the skin area is in an unoccluded state.
- the first ratio between the first number and the number of pixels in the area to be tested represents the proportion of unoccluded skin pixels in the area to be tested (hereinafter referred to as proportion) . If the first ratio indicates that the proportion is small, it means that the skin area corresponding to the area to be tested is blocked; on the contrary, if the first ratio indicates that the proportion is large, it means that the skin area corresponding to the area to be tested is not blocked.
- the image processing device uses the first threshold as the basis for judging the proportion, and then can determine whether the skin area is blocked according to the proportion, so as to obtain the skin occlusion detection result.
- the proportion does not exceed the first threshold, it means that the proportion is small, and then it is determined that the skin area is in a blocked state. If the proportion exceeds the first threshold, it means that the proportion is relatively large, and then it is determined that the skin area is in an unoccluded state.
- the image processing device determines the number of skin pixels in the region to be detected in the image to be processed according to the first threshold, that is, the first number.
- the first threshold that is, the first number.
- the skin area includes a human face area
- the skin occlusion detection result includes a human face occlusion detection result.
- the image processing device further determines the proportion of skin pixels in the face area after determining the number of skin pixels in the face area in the image to be processed, and then can use the proportion Determine whether the face area is occluded, and obtain the face occlusion detection result. Specifically, when it is determined that the human face area is blocked, it is determined that the human face occlusion detection result is the state that the human face area is blocked; when it is determined that the human face area is not blocked, it is determined that the human face occlusion detection result is the human face Not in a blocked state.
- the image processing device before determining the first number of first pixels in the region to be detected of the image to be processed, the image processing device further performs the following steps:
- the face detection process is used to identify whether the image to be processed contains a human object.
- Face detection processing is performed on the image to be processed to obtain the coordinates of the first face frame (as shown in D in FIG. 1 ).
- the coordinates of the first face frame may be upper left corner coordinates, lower left corner coordinates, lower right corner coordinates, and upper right corner coordinates.
- the coordinates of the first face frame may also be a pair of diagonal coordinates, that is, the coordinates of the upper left corner and the lower right corner or the coordinates of the lower left corner and the upper right corner.
- the area contained in the first face frame is the area from the forehead to the chin of the face.
- feature extraction is performed on the image to be processed through a pre-trained neural network to obtain feature data, and the pre-trained neural network identifies whether the image to be processed contains a human face according to the features in the feature data .
- the pre-trained neural network identifies whether the image to be processed contains a human face according to the features in the feature data .
- the convolutional neural network is trained, so that the trained convolutional neural network can complete the face detection processing of the image.
- the annotation information of the images in the training data is the face and the position of the face.
- the convolutional neural network extracts the feature data of the image from the image, and determines whether there is a human face in the image according to the feature data. In the case of a human face in the image, according to The feature data of the image obtains the position of the face.
- Use the labeling information as the supervision information to supervise the results obtained by the convolutional neural network during the training process, and update the parameters of the convolutional neural network to complete the training of the convolutional neural network. In this way, the image to be processed can be processed by using the trained convolutional neural network to obtain the position of the face in the image to be processed.
- the face detection process can be implemented by a face detection algorithm, wherein the face detection algorithm can be at least one of the following: face detection based on histogram rough segmentation and singular value features Algorithm, face detection based on binary wavelet transform, neural network method (pdbnn) based on probability decision-making, hidden markov model method (hidden markov model), etc., this application does not focus on the face detection algorithm for realizing face detection processing Be specific.
- the first human face frame determine the human face area from the image to be processed.
- the image processing apparatus uses the area surrounded by the first human face frame as the human face area.
- the first human face frame includes an upper frame line and a lower frame line.
- the first human face frame includes an upper frame line, a lower frame line, a left frame line and a right frame line; the upper frame line and the lower frame line are all parallel to the pixel coordinate system of the image to be processed in the first human face frame
- the side of the horizontal axis, and the ordinate of the upper frame line is less than the ordinate of the lower frame line; the left frame line and the right frame line are the sides parallel to the vertical axis of the pixel coordinate system of the image to be processed in the first face frame,
- the abscissa of the left frame line is smaller than the abscissa of the right frame line.
- the face area includes the forehead area.
- the image processing device determines the face area from the image to be processed according to the first face frame, that is, determines the forehead area from the image to be processed according to the first face frame. .
- the distance between the upper frame line and the lower frame line is the distance from the upper edge of the forehead to the lower edge of the chin of the face included in the first face frame
- the distance between the left frame line and the right frame line is the distance between the inner side of the left ear and the inner side of the right ear of the face contained in the first face frame.
- the width of the forehead area of a face accounts for about 1/3 of the length of the entire face (that is, the distance between the upper and lower edges of the entire face), but the forehead The ratio of the width of the region to the length of the face varies from person to person.
- the ratio of the width of the forehead area to the length of the entire human face is in the range of 30% to 40% for each person.
- the vertical coordinate of the upper frame line unchanged, move the lower frame line along the negative direction of the vertical axis of the pixel coordinate system of the image to be processed, so that the distance between the moved upper frame line and the lower frame line is the upper frame 30% to 40% of the initial distance between the line and the lower frame line, the area included in the first face frame after the movement is the forehead area.
- the coordinates of the first face frame are a pair of diagonal coordinates
- the coordinates of the upper left corner of the first face frame or the coordinates of the upper right corner of the first face frame determine the position of the forehead area. Therefore, by changing the size and position of the first human face frame, the area within the first human face frame can be made to be the forehead area of the human face in the image to be processed.
- the image processing device determines the forehead area by performing the following steps:
- At least one key point of human face is obtained by performing human face key point detection on the image to be processed, and at least one key point includes a left eyebrow key point and a right eyebrow key point.
- Feature extraction is performed on the image to be processed to obtain feature data, which can realize face key point detection.
- the feature extraction process can be realized by a pre-trained neural network, or by a feature extraction model, which is not limited in this application.
- the feature data is used to extract the key point information of the face in the image to be processed.
- the above image to be processed is a digital image, and the feature data obtained by performing feature extraction on the image to be processed can be understood as deeper semantic information of the image to be processed.
- a face image set for training is established, and positions of key points to be detected are marked.
- Deep neural network Estimate the rotation angle of each local area, correct it according to the estimated rotation angle, and construct a fourth-layer deep neural network for the correction data set of each local area. Given any new face image, the above four-layer deep neural network model is used for key point detection, and the final face key point detection result can be obtained.
- the convolutional neural network is trained by using multiple images with annotation information as training data, so that the trained convolutional neural network can complete the image recognition.
- Face keypoint detection processing The annotation information of the image in the training data is the key point position of the face.
- the convolutional neural network extracts the feature data of the image from the image, and determines the key point position of the face in the image according to the feature data.
- Use the labeling information as the supervision information to supervise the results obtained by the convolutional neural network during the training process, and update the parameters of the convolutional neural network to complete the training of the convolutional neural network.
- the image to be processed can be processed using the trained convolutional neural network to obtain key point positions of faces in the image to be processed.
- At least two convolutional layers are used to perform convolution processing on the image to be processed layer by layer to complete the feature extraction process of the image to be processed.
- the convolutional layers in at least two convolutional layers are connected in sequence, that is, the output of the previous convolutional layer is the input of the next convolutional layer, and the content and semantic information extracted by each convolutional layer are different.
- the performance is that the feature extraction process abstracts the features of the face in the image to be processed step by step, and at the same time gradually discards the relatively minor feature data, wherein the relatively minor feature data refers to the feature data of the detected face other feature data. Therefore, the size of the feature data extracted later is smaller, but the content and semantic information are more concentrated.
- the image to be processed is convoluted step by step through the multi-layer convolution layer, which can reduce the size of the image to be processed while obtaining the content information and semantic information in the image to be processed, and reduce the data processing capacity of the image processing device. Improve the computing speed of the image processing device.
- the implementation process of convolution processing is as follows: by sliding the convolution kernel on the image to be processed, and moving the pixel corresponding to the central pixel of the convolution kernel on the image to be processed called the target pixel. Multiply the pixel value on the image to be processed by the corresponding value on the convolution kernel, and then add all the multiplied values to obtain the pixel value after convolution. The pixel value after convolution processing is used as the pixel value of the target pixel. Finally, the image to be processed is slid and processed, the pixel values of all pixels in the image to be processed are updated, and the convolution processing of the image to be processed is completed to obtain feature data.
- the features in the feature data are identified by a neural network that extracts the feature data, so as to obtain the key point information of the face in the image to be processed.
- the face key point detection algorithm is adopted to realize the face key point detection, and the face key point detection algorithm adopted can be OpenFace, multi-task cascaded convolutional neural network (multi -at least one of task cascaded convolutional networks (MTCNN), adjusted convolutional neural networks (tweaked convolutional neural networks, TCNN), or task-constrained deep convolutional networks (tasks-constrained deep convolutional network, TCDCN), this application is for The face key point detection algorithm is not limited.
- MTCNN multi-at least one of task cascaded convolutional networks
- TCNN adjusted convolutional neural networks
- TCDCN task-constrained deep convolutional network
- the first straight line is a straight line passing through the above-mentioned left eyebrow key point and the above-mentioned right eyebrow key point.
- the distance between the above-mentioned upper frame line and the above-mentioned lower frame line is the distance from the upper edge of the forehead to the lower edge of the chin of the face included in the first face frame
- the distance between the above-mentioned left frame line and the above-mentioned right frame line is the distance between the inside of the left ear and the inside of the right ear of the face included in the first face frame.
- the first straight line is a straight line passing through the above-mentioned left eyebrow key point and the above-mentioned right eyebrow key point.
- the forehead area is above the first straight line included in the first face frame
- moving the lower frame line to coincide with the first straight line can make the area included in the moved first face frame the forehead area. That is, while keeping the ordinate of the above-mentioned upper frame line unchanged, move the above-mentioned lower frame line along the negative direction of the vertical axis of the pixel coordinate system of the image to be processed, so that the line where the above-mentioned lower frame line is located after the movement Coincident with the above-mentioned first straight line, the second face frame is obtained.
- the area contained in the second face frame is the forehead area.
- the image processing device performs the following steps during step 23:
- the distance between the left frame line of the second face frame and the right frame line of the second face frame is the distance from the inside of the left ear to the inside of the right ear of the face included in the second face frame.
- the distance between the upper frame line of the first face frame and the lower frame line of the first face frame is the distance from the upper edge of the forehead to the lower edge of the chin of the face contained in the first face frame.
- the width of the forehead area is the largest. It accounts for about 1/3 of the length of the entire face, but the ratio of the width of the forehead area to the length of the face is different for each person. However, the ratio of the width of the forehead area to the length of the face of all people is 30% to 40% %In the range.
- the preset distance is set to be 30% to 40% of the distance between the upper frame line of the first human face frame and the lower frame line of the first human face frame. Therefore, to make the area inside the second face frame the forehead area, it is necessary to reduce the distance between the upper frame line of the second face frame and the lower frame line of the second face frame to the above-mentioned first face frame. 30% to 40% of the distance between the frame line and the bottom frame line.
- the upper frame line of the second face frame While keeping the ordinate of the lower frame line of the second face frame unchanged, move the upper frame line of the second face frame along the vertical axis of the pixel coordinate system of the image to be processed, so that the second person
- the distance between the upper frame line of the face frame and the lower frame line of the second face frame is a preset distance to obtain a third face frame.
- the area included in the third face frame is the forehead area.
- the image processing device performs the following steps during the execution of step 25:
- the above-mentioned reference distance is the distance between the two intersection points of the second straight line and the human face contour included in the third human-face frame
- the above-mentioned second straight line is between the above-mentioned first straight line and the third straight line and parallel to
- the above-mentioned first straight line or the above-mentioned third straight line is a straight line passing through the key points of the left corner of the mouth and the key point of the right corner of the mouth.
- the at least one human face key point further includes a left mouth corner key point and a right mouth corner key point.
- the third straight line is a straight line passing through the key points of the left corner of the mouth and the key point of the right corner of the mouth.
- the second straight line is between the first straight line and the third straight line, and the second straight line is parallel to the first straight line or the third straight line.
- the distance between the two intersection points of the second straight line and the face contour of the face image included in the third face frame is taken as the reference distance.
- the second straight line is between the first straight line and the third straight line, that is, in the middle area between the eyebrow area and the mouth area.
- the length of the forehead area is the width of the contour of the face, that is, the reference distance.
- the right frame line of the third face frame is moved along the negative direction of the horizontal axis of the pixel coordinate system of the image to be processed, and the left frame line and the right frame line of the third face frame are moved While the distance between them is half of the reference distance difference, move the left frame line of the third human face frame along the positive direction of the horizontal axis of the pixel coordinate system of the image to be processed to the left frame of the third human face frame
- the distance between the line and the right frame line is half of the difference between the reference distance, so that the distance between the left frame line of the above-mentioned third face frame after moving and the right frame line of the above-mentioned third face frame after moving is Reference distance.
- the region included in the moved third human face frame is the forehead region.
- the image processing device before determining the first number of first pixels in the region to be detected of the image to be processed, the image processing device further performs the following steps:
- the skin pixel point area can be the cheek area below the eyes included in the first human face frame, or the intersection area of the area below the nose and the area above the mouth included in the first human face frame, or It may be the region under the mouth contained in the first face frame.
- the image processing device before determining the skin pixel point area from the pixel point area contained in the above-mentioned face frame, the image processing device further performs the following steps:
- the image to be processed is tested for wearing a mask, and the detection results obtained include: the person in the image to be processed has worn a mask or the person in the image to be processed has not worn a mask.
- the image processing device performs first feature extraction processing on the image to be processed to obtain first feature data, where the first feature data carries information about whether the person to be detected is wearing a mask.
- the image processing device obtains the detection result according to the first feature data obtained from the mask wearing detection.
- the first feature extraction process can be implemented through a mask detection network.
- the mask detection network can be obtained by training the deep convolutional neural network.
- the annotation information includes whether the person in the first training image is wearing a mask.
- the at least one human face key point also includes key points of the lower eyelid of the left eye and key points of the lower eyelid of the right eye.
- the pixel point area between the first straight line and the fourth straight line in the face area is taken as the skin pixel point area.
- the fourth straight line is a straight line passing through the key points of the lower eyelid of the left eye and the key point of the lower eyelid of the right eye; both the key points of the lower eyelid of the left eye and the key points of the lower eyelid of the right eye belong to at least one of the aforementioned key points of the human face.
- the skin pixel area of the face area is an area other than the skin area, mouth area, eyebrow area, and eye area. Because the face area has pixels whose color values are displayed as black in the eye area and eyebrow area, and pixels whose color value is displayed as red in the mouth area. Therefore, the skin pixel area does not include the eye area, mouth area and eyebrow area. And because it is not sure whether the skin area is covered by a hat or bangs, etc., it is impossible to determine the skin pixel area corresponding to the skin area. Therefore, when the mask wearing detection processing of the image to be processed determines that the above-mentioned face area is not wearing a mask, the skin pixel area includes the pixel area in the face area except the skin area, mouth area, eyebrow area, and eye area.
- Face key point detection can obtain the key point coordinates of the lower eyelid of the left eye, the key point coordinates of the lower eyelid of the right eye, the key point coordinates of the left eyebrow, and the key point coordinates of the right eyebrow.
- the fourth straight line is the straight line passing through the key points of the lower eyelid of the left eye and the key point of the lower eyelid of the right eye
- the first straight line is the straight line passing through the key points of the left eyebrow and the right eyebrow.
- the three parts of the eyebrow area, the eyelid area and the nasion area are all between the horizontal line determined by the left eyebrow and the right eyebrow in the human face area and the straight line determined by the lower eyelid of the left eye and the lower eyelid of the right eye. Therefore, in the case that the detection result is that the face area wears a mask, the pixel point area between the first straight line and the fourth straight line in the human face area is taken as the skin pixel point area.
- the color value of the second pixel point is obtained from the skin pixel point area, where the color value of the second pixel point is used as a benchmark for measuring the skin color exposed in the skin area. Therefore, the second pixel point may be any point in the skin pixel point area.
- the implementation of obtaining the second pixel in the skin pixel area can be: find the coordinate average of a certain skin pixel area as the second pixel; or find the pixel at the intersection coordinates of the straight lines determined by some key points as The second pixel; or grayscale processing is performed on an image of a part of the skin pixel area, and the pixel with the largest grayscale value is used as the second pixel.
- the embodiment of the present application does not limit the manner of acquiring the second pixel.
- the key points when there are two key points in the inner area of the right eyebrow and the inner area of the left eyebrow respectively, set the key points as the upper point on the inner side of the right eyebrow, the lower point on the inner side of the right eyebrow, the upper point on the inner side of the left eyebrow, Point below the inside of the left eyebrow.
- the unique point of intersection can be obtained by these two intersecting straight lines. As shown in the figure, suppose the numbers corresponding to these four key points are 37, 38, 67, and 68 respectively.
- the key points 37 and 68 are connected, and the key points 38 and 67 are connected. After determining these two straight lines, an intersection point can be obtained. Based on the position of the face frame, the coordinates of the four key points 37, 38, 67, and 68 can be determined, and then the coordinates of the intersection points can be solved by using Opencv. By determining the coordinates of the intersection point, the pixel point corresponding to the intersection point can be obtained. By converting the RGB channel of the pixel corresponding to the intersection point into an HSV channel, the color value of the pixel corresponding to the intersection coordinate can be obtained. The color value of the pixel corresponding to the intersection coordinate is the color value of the second pixel.
- the key points when there are two key points in the inner area of the right eyebrow and the inner area of the left eyebrow respectively, set the key points as the upper point on the inner side of the right eyebrow, the lower point on the inner side of the right eyebrow, and the upper point on the inner side of the left eyebrow. , Point below the inside of the left eyebrow. Find a rectangular area through these 4 key points as the eyebrow area. As shown in the figure, assuming that the numbers corresponding to these four key points are 37, 38, 67, and 68 respectively, a rectangular area is calculated as the eyebrow area through these four key points.
- the obtained coordinates of the key points 37, 38, 67, 68 are defined as (X1, Y1), (X2, Y2), (X3, Y3), (X4, Y4) respectively.
- the four coordinates of the intercepted eyebrow area are (X6, Y6), (X5, Y5), (X5, Y6), (X6, Y5).
- the coordinates of the four key points 37, 38, 67, and 68 can be determined, and (X6, Y6), (X5, Y5), (X5, Y6), (X6, Y5) can be determined The positions of these four points. Connect (X6, Y6) and (X5, Y5) and connect (X5, Y6) and (X6, Y5) to obtain two straight lines, and a unique intersection point can be obtained through these two straight lines. Then, Opencv can be used to solve the coordinates of the intersection point.
- the pixel point corresponding to the intersection point By determining the coordinates of the intersection point, the pixel point corresponding to the intersection point can be obtained. By converting the RGB channel of the pixel corresponding to the intersection point into an HSV channel, the color value of the pixel corresponding to the intersection coordinate can be obtained. The color value of the pixel corresponding to the intersection coordinate is the color value of the second pixel.
- the image processing device performs the following steps during step 4:
- At least one face key point includes at least one first key point belonging to the inner area of the left eyebrow and at least one second key point belonging to the inner area of the right eyebrow, according to the above at least one first key point
- the key point and the at least one second key point define a rectangular area.
- various schemes for obtaining a rectangular area according to the at least one first key point and the at least one second key point are included.
- the pixel point corresponding to the intersection point can be obtained.
- By converting the RGB channel of the pixel corresponding to the intersection to the HSV channel the color value of the pixel corresponding to the intersection can be obtained.
- the color value of the pixel corresponding to the intersection coordinate is the color value of the second pixel.
- the line connecting the two key points inside the left eyebrow is used as the key point of the rectangular area
- the length of the first side select one of the two key points on the inner side of the left eyebrow that is inconsistent with the ordinate of the key point on the inner side of the right eyebrow, and use the line connecting it with the key point on the inner side of the right eyebrow as the second side of the rectangular area long.
- At least one first key point includes a third key point and a fourth key point; at least one second key point includes a fifth key point and a sixth key point; the third key point The ordinate of the point is smaller than the fourth key point; the ordinate of the fifth key point is smaller than the sixth key point; the first abscissa and the first ordinate determine the first coordinate; the second abscissa and the first ordinate determine the second coordinate; An abscissa and the second ordinate determine the third coordinate; the second abscissa and the second ordinate determine the fourth coordinate; the first ordinate is the maximum value of the ordinate of the third key point and the fifth key point; the second The ordinate is the minimum value of the ordinate of the fourth key point and the sixth key point; the first abscissa is the maximum value of the abscissa of the third key point and the fourth key point; the second abscissa is the fifth key point and The minimum value of the abs
- the image processing device performs the following steps during step 4:
- the at least one face key point includes at least one first key point belonging to the inner area of the left eyebrow
- the at least one face key point includes at least one second key point belonging to the inner area of the right eyebrow
- the above-mentioned at least one human face key point includes at least one second key point belonging to the inner area of the right eyebrow
- the above-mentioned at least one human face key point includes at least one first key point belonging to the inner area of the left eyebrow
- the coordinates of at least one first keypoint and at least one second keypoint are averaged.
- the key points of the inner area of the right eyebrow and the inner area of the left eyebrow are set as the upper point of the inner right eyebrow, the lower point of the inner right eyebrow, and the lower point of the left inner eyebrow.
- Point on the upper inner side of the eyebrow and four points on the lower inner side of the left eyebrow are 37, 38, 67, and 68 respectively.
- Get the coordinates of 37, 38, 67, and 68 as (X1, Y1), (X2, Y2), (X3, Y3), (X4, Y4), and add the abscissa and ordinate of these four coordinates respectively Calculate the average value to obtain the average value coordinates as (X0, Y0).
- the RGB channel of the pixel is converted into the HSV channel, and the color value of the pixel corresponding to the average coordinate (X0, Y0) can be obtained according to the average coordinate.
- the color value of the pixel point corresponding to the average value coordinate is the color value of the second pixel point.
- the image processing device performs the following steps during step 4:
- the at least one facial key point further includes a key point inside the right eyebrow, a key point on the left side of the nasion, a key point on the right side of the nasion, and a key point inside the left eyebrow.
- Connect the key point inside the right eyebrow with the key point on the left side of the nasion connect the key point inside the left eyebrow with the key point on the right side of the nasion, and obtain two intersecting straight lines as the fifth straight line and the sixth straight line.
- This application does not limit the key point inside the right eyebrow and the key point inside the left eyebrow.
- the key point inside the right eyebrow is any key point taken in the inner area of the right eyebrow
- the key point inside the left eyebrow is any key point taken in the area inside the left eyebrow. a key point.
- the numbers corresponding to these four key points are 67, 68, 78, and 79 respectively, that is, connecting key points 78 and 68, and connecting key points 79 and 67
- the coordinates of the four key points 67, 68, 79, and 78 can be determined, and then the coordinates of the intersection points can be solved by using Opencv.
- the pixel point corresponding to the intersection point By determining the coordinates of the intersection point, the pixel point corresponding to the intersection point can be obtained. By converting the RGB channel of the pixel corresponding to the intersection point into an HSV channel, the color value of the pixel corresponding to the intersection coordinate can be obtained. The color value of the pixel corresponding to the intersection coordinate is the color value of the second pixel.
- the difference between the color value of the second pixel point and the first value is used as the second threshold, and the sum of the color value of the second pixel point and the second value is used as the third threshold, wherein the first value and the first value Neither value exceeds the maximum value among the color values of the object to be processed.
- the second threshold and the third threshold can be determined by determining the color value of the second pixel.
- the function of the Opencv algorithm can convert the representation of the image from the RGB channel map to the HSV channel map, so as to obtain the color value of the second pixel.
- the color value includes three parameter values of chroma, brightness and saturation. Among them, the range of hue is 0 to 180, and the range of brightness and saturation are both 0 to 255. That is to say, the maximum value of chroma is 180, and the maximum value of brightness and saturation is 255. It should be understood that the first value and the second value also respectively include three parameters of hue, brightness and saturation. Therefore, neither the chroma of the first value nor the chroma of the second value exceeds 180, neither the brightness of the first value nor the brightness of the second value exceeds 255, and the saturation of the first value and the saturation of the second value both No more than 255.
- the three parameter values of the first value and the second value of chroma, brightness, and saturation are consistent. That is to say, the three parameter values of chroma, brightness, and saturation of the color value of the second pixel point are intermediate values of the three parameter values of chroma, brightness, and saturation corresponding to the second threshold and the third threshold.
- mapping relationship between the color value of the second pixel point and the second threshold and the third threshold through machine learning binary classification algorithms, such as Logistic regression and naive Bayesian algorithm, according to the input of a certain color
- the color value judges whether this color belongs to the color value of the second pixel point for classification. That is, input a bunch of color values, classify whether these color values belong to the color values of the second pixel, and determine which color values belong to the color values of the second pixel.
- the mapping relationship between the color value of the second pixel point and the second threshold and the third threshold can be obtained through a machine algorithm.
- the three parameter values of chroma, brightness and saturation corresponding to the first value and the second value are 30, 60 and 70 respectively. That is to say, after obtaining the color value of the second pixel, the corresponding second threshold is to decrease the chroma by 30, the brightness by 60, and the saturation by 70, and the corresponding third threshold is to increase the chroma by 30 and the brightness by 60 , increase the saturation by 70.
- the image processing device performs the following steps during the execution of step 203:
- the image processing device If the skin occlusion detection result shows that the skin area is occluded, the image processing device outputs prompt information that the skin needs to be exposed. According to the prompt message of exposing the skin, the skin occlusion detection can be performed again after exposing the skin, or other operations can be performed. This application is not limited.
- the image processing device determines that the skin occlusion detection result is that the skin area is in an unoccluded state according to the result that the first ratio of the first number to the number of pixels in the area to be detected is equal to or greater than the first threshold.
- the first number is 60
- the number of pixels in the region to be tested is 100
- the first number is 70
- the number of pixels in the region to be tested is 100
- a temperature measurement operation or other operations may be performed. If the temperature measurement is performed when the skin occlusion detection result shows that the skin area is in an unoccluded state, the accuracy of temperature detection can be improved.
- the present application does not limit the subsequent operations performed when the skin occlusion detection result shows that the skin area is in an unoccluded state.
- the image processing device also performs the following steps:
- the image processing method in the embodiment of the present application can be used in the field of temperature measurement, and the above skin area belongs to the person to be detected.
- Each pixel in the temperature thermodynamic map carries the temperature information of the corresponding pixel.
- the temperature thermodynamic map is collected by an infrared thermal imaging device on the image processing device.
- the image processing device performs image matching processing on the temperature thermodynamic map and the image to be processed, determines the pixel point area corresponding to the face area of the image to be processed from the temperature thermodynamic map, and obtains the person in the image to be processed on the temperature thermodynamic map.
- the pixel area corresponding to the face area is corresponding to the face area.
- the body temperature of the subject is determined by detecting the temperature of the forehead area of the subject
- the above-mentioned skin occlusion detection result shows that the skin area is in an unoccluded state
- the pixel area corresponding to the face area generally speaking, the skin area is located in the upper 30% to 40% of the entire face area, so the temperature corresponding to the skin area in the temperature thermodynamic map can be obtained.
- the average temperature of the skin area can be used as the body temperature of the person to be detected, or the highest temperature of the skin area can be used as the body temperature of the person to be detected, which is not limited in this application.
- FIG. 3 is a schematic flowchart of an applied image processing method provided by an embodiment of the present application.
- the embodiment of the present application also provides a possible application scenario of the image processing method.
- the temperature of the forehead area of pedestrians is generally measured.
- pedestrians have bangs covering their foreheads or wearing hats, because it is impossible to determine whether the forehead area is covered, it will cause a certain degree of interference to the temperature measurement, which brings certain challenges to the current temperature measurement work. Therefore, before measuring the temperature, the pedestrian's forehead is covered by detection, and when the forehead is not covered, the temperature of the pedestrian's forehead can be measured, which can improve the accuracy of temperature measurement.
- the image processing device acquires camera frame data, that is, an image to be processed. Face detection is performed on the image to be processed, and if the result of the face detection is that there is no human face in the image to be processed, the image processing device acquires a new image to be processed. If the result of face detection is that there is a human face, then the image processing device will input the image to be processed into the trained neural network, and can output the human face frame (as shown in D of Figure 1 ) and the human face of the image to be processed. Box coordinates (as shown in Figure 1) and coordinates of 106 key points (as shown in Figure 4).
- the coordinates of the face frame can be a pair of diagonal coordinates including the upper left corner coordinate and the lower right corner coordinate or the lower left corner coordinate and the upper right corner coordinate. Corner coordinates (as shown in Figure 1).
- the neural network that outputs the coordinates of the face frame of the image to be processed and the coordinates of 106 key points can be a neural network, or it can be a series of two neural networks that realize face detection and face key point detection respectively. .
- the color value of the brightest pixel point in the brow area is used as the color value reference of the exposed skin area of the forehead area.
- the brightest pixel is the above-mentioned second pixel. Therefore, it is necessary to obtain the eyebrow area first.
- the key points of the inner area of the left eyebrow and the inner area of the right eyebrow are obtained.
- the key points are the upper point on the inner side of the right eyebrow, the lower point on the inner side of the right eyebrow, the upper point on the inner side of the left eyebrow, and the lower point on the inner side of the left eyebrow.
- the embodiment of the present application takes the coordinates of 106 key points as an example.
- the upper point on the inner side of the right eyebrow, the lower point on the inner side of the right eyebrow, the upper point on the inner side of the left eyebrow, and the lower point on the inner side of the left eyebrow correspond to the four points 37, 38, 67, and 68. key point.
- the number of key points and the number of key points here do not constitute a limitation, as long as the two key points of the inner area of the right eyebrow and the inner area of the left eyebrow are taken respectively, they are within the scope of protection claimed by this application.
- the coordinates of key points 37, 38, 67, and 68 are obtained as (X1, Y1), (X2, Y2), (X3, Y3), and (X4, Y4) respectively.
- a rectangular area can be determined.
- the coordinates of the four vertices of the rectangular area are (X6, Y6), (X5, Y5), (X5, Y6), (X6, Y5), and this rectangular area is also the brow area to be intercepted.
- the coordinates of the four points 37, 38, 67, and 68 can be determined through the key point detection of the face, then (X6, Y6), (X5, Y5), (X5, Y6), (X6, Y5) can be determined The positions of these four points. Intercept the rectangular area determined according to these four points to obtain the area between the eyebrows.
- gray-scale processing is performed on the brow area to obtain a gray-scale image of the brow area.
- grayscale processing often uses two methods for processing:
- the Opencv function can also be used to perform grayscale processing on the region between the eyebrows, and the grayscale processing method of the region between the eyebrows is not limited in this application.
- the grayscale processing method of the region between the eyebrows is not limited in this application.
- Add the gray values of each row of the gray image of the brow area and record the coordinates of the row with the largest sum of gray values.
- the gray value of each column of the gray image of the brow area is added, and the coordinates of the column with the largest sum of gray values are recorded.
- the coordinates of the brightest pixel in the eyebrow area are obtained by obtaining the intersection coordinates determined by the coordinates of the maximum row and maximum column of the sum of gray values.
- RGB and HSV find the RGB value of the brightest pixel in the brow area.
- You can convert the corresponding HSV value through the formula.
- the HSV value of the point Because the HSV value of the brightest pixel in the eyebrow area has a definite relationship with the second threshold and the third threshold, that is to say, the HSV value of the brightest pixel in the eyebrow area can determine the corresponding second threshold and third threshold.
- the length of the forehead area is the width of the human face.
- the face frame is reduced so that the distance between the left frame line and the right frame line of the face frame is the distance between key point 0 and key point 32. That is to say, the distance between the key point 0 and the key point 32 is taken as the length of the forehead area.
- the width of the forehead area accounts for about 1/3 of the entire face frame. Although the ratio of the width of the forehead area to the length of the entire face is different for each person, the width of the forehead area is almost 30% of the length of the face. to the 40% range.
- the distance between the upper frame line and the lower frame line of the face frame is reduced to 30% to 40% of the distance between the upper frame line and the lower frame line of the original face frame, as the width of the forehead area.
- the forehead area is the area located above the eyebrows.
- the horizontal line defined by key points 35 and 40 is the position of the eyebrows. Therefore, move the size-changed face frame so that the lower frame of the size-changed face frame is located at the horizontal line determined by the two key points 35 and 40, and obtain a changed position and size face frame.
- the rectangular area contained in the face frame whose size and position are changed is the forehead area.
- the forehead area is intercepted, and then the forehead area is binarized according to the second threshold and the third threshold to obtain a binarized image of the forehead area.
- the binary image is used here, which can reduce the amount of data processing and speed up the detection of the forehead area by the image processing device.
- the binarization standard is: the HSV value of a certain pixel in the forehead area is greater than or equal to the second threshold and less than or equal to the third threshold, then the gray value of this pixel is 255, and the HSV value of a certain pixel in the forehead area If it is less than the second threshold or greater than the third threshold, then the gray value of this pixel is 0.
- First convert the forehead region image from RGB channel map to HSV channel map.
- the thermal imaging temperature measurement operation is performed.
- the forehead area is considered to be in a blocked state, and the temperature measurement operation at this time will affect the accuracy of temperature measurement, so the output needs to be exposed Forehead prompts, and the image processing device needs to re-acquire an image to re-detect the forehead occlusion state.
- the second threshold is (100, 50, 70)
- the third threshold is (120, 90, 100)
- the color value of the pixel point q in the forehead area is (110, 60, 70)
- the pixel in the forehead area The color value of point p is (130, 90, 20).
- q is within the range of the second threshold and the third threshold
- p is not within the range of the second threshold and the third threshold.
- the gray value of the pixel point q is 255
- the gray value of the pixel point p is 0.
- the threshold is 60%, the number of pixels in the forehead area is 100, and the number of white pixels is 50, then the ratio of the number of white pixels to the number of pixels in the forehead area is 50%, and the threshold is not reached, the forehead area It is in an occluded state, so the output needs to show the prompt of the forehead.
- the writing order of each step does not mean a strict execution order and constitutes any limitation on the implementation process.
- the specific execution order of each step should be based on its function and possible
- the inner logic is OK.
- FIG. 5 is a schematic structural diagram of an image processing device provided by an embodiment of the present application, wherein the device 1 includes an acquisition unit 11, a first processing unit 12, and a detection unit 13.
- an image processing device 1 also includes a second processing unit 14, a determination unit 15, a third processing unit 16, and a fourth processing unit 17, wherein: the acquisition unit 11 is used to acquire the image to be processed, the first threshold, the second threshold and the third threshold, The first threshold is different from the second threshold, the first threshold is different from the third threshold, and the second threshold is less than or equal to the third threshold; the first processing unit 12 is configured to determine the The first quantity of the first pixel in the area to be detected of the image to be processed; the first pixel is a pixel whose color value is greater than or equal to the second threshold and less than or equal to the third threshold; the detection unit 13 is configured to The first ratio of the first number to the number of pixels in the region to be detected and the first threshold are used to obtain a skin occlusion detection result of the
- the area to be tested includes a human face area
- the skin occlusion detection result includes a human face occlusion detection result
- the image processing device further includes: a second processing unit 14, configured to Before determining the first number of first pixels in the area to be detected of the image to be processed, performing face detection processing on the image to be processed to obtain a first face frame; according to the first face frame, from The face area is determined in the image to be processed.
- the face area includes a forehead area
- the face occlusion detection result includes a forehead occlusion detection result
- the first face frame includes: an upper frame line and a lower frame line; Both the frame line and the lower frame line are sides parallel to the horizontal axis of the pixel coordinate system of the image to be processed in the first face frame, and the ordinate of the upper frame line is smaller than the lower frame line The ordinate;
- the second processing unit 14 is used to: detect the key points of the human face on the image to be processed to obtain at least one key point of the human face; the at least one key point of the human face includes the left eyebrow key point and the right eyebrow key point Eyebrow key point; under the condition of keeping the ordinate of the upper frame line unchanged, move the lower frame line along the negative direction of the vertical axis of the pixel coordinate system of the image to be processed, so that the lower frame line Where the straight line coincides with the first straight line to obtain the second human face frame; the first straight line is a straight line passing through the left
- the second processing unit 14 is configured to: keep the vertical coordinate of the lower frame line of the second face frame unchanged, and convert the upper frame line of the second face frame to The frame line moves along the vertical axis of the pixel coordinate system of the image to be processed, so that the distance between the upper frame line of the second human face frame and the lower frame line of the second human face frame is a preset distance, and the first Three face frames; according to the area included in the third face frame, the forehead area is obtained.
- the at least one human face key point also includes a left mouth corner key point and a right mouth corner key point
- the first human face frame further includes: a left frame line and a right frame line
- the left frame line and the right frame line are both sides parallel to the vertical axis of the pixel coordinate system of the image to be processed in the first face frame, and the abscissa of the left frame line is smaller than that of the right frame line Abscissa
- the second processing unit 14 is used to: keep the abscissa of the left frame line of the third human face frame unchanged, and place the right frame line of the third human face frame along the The horizontal axis of the pixel coordinate system of the image to be processed moves, so that the distance between the right frame line of the third human face frame and the left frame line of the third human face frame is a reference distance, and the fourth human face frame is obtained;
- the reference distance is the distance between the second straight line and the two intersection points of the human face contour included in the third human face frame;
- the image device further includes: a determining unit 15, configured to, before determining the first number of first pixels in the region to be detected of the image to be processed, from the first Determine the skin pixel point area in the pixel point area included in the human face frame; the acquisition unit 11 is also used to obtain the color value of the second pixel point in the skin pixel point area; the first processing unit 12 is also used The difference between the color value of the second pixel point and the first value is used as the second threshold, and the sum of the color value of the second pixel point and the second value is used as the third threshold; Neither the first value nor the second value exceeds the maximum value among the color values of the image to be processed.
- the image processing device further includes: a third processing unit 16, configured to, before determining the skin pixel area from the pixel area included in the first human face frame, The mask wearing detection process is carried out on the image to be processed, and the detection result is obtained; the determination unit 15 is used to: when it is detected that the face area in the image to be processed is not wearing a mask, remove all masks from the face area.
- the forehead area, the mouth area, the eyebrow area and the pixel area outside the eye area are used as the skin pixel area; when it is detected that the face area in the image to be processed is wearing a mask, the first The pixel point area between the straight line and the fourth straight line is used as the skin pixel point area.
- the fourth straight line is a straight line passing through the key points of the lower eyelid of the left eye and the key point of the lower eyelid of the right eye; both the key points of the lower eyelid of the left eye and the key points of the lower eyelid of the right eye belong to the at least one human face key point.
- the acquisition unit 11 is configured to: include at least one first key point belonging to the inner area of the left eyebrow in the at least one key point of the human face, and include at least one first key point belonging to the inner area of the right eyebrow.
- the color value of the intersection point of the first row and the first column in the grayscale image of the rectangular area is used as the color value of the second pixel point;
- the first row is the row with the largest sum of grayscale values in the grayscale image
- the first column is the column with the largest sum of gray values in the gray scale image.
- the detection unit 13 is configured to: if the first ratio does not exceed the first threshold, determine that the skin occlusion detection result is the skin area corresponding to the area to be tested In an occluded state; when the first ratio exceeds the first threshold, it is determined that the skin occlusion detection result indicates that the skin area corresponding to the region to be detected is in an unoccluded state.
- the skin area belongs to the person to be detected, and the acquisition unit 11 is further configured to: acquire the temperature thermodynamic map of the image to be processed; the image processing device further includes: a fourth processing unit 17 , for reading the temperature of the skin area from the temperature thermodynamic map as the body temperature of the person to be detected when the skin occlusion detection result shows that the skin area is in an unoccluded state.
- the functions or modules included in the device provided by the embodiments of the present application can be used to execute the methods described in the above method embodiments, and its specific implementation can refer to the descriptions of the above method embodiments. For brevity, here No longer.
- FIG. 6 is a schematic diagram of a hardware structure of an image processing device provided by an embodiment of the present application.
- the image processing device 2 includes a processor 21 , a memory 22 , an input device 23 and an output device 24 .
- the processor 21, the memory 22, the input device 23 and the output device 24 are coupled through a connector 25, and the connector 25 includes various interfaces, transmission lines or buses, etc., which are not limited in this embodiment of the present application.
- coupling refers to interconnection in a specific way, including direct connection or indirect connection through other devices, for example, connection through various interfaces, transmission lines, and buses.
- the processor 21 may be one or more graphics processing units (graphics processing unit, GPU), and in the case where the processor 21 is a GPU, the GPU may be a single-core GPU or a multi-core GPU.
- the processor 21 may be a processor group composed of multiple GPUs, and the multiple processors are coupled to each other through one or more buses.
- the processor may also be other types of processors, etc., which are not limited in this embodiment of the present application.
- the memory 22 can be used to store computer program instructions and various computer program codes including program codes for implementing the solutions of the present application.
- the memory includes but is not limited to random access memory (random access memory, RAM), read-only memory (read-only memory, ROM), erasable programmable read-only memory (erasable programmable read only memory, EPROM ), or portable read-only memory (compact disc read-only memory, CD-ROM), which is used for related instructions and data.
- the input device 23 is used for inputting data and/or signals and the output device 24 is used for outputting data and/or signals.
- the input device 23 and the output device 24 can be independent devices, or an integrated device.
- the memory 22 can not only be used to store relevant instructions, but also can be used for storage, for example, the memory 22 can be used to store data obtained through the input device 23, or the memory 22 can also be used to store data obtained through the processor. 21 processed data, etc., the embodiment of the present application does not limit the specific data stored in the memory.
- Fig. 6 only shows a simplified design of the image processing device.
- the image processing device can also include other necessary components, including but not limited to any number of input/output devices, processors, memories, etc., and all image processing devices that can implement the embodiments of the present application should be in Within the protection scope of this application.
- the disclosed systems, devices and methods may be implemented in other ways.
- the device embodiments described above are only illustrative.
- the division of the above units is only a logical function division. In actual implementation, there may be other division methods.
- multiple units or components can be combined or can be Integrate into another system, or some features may be ignored, or not implemented.
- the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
- the units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
- each functional unit in each embodiment of the present application may be integrated into a first processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
- all or part of them may be implemented by software, hardware, firmware or any combination thereof.
- software When implemented using software, it may be implemented in whole or in part in the form of a computer program product.
- the computer program product described above comprises one or more computer instructions.
- the above-mentioned computer program instructions When the above-mentioned computer program instructions are loaded and executed on the computer, all or part of the above-mentioned processes or functions according to the embodiments of the present application will be generated.
- the above-mentioned computers may be general-purpose computers, special-purpose computers, computer networks, or other programmable devices.
- the above computer instructions may be stored in a computer-readable storage medium, or transmitted through the above-mentioned computer-readable storage medium.
- the above computer instructions can be sent from one website site, computer, server or data center to another via wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) A website site, computer, server or data center for transmission.
- the above-mentioned computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server or a data center integrated with one or more available media.
- the above available medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a digital versatile disc (digital versatile disc, DVD)), or a semiconductor medium (for example, a solid state disk (solid state disk, SSD)) Wait.
- a magnetic medium for example, a floppy disk, a hard disk, a magnetic tape
- an optical medium for example, a digital versatile disc (digital versatile disc, DVD)
- a semiconductor medium for example, a solid state disk (solid state disk, SSD)
- the processes can be completed by computer programs to instruct related hardware.
- the programs can be stored in computer-readable storage media.
- When the programs are executed may include the processes of the foregoing method embodiments.
- the aforementioned storage medium includes: various media capable of storing program codes such as read-only memory (ROM) or random access memory (RAM), magnetic disk or optical disk.
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Computational Linguistics (AREA)
- Molecular Biology (AREA)
- Artificial Intelligence (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Health & Medical Sciences (AREA)
- Data Mining & Analysis (AREA)
- Evolutionary Computation (AREA)
- General Health & Medical Sciences (AREA)
- Life Sciences & Earth Sciences (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Quality & Reliability (AREA)
- Image Processing (AREA)
- Plural Heterocyclic Compounds (AREA)
- Measuring And Recording Apparatus For Diagnosis (AREA)
Abstract
The present application discloses an image processing method and apparatus, a processor, an electronic device, and a storage medium. The method comprises: obtaining an image to be processed, a first threshold, a second threshold, and a third threshold, the first threshold being different from the second threshold, the first threshold being different from the third threshold, and the second threshold being less than or equal to the third threshold; determining a first number of first pixel points in an area to be detected of said image; the first pixel points being pixel points whose color value is greater than or equal to the second threshold and less than or equal to the third threshold; and obtaining a skin occlusion detection result of said image according to a first ratio of the first number to the number of pixel points in a skin area and the first threshold.
Description
相关申请的交叉引用Cross References to Related Applications
本申请要求于2021年5月31日提交的、申请号为202110600103.1的中国专利申请的优先权,该中国专利申请公开的全部内容以引用的方式并入本文中。This application claims priority to the Chinese patent application with application number 202110600103.1 filed on May 31, 2021, the entire disclosure of which is incorporated herein by reference.
本申请涉及图像处理技术领域,尤其涉及一种图像处理方法及装置、处理器、电子设备及存储介质。The present application relates to the technical field of image processing, and in particular to an image processing method and device, a processor, electronic equipment, and a storage medium.
为提高检测安全性,越来越多的场景应用了对皮肤进行非接触检测。而这类非接触检测的检测准确度很大程度上受皮肤遮挡状态的影响。如,若皮肤区域被遮挡的面积较大,对该皮肤区域进行非接触检测的检测结果的准确度可能较低。因此,如何检测皮肤遮挡状态具有非常重要的意义。In order to improve the safety of detection, non-contact detection of skin is applied in more and more scenarios. The detection accuracy of this type of non-contact detection is largely affected by the state of skin occlusion. For example, if the covered area of the skin area is relatively large, the accuracy of the detection result of the non-contact detection on the skin area may be low. Therefore, how to detect the state of skin occlusion is of great significance.
发明内容Contents of the invention
本申请提供一种图像处理方法及装置、处理器、电子设备及存储介质,以确定皮肤是否处于遮挡状态。The present application provides an image processing method and device, a processor, electronic equipment and a storage medium to determine whether the skin is in a blocking state.
本申请提供了一种图像处理方法,所述方法包括:获取待处理图像、第一阈值、第二阈值和第三阈值,所述第一阈值和所述第二阈值不同,所述第一阈值和所述第三阈值不同,所述第二阈值小于等于所述第三阈值;确定所述待处理图像的待测区域中第一像素点的第一数量;所述第一像素点为颜色值大于等于所述第二阈值、且小于等于所述第三阈值的像素点;依据所述第一数量与所述待测区域内像素点的数量的第一比值和所述第一阈值,得到所述待处理图像的皮肤遮挡检测结果。The present application provides an image processing method, the method comprising: acquiring an image to be processed, a first threshold, a second threshold, and a third threshold, the first threshold is different from the second threshold, and the first threshold Different from the third threshold, the second threshold is less than or equal to the third threshold; determine the first number of first pixels in the region to be detected of the image to be processed; the first pixel is a color value Pixels greater than or equal to the second threshold and less than or equal to the third threshold; according to the first ratio of the first number to the number of pixels in the region to be tested and the first threshold, the obtained Describe the skin occlusion detection results of the image to be processed.
结合本申请任一实施方式,所述确定所述待处理图像的皮肤区域中第一像素点的第一数量,包括:对所述待处理图像进行人脸检测处理,得到第一人脸框;依据所述第一人脸框,从所述待处理图像中确定所述待测区域;确定所述待测区域中所述第一像素点的第一数量。In combination with any embodiment of the present application, the determining the first number of first pixels in the skin area of the image to be processed includes: performing face detection processing on the image to be processed to obtain a first face frame; Determining the region to be detected from the image to be processed according to the first face frame; determining a first number of the first pixels in the region to be detected.
结合本申请任一实施方式,所述第一人脸框包括上框线和下框线;所述上框线和所述下框线均为所述第一人脸框中平行于所述待处理图像的像素坐标系的横轴的边,且所述上框线的纵坐标小于所述下框线的纵坐标;所述依据所述第一人脸框,从所述待处理图像中确定所述待测区域,包括:对所述待处理图像进行人脸关键点检测,得到至少一个人脸关键点;所述至少一个人脸关键点包括左眉毛关键点和右眉毛关键点;在保持所述上框线的纵坐标不变的情况下,将所述下框线沿所述待处理图像的像素坐标系的纵轴的负方向移动,使得所述下框线所在直线与第一直线重合,得到第二人脸框;所述第一直线为过所述左眉毛关键点和所述右眉毛关键点的直线;依据所述第二人脸框包含的区域,得到所述待测区域。In combination with any embodiment of the present application, the first face frame includes an upper frame line and a lower frame line; both the upper frame line and the lower frame line are in the first face frame parallel to the Process the side of the horizontal axis of the pixel coordinate system of the image, and the ordinate of the upper frame line is smaller than the ordinate of the lower frame line; according to the first face frame, determine from the image to be processed The area to be tested includes: performing human face key point detection on the image to be processed to obtain at least one human face key point; the at least one human face key point includes a left eyebrow key point and a right eyebrow key point; When the vertical coordinate of the upper frame line remains unchanged, the lower frame line is moved along the negative direction of the vertical axis of the pixel coordinate system of the image to be processed, so that the line where the lower frame line is located is the same as the first straight line. The lines overlap to obtain the second human face frame; the first straight line is a straight line passing through the left eyebrow key point and the right eyebrow key point; according to the area included in the second human face frame, the to-be measurement area.
结合本申请任一实施方式,所述依据所述第二人脸框包含的区域,得到所述待测区域,包括:在保持所述第二人脸框的下框线的纵坐标不变的情况下,将所述第二人脸框的上框线沿所述待处理图像的像素坐标系的纵轴移动,使得所述第二人脸框的上框线和所述第二人脸框的下框线之间的距离为预设距离,得到第三人脸框;依据所述第三人脸框包含的区域,得到所述待测区域。In combination with any embodiment of the present application, the obtaining the area to be tested according to the area contained in the second face frame includes: keeping the ordinate of the lower frame line of the second face frame unchanged case, move the upper frame line of the second face frame along the vertical axis of the pixel coordinate system of the image to be processed, so that the upper frame line of the second face frame and the second face frame The distance between the lower frame lines is a preset distance to obtain a third human face frame; according to the area included in the third human face frame, the region to be tested is obtained.
结合本申请任一实施方式,所述至少一个人脸关键点还包括左嘴角关键点和右嘴角关键点;所述第一人脸框还包括左框线和右框线;所述左框线和所述右框线均为所述第一人脸框中平行于所述待处理图像的像素坐标系的纵轴的边,且所述左框线的横坐标小于所述右框线的横坐标;所述依据所述第三人脸框包含的区域,得到所述待测区域,包括:在保持所述第三人脸框的左框线的横坐标不变的情况下,将所述第三人脸框的右框线沿所述待处理图像的像素坐标系的横轴移动,使得所述第三人脸框的右框线和所述第三人脸框的左框线之间的距离为参考距离,得到第四人脸框;所述参考距离为第二直线 与所述第三人脸框包含的人脸轮廓的两个交点之间的距离;所述第二直线为在所述第一直线和第三直线之间且平行于所述第一直线或所述第三直线的直线;所述第三直线为过所述左嘴角关键点和所述右嘴角关键点的直线;将所述第四人脸框包含的区域作为所述待测区域。In combination with any embodiment of the present application, the at least one human face key point also includes a left mouth corner key point and a right mouth corner key point; the first human face frame also includes a left frame line and a right frame line; the left frame line and the right frame line are sides parallel to the vertical axis of the pixel coordinate system of the image to be processed in the first face frame, and the abscissa of the left frame line is smaller than the abscissa of the right frame line Coordinates; said obtaining the region to be tested according to the region included in the third human face frame includes: keeping the abscissa of the left frame line of the third human face frame unchanged, The right frame line of the third human face frame moves along the horizontal axis of the pixel coordinate system of the image to be processed, so that between the right frame line of the third human face frame and the left frame line of the third human face frame The distance is the reference distance to obtain the fourth human face frame; the reference distance is the distance between the two intersection points of the second straight line and the human face contour contained in the third human face frame; the second straight line is at A straight line between the first straight line and the third straight line and parallel to the first straight line or the third straight line; the third straight line passes through the key point of the left mouth corner and the key point of the right mouth corner A straight line; the area contained in the fourth human face frame is used as the area to be tested.
结合本申请任一实施方式,所述获取第二阈值和第三阈值,包括:从所述第一人脸框包含的像素点区域中确定皮肤像素点区域;获取所述皮肤像素点区域中第二像素点的颜色值;将所述第二像素点的颜色值与第一值的差作为所述第二阈值,将所述第二像素点的颜色值与第二值的和作为所述第三阈值;其中,所述第一值和所述第二值均不超过所述待处理图像的颜色值中的最大值。In combination with any embodiment of the present application, the acquiring the second threshold and the third threshold includes: determining the skin pixel area from the pixel area contained in the first human face frame; acquiring the second skin pixel area in the skin pixel area The color value of two pixels; the difference between the color value of the second pixel and the first value is used as the second threshold, and the sum of the color value of the second pixel and the second value is used as the first threshold Three thresholds; wherein, neither the first value nor the second value exceeds the maximum value among the color values of the image to be processed.
结合本申请任一实施方式,所述从所述第一人脸框包含的像素点区域中确定皮肤像素点区域,包括:在检测到所述待处理图像中人脸区域未佩戴口罩的情况下,将所述人脸区域中除额头区域、嘴巴区域、眉毛区域和眼睛区域之外的像素点区域,作为所述皮肤像素点区域;在检测到所述待处理图像中人脸区域佩戴口罩的情况下,将所述第一直线和第四直线之间的像素点区域作为所述皮肤像素点区域;所述第四直线为过左眼下眼睑关键点和右眼下眼睑关键点的直线;所述左眼下眼睑关键点和所述右眼下眼睑关键点均属于所述至少一个人脸关键点。In combination with any embodiment of the present application, the determining the skin pixel point area from the pixel point area contained in the first human face frame includes: when it is detected that the face area in the image to be processed is not wearing a mask , using the pixel point area in the face area except the forehead area, mouth area, eyebrow area and eye area as the skin pixel point area; Under normal circumstances, the pixel point area between the first straight line and the fourth straight line is used as the skin pixel point area; the fourth straight line is a straight line passing through the key point of the lower eyelid of the left eye and the key point of the lower eyelid of the right eye; Both the key points of the lower eyelid of the left eye and the key points of the lower eyelid of the right eye belong to the at least one human face key point.
结合本申请任一实施方式,所述获取所述皮肤像素点区域中第二像素点的颜色值,包括:在所述至少一个人脸关键点包含属于左眉内侧区域中的至少一个第一关键点,且所述至少一个人脸关键点包含属于右眉内侧区域中的至少一个第二关键点的情况下,根据所述至少一个第一关键点和所述至少一个第二关键点确定矩形区域;对所述矩形区域进行灰度化处理,得到所述矩形区域的灰度图;将第一行和第一列的交点的颜色值作为所述第二像素点的颜色值;所述第一行为所述灰度图中灰度值之和最大的行,所述第一列为所述灰度图中灰度值之和最大的列。In combination with any embodiment of the present application, the acquiring the color value of the second pixel in the skin pixel area includes: including at least one first key belonging to the inner left eyebrow area in the at least one human face key point point, and the at least one face key point contains at least one second key point belonging to the inner area of the right eyebrow, determine the rectangular area according to the at least one first key point and the at least one second key point ; Perform grayscale processing on the rectangular area to obtain a grayscale image of the rectangular area; use the color value of the intersection point of the first row and the first column as the color value of the second pixel point; the first The line is the row with the largest sum of grayscale values in the grayscale image, and the first column is the column with the largest sum of grayscale values in the grayscale image.
结合本申请任一实施方式,所述依据所述第一数量与所述待测区域内像素点的数量的第一比值和所述第一阈值,得到所述待处理图像的皮肤遮挡检测结果,包括:在所述第一比值未超过所述第一阈值的情况下,确定所述皮肤遮挡检测结果为所述待测区域对应的皮肤区域处于遮挡状态;在所述第一比值超过所述第一阈值的情况下,确定所述皮肤遮挡检测结果为所述待测区域对应的皮肤区域处于未遮挡状态。In combination with any embodiment of the present application, the skin occlusion detection result of the image to be processed is obtained according to the first ratio of the first number to the number of pixels in the region to be detected and the first threshold, The method includes: when the first ratio does not exceed the first threshold, determining that the skin occlusion detection result indicates that the skin area corresponding to the region to be detected is in an occlusion state; when the first ratio exceeds the first threshold, In the case of a threshold value, it is determined that the skin occlusion detection result indicates that the skin area corresponding to the area to be detected is in an unoccluded state.
结合本申请任一实施方式,所述皮肤区域属于待检测人物,所述方法还包括:获取所述待处理图像的温度热力图;在所述皮肤遮挡检测结果为所述皮肤区域处于未遮挡状态的情况下,从所述温度热力图中读取所述皮肤区域的温度,作为所述待检测人物的体温。In combination with any embodiment of the present application, the skin area belongs to the person to be detected, and the method further includes: acquiring a temperature thermodynamic map of the image to be processed; In the case of , the temperature of the skin area is read from the temperature thermodynamic map as the body temperature of the person to be detected.
在一些实施例中,本申请还提供了一种图像处理的装置,所述装置包括:获取单元,用于获取待处理图像、第一阈值、第二阈值和第三阈值,所述第一阈值和所述第二阈值不同,所述第一阈值和所述第三阈值不同,所述第二阈值小于等于所述第三阈值;第一处理单元,用于确定所述待处理图像的待测区域中第一像素点的第一数量;所述第一像素点为颜色值大于等于所述第二阈值且小于等于所述第三阈值的像素点;检测单元,用于依据所述第一数量与所述待测区域内像素点的数量的第一比值和所述第一阈值,得到所述待处理图像的皮肤遮挡检测结果。In some embodiments, the present application also provides an image processing device, which includes: an acquisition unit, configured to acquire an image to be processed, a first threshold, a second threshold, and a third threshold, the first threshold Different from the second threshold, the first threshold is different from the third threshold, the second threshold is less than or equal to the third threshold; a first processing unit, configured to determine the image to be processed The first quantity of the first pixel in the area; the first pixel is a pixel whose color value is greater than or equal to the second threshold and less than or equal to the third threshold; the detection unit is configured to use the first quantity The skin occlusion detection result of the image to be processed is obtained by the first ratio with the number of pixels in the region to be detected and the first threshold.
结合本申请任一实施方式,所述待测区域包括人脸区域,所述皮肤遮挡检测结果包括人脸遮挡检测结果;所述图像处理装置还包括:第二处理单元,用于在所述确定所述待处理图像的待测区域中第一像素点的第一数量之前,对所述待处理图像进行人脸检测处理,得到第一人脸框;依据所述第一人脸框,从所述待处理图像中确定所述人脸区域。In combination with any embodiment of the present application, the area to be tested includes a human face area, and the skin occlusion detection result includes a human face occlusion detection result; the image processing device further includes: a second processing unit, configured to determine Before the first number of first pixels in the area to be detected of the image to be processed, perform face detection processing on the image to be processed to obtain a first face frame; according to the first face frame, from the Determine the face area in the image to be processed.
结合本申请任一实施方式,所述人脸区域包括额头区域,所述人脸遮挡检测结果包括额头遮挡检测结果,所述第一人脸框包括:上框线和下框线;所述上框线和所述下框线均为所述第一人脸框中平行于所述待处理图像的像素坐标系的横轴的边,且所述上框 线的纵坐标小于所述下框线的纵坐标;所述第二处理单元用于:对所述待处理图像进行人脸关键点检测,得到至少一个人脸关键点;所述至少一个人脸关键点包括左眉毛关键点和右眉毛关键点;在保持所述上框线的纵坐标不变的情况下,将所述下框线沿所述待处理图像的像素坐标系的纵轴的负方向移动,使得所述下框线所在直线与第一直线重合,得到第二人脸框;所述第一直线为过所述左眉毛关键点和所述右眉毛关键点的直线;依据所述第二人脸框包含的区域,得到所述额头区域。In combination with any embodiment of the present application, the face area includes a forehead area, the face occlusion detection result includes a forehead occlusion detection result, and the first face frame includes: an upper frame line and a lower frame line; Both the frame line and the lower frame line are sides parallel to the horizontal axis of the pixel coordinate system of the image to be processed in the first face frame, and the ordinate of the upper frame line is smaller than the lower frame line The ordinate; the second processing unit is used to: perform face key point detection on the image to be processed to obtain at least one face key point; the at least one face key point includes a left eyebrow key point and a right eyebrow Key point: under the condition of keeping the ordinate of the upper frame line unchanged, move the lower frame line along the negative direction of the vertical axis of the pixel coordinate system of the image to be processed, so that the lower frame line is located The straight line coincides with the first straight line to obtain a second human face frame; the first straight line is a straight line passing through the left eyebrow key point and the right eyebrow key point; according to the area included in the second human face frame , to get the forehead area.
结合本申请任一实施方式,所述第二处理单元用于:在保持所述第二人脸框的下框线的纵坐标不变的情况下,将所述第二人脸框的上框线沿所述待处理图像的像素坐标系的纵轴移动,使得所述第二人脸框的上框线和所述第二人脸框的下框线的距离为预设距离,得到第三人脸框;依据所述第三人脸框包含的区域,得到所述额头区域。In combination with any embodiment of the present application, the second processing unit is configured to: keep the ordinate of the lower frame line of the second face frame unchanged, and convert the upper frame of the second face frame to The line moves along the vertical axis of the pixel coordinate system of the image to be processed, so that the distance between the upper frame line of the second human face frame and the lower frame line of the second human face frame is a preset distance, and the third A face frame: obtain the forehead area according to the area included in the third face frame.
结合本申请任一实施方式,所述至少一个人脸关键点还包括左嘴角关键点和右嘴角关键点;所述第一人脸框还包括:左框线和右框线;所述左框线和所述右框线均为所述第一人脸框中平行于所述待处理图像的像素坐标系的纵轴的边,且所述左框线的横坐标小于所述右框线的横坐标;所述第二处理单元用于:在保持所述第三人脸框的左框线的横坐标不变的情况下,将所述第三人脸框的右框线沿所述待处理图像的像素坐标系的横轴移动,使得所述第三人脸框的右框线和所述第三人脸框的左框线的距离为参考距离,得到第四人脸框;所述参考距离为第二直线与所述第三人脸框包含的人脸轮廓的两个交点之间的距离;所述第二直线为在所述第一直线和第三直线之间且平行于所述第一直线或所述第三直线的直线;所述第三直线为过所述左嘴角关键点和所述右嘴角关键点的直线;将所述第四人脸框包含的区域作为所述额头区域。In combination with any embodiment of the present application, the at least one human face key point also includes a left mouth corner key point and a right mouth corner key point; the first human face frame further includes: a left frame line and a right frame line; the left frame line and the right frame line are both sides parallel to the vertical axis of the pixel coordinate system of the image to be processed in the first face frame, and the abscissa of the left frame line is smaller than that of the right frame line abscissa; the second processing unit is configured to: keep the abscissa of the left frame line of the third face frame unchanged, and place the right frame line of the third face frame along the Process the horizontal axis of the pixel coordinate system of the image to move, so that the distance between the right frame line of the third human face frame and the left frame line of the third human face frame is a reference distance, and obtain the fourth human face frame; The reference distance is the distance between the second straight line and the two intersection points of the human face contour contained in the third human face frame; the second straight line is between the first straight line and the third straight line and parallel to The straight line of the first straight line or the third straight line; the third straight line is a straight line passing through the key point of the left corner of the mouth and the key point of the right corner of the mouth; the region included in the fourth human face frame is used as the forehead area.
结合本申请任一实施方式,所述图像装置还包括:确定单元,用于在所述确定所述待处理图像的待测区域中第一像素点的第一数量之前,从所述第一人脸框包含的像素点区域中确定皮肤像素点区域;所述获取单元,还用于获取所述皮肤像素点区域中第二像素点的颜色值;所述第一处理单元,还用于将所述第二像素点的颜色值与第一值的差作为所述第二阈值,将所述第二像素点的颜色值与第二值的和作为所述第三阈值;所述第一值和所述第二值均不超过所述待处理图像的颜色值中的最大值。In combination with any of the embodiments of the present application, the image device further includes: a determining unit, configured to, before determining the first number of first pixels in the region to be detected of the image to be processed, from the first person Determining the skin pixel point area in the pixel point area included in the face frame; the acquisition unit is also used to acquire the color value of the second pixel point in the skin pixel point area; the first processing unit is also used to convert the The difference between the color value of the second pixel point and the first value is used as the second threshold, and the sum of the color value of the second pixel point and the second value is used as the third threshold; the first value and None of the second values exceeds the maximum value among the color values of the image to be processed.
结合本申请任一实施方式,所述图像处理装置还包括:第三处理单元,用于在所述从所述第一人脸框包含的像素点区域中确定皮肤像素点区域之前,对所述待处理图像进行口罩佩戴检测处理,得到检测结果;所述确定单元用于:在检测到所述待处理图像中人脸区域未佩戴口罩的情况下,将所述人脸区域中除所述额头区域、嘴巴区域、眉毛区域和眼睛区域之外的像素点区域,作为所述皮肤像素点区域;在检测到所述待处理图像中人脸区域佩戴口罩的情况下,将所述第一直线和第四直线之间的像素点区域作为所述皮肤像素点区域。其中,所述第四直线为过左眼下眼睑关键点和右眼下眼睑关键点的直线;所述左眼下眼睑关键点和所述右眼下眼睑关键点均属于所述至少一个人脸关键点。In combination with any embodiment of the present application, the image processing device further includes: a third processing unit, configured to, before determining the skin pixel area from the pixel area included in the first human face frame, process the The image to be processed is subjected to mask wearing detection processing to obtain the detection result; the determination unit is used to: when it is detected that the face area in the image to be processed is not wearing a mask, remove the forehead from the face area area, mouth area, eyebrow area and pixel area outside the eye area, as the skin pixel area; when it is detected that the face area in the image to be processed is wearing a mask, the first straight line The pixel point area between and the fourth straight line is used as the skin pixel point area. Wherein, the fourth straight line is a straight line passing through the key points of the lower eyelid of the left eye and the key point of the lower eyelid of the right eye; both the key points of the lower eyelid of the left eye and the key points of the lower eyelid of the right eye belong to the at least one human face key point.
结合本申请任一实施方式,所述获取单元用于:在所述至少一个人脸关键点包含属于左眉内侧区域中的至少一个第一关键点,且包含属于右眉内侧区域中的至少一个第二关键点的情况下,根据所述至少一个第一关键点和所述至少一个第二关键点确定矩形区域;对所述矩形区域进行灰度化处理,得到矩形区域的灰度图;将矩形区域的灰度图中第一行和第一列的交点的颜色值作为所述第二像素点的颜色值;所述第一行为所述灰度图中灰度值之和最大的行,所述第一列为所述灰度图中灰度值之和最大的列。In combination with any embodiment of the present application, the acquisition unit is configured to: include at least one first key point belonging to the inner area of the left eyebrow in the at least one key point of the human face, and include at least one key point belonging to the inner area of the right eyebrow In the case of the second key point, a rectangular area is determined according to the at least one first key point and the at least one second key point; grayscale processing is performed on the rectangular area to obtain a grayscale image of the rectangular area; The color value of the intersection point of the first row and the first column in the grayscale image of the rectangular area is used as the color value of the second pixel point; the first row is the row with the largest sum of grayscale values in the grayscale image, The first column is the column with the largest sum of gray values in the gray scale image.
结合本申请任一实施方式,所述检测单元用于:在所述第一比值未超过所述第一阈值的情况下,确定所述皮肤遮挡检测结果为所述待测区域对应的皮肤区域处于遮挡状态;在所述第一比值超过所述第一阈值的情况下,确定所述皮肤遮挡检测结果为所述待测区域对应的皮肤区域处于未遮挡状态。In combination with any embodiment of the present application, the detection unit is configured to: if the first ratio does not exceed the first threshold, determine that the skin occlusion detection result indicates that the skin region corresponding to the region to be detected is in the Blocking state: when the first ratio exceeds the first threshold, determine that the skin blockage detection result is that the skin area corresponding to the region to be detected is in an unblocked state.
结合本申请任一实施方式,所述皮肤区域属于待检测人物,所述获取单元还用于:获取所述待处理图像的温度热力图;所述图像处理装置还包括:第四处理单元,用于在 所述皮肤遮挡检测结果为所述皮肤区域处于未遮挡状态的情况下,从所述温度热力图中读取所述皮肤区域的温度,作为所述待检测人物的体温。In combination with any embodiment of the present application, the skin area belongs to a person to be detected, and the acquiring unit is further configured to: acquire a temperature thermodynamic map of the image to be processed; the image processing device further includes: a fourth processing unit configured to If the skin occlusion detection result shows that the skin area is in an unoccluded state, read the temperature of the skin area from the temperature thermodynamic map as the body temperature of the person to be detected.
本申请还提供了一种处理器,所述处理器用于执行如上述第一方面及其任意一种可能实现的方式的方法。The present application also provides a processor, configured to execute the method in the above first aspect and any possible implementation manner thereof.
本申请还提供了一种电子设备,包括:处理器、发送装置、输入装置、输出装置和存储器,所述存储器用于存储计算机程序代码,所述计算机程序代码包括计算机指令,在所述处理器执行所述计算机指令的情况下,所述电子设备执行如上述第一方面及其任意一种可能实现的方式的方法。The present application also provides an electronic device, including: a processor, a sending device, an input device, an output device, and a memory, the memory is used to store computer program codes, the computer program codes include computer instructions, and the processor In the case of executing the computer instructions, the electronic device executes the method in the above first aspect and any possible implementation manner thereof.
本申请还提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,所述计算机程序包括程序指令,在所述程序指令被处理器执行的情况下,使所述处理器执行如上述第一方面及其任意一种可能实现的方式的方法。The present application also provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, the computer program includes program instructions, and when the program instructions are executed by a processor, the The processor executes the method in the above first aspect and any possible implementation manner thereof.
本申请还提供了一种计算机程序产品,所述计算机程序产品包括计算机程序或指令,在所述计算机程序或指令在计算机上运行的情况下,使得所述计算机执行上述第一方面及其任一种可能的实现方式的方法。The present application also provides a computer program product, the computer program product includes a computer program or an instruction, and when the computer program or instruction is run on a computer, it causes the computer to perform the above-mentioned first aspect and any one thereof. A possible method of implementation.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,而非限制本申请。It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
为了更清楚地说明本申请实施例或发明内容中的技术方案,下面将对本申请实施例或发明内容中所需要使用的附图进行说明。In order to more clearly illustrate the technical solutions in the embodiment of the present application or the summary of the invention, the following will describe the drawings that need to be used in the embodiment of the application or the summary of the invention.
此处的附图被并入说明书中并构成本说明书的一部分,这些附图示出了符合本申请的实施例,用于说明本申请的技术方案。The accompanying drawings here are incorporated into the specification and constitute a part of the specification. These drawings show embodiments consistent with the application and are used to illustrate the technical solution of the application.
图1为本申请实施例提供的一种像素坐标系的示意图;FIG. 1 is a schematic diagram of a pixel coordinate system provided by an embodiment of the present application;
图2为本申请实施例提供的一种图像处理方法的流程示意图;FIG. 2 is a schematic flow chart of an image processing method provided in an embodiment of the present application;
图3为本申请实施例提供的另一种图像处理方法的流程示意图;FIG. 3 is a schematic flow diagram of another image processing method provided in the embodiment of the present application;
图4为本申请实施例提供的一种人脸关键点示意图;Fig. 4 is a schematic diagram of key points of a human face provided by the embodiment of the present application;
图5为本申请实施例提供的一种图像处理装置的结构示意图;FIG. 5 is a schematic structural diagram of an image processing device provided in an embodiment of the present application;
图6为本申请实施例提供的一种图像处理装置的硬件结构示意图。FIG. 6 is a schematic diagram of a hardware structure of an image processing device provided by an embodiment of the present application.
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。所描述的实施例仅仅是本申请的一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都应属于本申请保护的范围。In order to enable those skilled in the art to better understand the solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the present application. The described embodiments are only some of the embodiments of the application, not all of them. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts shall fall within the scope of protection of this application.
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备不应被理解为限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其他步骤或单元。The terms "first", "second" and the like in the specification and claims of the present application and the above drawings are used to distinguish different objects, rather than to describe a specific order. Furthermore, the terms "include" and "have", as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, product, or device comprising a series of steps or units should not be understood as being limited to the listed steps or units, but may optionally also include steps or units not listed, or may Other steps or elements inherent to these processes, methods, products or devices are optionally also included.
在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该词语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员可以理解的是,本文所描述的任意实施例可以与其它实施例相结合。Reference herein to an "embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The occurrences of the term in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those skilled in the art can understand that any embodiment described herein can be combined with other embodiments.
在进行接下来的阐述之前,首先对本申请实施例中的像素坐标系进行定义。如图1所示,以图像的左上角为像素坐标系的原点o、平行于图像的行的方向为x轴的方向、平行于图像的列的方向为y轴的方向,构建像素坐标系xoy。在像素坐标系下,横坐标用于表示图像中的像素在图像中的列数,纵坐标用于表示图像中的像素在图像中的行数,横坐标和纵坐标的单位均可以是像素。例如,假设图1中的像素a的坐标为(30,25), 即像素a的横坐标为30个像素,像素a的纵坐标为25个像素,像素a为图像中第30列第25行的像素。Before proceeding to the following description, first define the pixel coordinate system in the embodiment of the present application. As shown in Figure 1, the pixel coordinate system xoy is constructed with the upper left corner of the image as the origin o of the pixel coordinate system, the direction parallel to the row of the image as the direction of the x-axis, and the direction parallel to the column of the image as the direction of the y-axis . In the pixel coordinate system, the abscissa is used to indicate the number of columns of the pixels in the image, and the ordinate is used to indicate the number of rows of the pixels in the image. The units of both the abscissa and the ordinate can be pixels. For example, suppose the coordinates of pixel a in Figure 1 are (30, 25), that is, the abscissa of pixel a is 30 pixels, the ordinate of pixel a is 25 pixels, and pixel a is the 25th row of the 30th column in the image of pixels.
为提高检测安全性,越来越多的场景应用了对皮肤进行非接触检测。而这类非接触检测的检测准确度很大程度上受皮肤遮挡状态的影响。如,若皮肤区域被遮挡的面积较大,对该皮肤区域进行非接触检测的检测结果的准确度可能较低。因此,如何检测皮肤遮挡状态具有非常重要的意义。例如,目前,非接触式测温在体温检测领域中运用广泛。非接触式测温工具具有测量速度快、超温语音报警等优点,适用于在人流量特别大的公共场合快速筛检人体体温。In order to improve the safety of detection, non-contact detection of skin is applied in more and more scenarios. The detection accuracy of this type of non-contact detection is largely affected by the state of skin occlusion. For example, if the covered area of the skin area is relatively large, the accuracy of the detection result of the non-contact detection on the skin area may be low. Therefore, how to detect the state of skin occlusion is of great significance. For example, at present, non-contact temperature measurement is widely used in the field of body temperature detection. The non-contact temperature measurement tool has the advantages of fast measurement speed and over-temperature voice alarm. It is suitable for rapid screening of human body temperature in public places with a particularly large flow of people.
热成像设备主要通过采集热红外波段的光,来探测物体发出的热辐射,最后建立热辐射与温度的准确对应关系,实现测温功能。热成像设备作为一种非接触式测温工具,可覆盖较大区域,在人流量大的检测场景下可提高通行速度,减少群体聚集时间。Thermal imaging equipment mainly detects the thermal radiation emitted by objects by collecting light in the thermal infrared band, and finally establishes an accurate correspondence between thermal radiation and temperature to realize the temperature measurement function. As a non-contact temperature measurement tool, thermal imaging equipment can cover a large area. It can increase the speed of traffic and reduce the gathering time of groups in detection scenarios with a large flow of people.
热成像设备主要是识别出行人的额头的位置,然后根据该额头区域测量体温。但在行人佩戴帽子或者有刘海的情况下,无法确定额头区域是否处于遮挡状态。此时,是否能确定额头的遮挡状态对体温检测的准确度具有非常大的影响。The thermal imaging device mainly recognizes the position of the forehead of the pedestrian, and then measures the body temperature according to the forehead area. However, in the case of pedestrians wearing hats or bangs, it is impossible to determine whether the forehead area is blocked. At this time, whether or not the covering state of the forehead can be determined has a great influence on the accuracy of body temperature detection.
基于此,本申请实施例提供了一种图像处理方法,以实现对例如待测温对象的皮肤遮挡检测。例如:在体温检测的实施例中,待测温对象可为人脸,或具体为人脸中的额头区域,或更具体为额头区域中的特定位置。为简化表述,在接下来的说明中,将待处理图像中与待测温对象对应的区域称为待测区域。换言之,待测温对象通常为与待处理图像中的待测区域对应的皮肤区域,且待测温对象的皮肤遮挡检测结果包括对应的皮肤区域是否被遮挡。Based on this, an embodiment of the present application provides an image processing method to realize skin occlusion detection of, for example, an object to be measured. For example: in the embodiment of body temperature detection, the object to be measured can be a human face, or specifically the forehead area of a human face, or more specifically a specific position in the forehead area. To simplify the expression, in the following description, the area corresponding to the object to be measured in the image to be processed is referred to as the area to be measured. In other words, the temperature-measuring object is usually a skin area corresponding to the to-be-measured area in the image to be processed, and the skin occlusion detection result of the temperature-measuring object includes whether the corresponding skin area is occluded.
本申请实施例的执行主体为图像处理装置,图像处理装置可以是以下中的一种:手机、计算机、服务器、平板电脑。The execution subject of the embodiment of the present application is an image processing device, and the image processing device may be one of the following: a mobile phone, a computer, a server, and a tablet computer.
下面结合本申请实施例中的附图对本申请实施例进行描述。Embodiments of the present application are described below with reference to the drawings in the embodiments of the present application.
请参阅图2,图2是本申请实施例提供的一种图像处理方法的流程示意图。Please refer to FIG. 2 . FIG. 2 is a schematic flowchart of an image processing method provided in an embodiment of the present application.
201、获取待处理图像、第一阈值、第二阈值和第三阈值,上述第一阈值和上述第二阈值不同,上述第一阈值和上述第三阈值不同,上述第二阈值小于等于上述第三阈值。201. Acquire an image to be processed, a first threshold, a second threshold, and a third threshold, the first threshold is different from the second threshold, the first threshold is different from the third threshold, and the second threshold is less than or equal to the third threshold threshold.
本申请实例中,待处理图像包括包含人脸的图像块和不包含人脸的图像块。第一阈值是根据具体实施情况预先设定的额头区域中皮肤像素点的数量和额头区域中像素点的数量的标准比值,是评价额头区域是否被遮挡的标准。In the example of this application, the image to be processed includes an image block containing a human face and an image block not containing a human face. The first threshold is a standard ratio between the number of skin pixels in the forehead area and the number of pixels in the forehead area preset according to specific implementation conditions, and is a criterion for evaluating whether the forehead area is blocked.
本申请实施例中的第一阈值与温度检测或者其他实施例的准确度有关。举例来说,假设对行人进行额头区域的测温操作,额头区域中露出的皮肤区域越多,那么测温的结果越准确。在额头区域露出的皮肤区域占60%以上的情况下,认为测温的结果是准确的。如果在体温检测场景下需要这种准确度的话,那么就可以把第一阈值设为60%。如果在温度检测场景下需要更高的准确度,则可以把第一阈值设定在60%以上。如果认为把第一阈值设定为60%的要求太高,实际上不需要过于准确的结果,那么可以设置第一阈值在60%以下。在这种情况下,相应的测温结果的准确度是要降低的。因此,第一阈值的设定需要在具体的实施中进行,本申请实施例中不做限定。The first threshold in this embodiment of the present application is related to the accuracy of temperature detection or other embodiments. For example, assuming that the temperature measurement operation is performed on the forehead area of pedestrians, the more exposed skin areas in the forehead area, the more accurate the temperature measurement result will be. In the case that the exposed skin area of the forehead area accounts for more than 60%, the result of the temperature measurement is considered to be accurate. If such accuracy is required in the temperature detection scenario, then the first threshold can be set to 60%. If higher accuracy is required in the temperature detection scenario, the first threshold can be set above 60%. If it is considered that the requirement of setting the first threshold to 60% is too high and an over-accurate result is actually not needed, then the first threshold can be set below 60%. In this case, the accuracy of the corresponding temperature measurement results will be reduced. Therefore, the setting of the first threshold needs to be performed in specific implementation, which is not limited in this embodiment of the present application.
在一种获取待处理图像的实现方式中,图像处理装置接收用户通过输入组件输入的待处理图像。上述输入组件包括:键盘、鼠标、触控屏、触控板和音视频输入器等。In an implementation manner of acquiring an image to be processed, the image processing apparatus receives an image to be processed input by a user through an input component. The above-mentioned input components include: a keyboard, a mouse, a touch screen, a touch panel, an audio and video input device, and the like.
在另一种获取待处理图像的实现方式中,图像处理装置接收数据终端发送的待处理图像。上述数据终端可以是以下任意一种:手机、计算机、平板电脑、服务器等。In another implementation manner of acquiring an image to be processed, the image processing device receives the image to be processed sent by the data terminal. The above-mentioned data terminal may be any of the following: mobile phone, computer, tablet computer, server, etc.
在又一种获取待处理图像的实现方式中,图像处理装置接收监控摄像头发送的待处理图像。可选的,该监控摄像头可能部署于人工智能(artificial intelligence,AI)红外成像仪、安检门这类非接触式测温产品上(这类产品主要放置在车站、机场、地铁、商店、超市、学校、公司大厅以及小区门口这些人流量密集的场景)。In yet another implementation manner of acquiring an image to be processed, the image processing device receives the image to be processed sent by the surveillance camera. Optionally, the monitoring camera may be deployed on non-contact temperature measurement products such as artificial intelligence (AI) infrared imagers and security gates (such products are mainly placed in stations, airports, subways, shops, supermarkets, Scenes with dense traffic such as schools, company halls, and community gates).
在又一种获取待处理图像的实现方式中,图像处理装置接收监控摄像头发送的视频 流,对视频流进行解码处理,将获得的图像作为待处理图像。可选的,该监控摄像头可能部署于AI红外成像仪、安检门这类非接触式测温产品上(这类产品主要放置在车站、机场、地铁、商店、超市、学校、公司大厅以及小区门口这些人流量密集的场景)。In yet another implementation manner of acquiring an image to be processed, the image processing device receives the video stream sent by the surveillance camera, decodes the video stream, and uses the obtained image as the image to be processed. Optionally, the surveillance camera may be deployed on non-contact temperature measurement products such as AI infrared imagers and security gates (such products are mainly placed at stations, airports, subways, shops, supermarkets, schools, company halls and community gates) These crowded scenes).
在又一种获取待处理图像的实现方式中,图像处理装置与摄像头相连,图像处理装置可从每个摄像头获取实时采集的数据帧,数据帧可以包含图像和/或视频的形式。In yet another implementation manner of acquiring images to be processed, the image processing device is connected to the cameras, and the image processing device can obtain real-time collected data frames from each camera, and the data frames may include images and/or videos.
需要理解的是,与图像处理装置连接的摄像头的数量并不是固定的,将摄像头的网络地址输入至图像处理装置,即可通过图像处理装置从摄像头获取采集的数据帧。It should be understood that the number of cameras connected to the image processing device is not fixed, and the collected data frames can be obtained from the cameras by inputting the network addresses of the cameras into the image processing device.
举例来说,A地方的人员想要利用本申请提供的技术方案,则只需将A地方的摄像头的网络地址输入至图像处理装置,即可通过图像处理装置获取A地方的摄像头采集的数据帧,并可对A地方的摄像头采集的数据帧进行后续处理,图像处理装置输出额头是否遮挡的检测结果。For example, if a person in place A wants to use the technical solution provided by this application, he only needs to input the network address of the camera in place A into the image processing device, and the data frame collected by the camera in place A can be obtained by the image processing device , and subsequent processing can be performed on the data frames collected by the camera at A, and the image processing device outputs the detection result of whether the forehead is blocked.
202、确定上述待处理图像的待测区域中第一像素点的第一数量,其中,上述第一像素点为颜色值大于等于第二阈值且小于等于第三阈值的像素点。202. Determine a first number of first pixels in the region to be detected of the image to be processed, wherein the first pixels are pixels whose color values are greater than or equal to a second threshold and less than or equal to a third threshold.
本申请实例中,颜色值为六角锥体模型((hue,saturation,value,HSV)的参数。这个模型中颜色值的三个参数分别是:色调(hue,H),饱和度(saturation,S),亮度(value,V)。也就是说,颜色值携带色度、饱和度和亮度三种信息。因本申请涉及皮肤检测,故需要检测待测区域的皮肤像素点的数量,也就是第一像素点的第一数量。In the example of this application, the color value is a parameter of the hexagonal pyramid model ((hue, saturation, value, HSV). The three parameters of the color value in this model are: hue (hue, H), saturation (saturation, S ), brightness (value, V). That is to say, the color value carries three kinds of information of chroma, saturation and brightness. Because this application involves skin detection, it is necessary to detect the number of skin pixels in the area to be tested, that is, the first The first number of pixels in a pixel.
具体的,图像处理装置将颜色值大于等于第二阈值且小于等于第三阈值的像素点视为皮肤像素点。即在本申请实施例中,第二阈值和第三阈值用于判断像素点是否为皮肤像素点。Specifically, the image processing device regards pixels whose color values are greater than or equal to the second threshold and less than or equal to the third threshold as skin pixels. That is, in the embodiment of the present application, the second threshold and the third threshold are used to determine whether the pixel is a skin pixel.
在确定第一像素点为颜色值大于等于第二阈值且小于等于第三阈值的像素点的实现方式中,当待测区域的像素点的颜色值的所有参数都大于等于第二阈值对应的参数且小于等于第三阈值对应的参数时,才能认为这个像素点是对应皮肤区域未被遮挡的皮肤像素点。举例说明,设第二阈值的H为26,S为43,V为46,第三阈值的H为34,S为255,V为255。那么,皮肤像素点的颜色值范围是H是26至34,S是43至255,V是46至255。当待测区域的某个像素点的颜色值分别为H为25,S为45,V为200时,因为H的值不在设定的H的26至34的范围内,那么认为这个像素点不是皮肤像素点。又比如说,当待测区域的某个像素点的颜色值分别为H为28,S为45,V为200时,因为H、S、V的值都在设定的范围内,那么认为这个像素点是皮肤像素点。也就是说,将待测区域从RGB通道转化为HSV通道,只有当待测区域的某个像素点的颜色值都在上述给出的第二阈值和第三阈值的范围内,才说明这个像素点是对应皮肤区域未被遮挡的皮肤像素点,即这个像素点是第一像素点。In the implementation of determining that the first pixel is a pixel whose color value is greater than or equal to the second threshold and less than or equal to the third threshold, when all parameters of the color value of the pixel in the area to be tested are greater than or equal to the parameters corresponding to the second threshold and is less than or equal to the parameter corresponding to the third threshold, the pixel can be considered as a skin pixel corresponding to an unoccluded skin area. For example, suppose the H of the second threshold is 26, the S is 43, and the V is 46; the H of the third threshold is 34, the S is 255, and the V is 255. Then, the color value range of the skin pixel is 26 to 34 for H, 43 to 255 for S, and 46 to 255 for V. When the color value of a certain pixel in the area to be tested is H is 25, S is 45, and V is 200, because the value of H is not within the range of 26 to 34 of the set H, then this pixel is considered not Skin pixels. For another example, when the color value of a certain pixel in the area to be tested is 28 for H, 45 for S, and 200 for V, because the values of H, S, and V are all within the set range, then it is considered that this Pixels are skin pixels. That is to say, the area to be tested is converted from the RGB channel to the HSV channel. Only when the color values of a certain pixel in the area to be tested are within the range of the second threshold and the third threshold given above, this pixel is indicated. A point is a skin pixel point corresponding to an unoccluded skin area, that is, this pixel point is the first pixel point.
图像处理装置在确定待测区域中的第一像素点后,进一步确定第一像素点的数量得到第一数量。After the image processing device determines the first pixel points in the region to be detected, it further determines the number of the first pixel points to obtain the first number.
203、依据上述第一数量与上述待测区域内像素点的数量的第一比值和上述第一阈值,得到上述待处理图像的皮肤遮挡检测结果。203. Obtain a skin occlusion detection result of the image to be processed according to a first ratio of the first number to the number of pixels in the region to be detected and the first threshold.
本申请实施例中,皮肤遮挡检测结果包括皮肤区域处于被遮挡状态或皮肤区域处于未被遮挡状态。In the embodiment of the present application, the skin occlusion detection result includes that the skin area is in an occluded state or that the skin area is in an unoccluded state.
本申请实施例中,第一数量和待测区域内像素点的数量的第一比值,表示待测区域中未被遮挡的皮肤像素点在待测区域内的占比(下文简称为占比)。若第一比值表示占比较小,说明待测区域对应的皮肤区域被遮挡,反之,若第一比值表示占比较大,说明待测区域对应的皮肤区域未被遮挡。In the embodiment of the present application, the first ratio between the first number and the number of pixels in the area to be tested represents the proportion of unoccluded skin pixels in the area to be tested (hereinafter referred to as proportion) . If the first ratio indicates that the proportion is small, it means that the skin area corresponding to the area to be tested is blocked; on the contrary, if the first ratio indicates that the proportion is large, it means that the skin area corresponding to the area to be tested is not blocked.
本申请实施例中,图像处理装置将第一阈值作为判断占比大小的依据,进而可依据占比大小确定皮肤区域是否被遮挡,从而得到皮肤遮挡检测结果。In the embodiment of the present application, the image processing device uses the first threshold as the basis for judging the proportion, and then can determine whether the skin area is blocked according to the proportion, so as to obtain the skin occlusion detection result.
在一种可能实现的方式中,占比未超过第一阈值,说明占比较小,进而确定皮肤区域处于被遮挡状态。占比超过第一阈值,说明占比较大,进而确定皮肤区域处于未被遮 挡状态。In a possible implementation manner, if the proportion does not exceed the first threshold, it means that the proportion is small, and then it is determined that the skin area is in a blocked state. If the proportion exceeds the first threshold, it means that the proportion is relatively large, and then it is determined that the skin area is in an unoccluded state.
本申请实施中,图像处理装置依据第一阈值,确定待处理图像的待测区域中皮肤像素点的数量,即第一数量。通过确定第一数量与上述待测区域内像素点的数量的第一比值,得到待测区域内皮肤像素点的占比,进而可依据该占比和第一阈值之间的大小关系,确定皮肤区域的遮挡状态,从而得到待处理图像的皮肤遮挡检测结果。In the implementation of the present application, the image processing device determines the number of skin pixels in the region to be detected in the image to be processed according to the first threshold, that is, the first number. By determining the first ratio of the first number to the number of pixels in the area to be tested, the proportion of skin pixels in the area to be tested is obtained, and then the skin pixel can be determined according to the relationship between the proportion and the first threshold. The occlusion state of the area, so as to obtain the skin occlusion detection result of the image to be processed.
作为一种可选的实施方式,皮肤区域包括人脸区域,皮肤遮挡检测结果包括人脸遮挡检测结果。在该种实施方式中,图像处理装置在确定待处理图像中的人脸区域内的皮肤像素点的数量的情况下,进一步确定人脸区域中皮肤像素点的占比,进而可依据该占比确定人脸区域是否被遮挡,得到人脸遮挡检测结果。具体的,在确定人脸区域被遮挡的情况下,确定人脸遮挡检测结果为人脸区域处于被遮挡的状态;在确定人脸区域未被遮挡的情况下,确定人脸遮挡检测结果为人脸区域未处于被遮挡的状态。As an optional implementation manner, the skin area includes a human face area, and the skin occlusion detection result includes a human face occlusion detection result. In this embodiment, the image processing device further determines the proportion of skin pixels in the face area after determining the number of skin pixels in the face area in the image to be processed, and then can use the proportion Determine whether the face area is occluded, and obtain the face occlusion detection result. Specifically, when it is determined that the human face area is blocked, it is determined that the human face occlusion detection result is the state that the human face area is blocked; when it is determined that the human face area is not blocked, it is determined that the human face occlusion detection result is the human face Not in a blocked state.
在该种实施方式中,在确定待处理图像的待测区域中第一像素点的第一数量之前,图像处理装置还执行以下步骤:In this embodiment, before determining the first number of first pixels in the region to be detected of the image to be processed, the image processing device further performs the following steps:
1、对上述待处理图像进行人脸检测处理,得到第一人脸框。1. Perform face detection processing on the image to be processed to obtain a first face frame.
本申请实施例中,人脸检测处理用于识别待处理图像中是否包含人物对象。In the embodiment of the present application, the face detection process is used to identify whether the image to be processed contains a human object.
对上述待处理图像进行人脸检测处理,得到第一人脸框的坐标(如图1的D所示)。第一人脸框的坐标可以是左上角坐标、左下角坐标、右下角坐标、右上角坐标。第一人脸框的坐标也可以是一对对角坐标,也就是左上角坐标和右下角坐标或者左下角坐标和右上角坐标。第一人脸框包含的区域是人脸的额头到下巴的区域。Face detection processing is performed on the image to be processed to obtain the coordinates of the first face frame (as shown in D in FIG. 1 ). The coordinates of the first face frame may be upper left corner coordinates, lower left corner coordinates, lower right corner coordinates, and upper right corner coordinates. The coordinates of the first face frame may also be a pair of diagonal coordinates, that is, the coordinates of the upper left corner and the lower right corner or the coordinates of the lower left corner and the upper right corner. The area contained in the first face frame is the area from the forehead to the chin of the face.
在一种可能的实现方式中,通过预先训练好的神经网络对待处理图像进行特征提取处理,获得特征数据,该预先训练好的神经网络根据特征数据中的特征识别待处理图像中是否包含人脸。通过对待处理图像进行特征提取处理,在特征提取的数据中确定待处理图像中包含人脸的情况下,确定上述待处理图像第一人脸框的位置,也就是实现对人脸的检测。对待处理图像进行人脸检测处理可通过卷积神经网络实现。In a possible implementation, feature extraction is performed on the image to be processed through a pre-trained neural network to obtain feature data, and the pre-trained neural network identifies whether the image to be processed contains a human face according to the features in the feature data . By performing feature extraction processing on the image to be processed, if it is determined that the image to be processed contains a human face in the feature extracted data, determine the position of the first human face frame of the image to be processed, that is, realize the detection of the human face. The face detection processing of the image to be processed can be realized through a convolutional neural network.
通过将多张带有标注信息的图像作为训练数据,对卷积神经网络进行训练,使训练后的卷积神经网络可完成对图像的人脸检测处理。训练数据中的图像的标注信息为人脸以及人脸的位置。在使用训练数据对卷积神经网络进行训练的过程中,卷积神经网络从图像中提取出图像的特征数据,并依据特征数据确定图像中是否有人脸,在图像中有人脸的情况下,依据图像的特征数据得到人脸的位置。以标注信息为监督信息监督卷积神经网络在训练过程中得到的结果,并更新卷积神经网络的参数,完成对卷积神经网络的训练。这样,可使用训练后的卷积神经网络对待处理图像进行处理,以得到待处理图像中的人脸的位置。By using multiple images with label information as training data, the convolutional neural network is trained, so that the trained convolutional neural network can complete the face detection processing of the image. The annotation information of the images in the training data is the face and the position of the face. In the process of using the training data to train the convolutional neural network, the convolutional neural network extracts the feature data of the image from the image, and determines whether there is a human face in the image according to the feature data. In the case of a human face in the image, according to The feature data of the image obtains the position of the face. Use the labeling information as the supervision information to supervise the results obtained by the convolutional neural network during the training process, and update the parameters of the convolutional neural network to complete the training of the convolutional neural network. In this way, the image to be processed can be processed by using the trained convolutional neural network to obtain the position of the face in the image to be processed.
在另一种可能的实现方式中,人脸检测处理可通过人脸检测算法实现,其中,人脸检测算法可以是以下中的至少一种:基于直方图粗分割和奇异值特征的人脸检测算法、基于二进小波变换的人脸检测、基于概率决策的神经网络方法(pdbnn)、隐马尔可夫模型方法(hidden markov model)等,本申请对实现人脸检测处理的人脸检测算法不做具体限定。In another possible implementation, the face detection process can be implemented by a face detection algorithm, wherein the face detection algorithm can be at least one of the following: face detection based on histogram rough segmentation and singular value features Algorithm, face detection based on binary wavelet transform, neural network method (pdbnn) based on probability decision-making, hidden markov model method (hidden markov model), etc., this application does not focus on the face detection algorithm for realizing face detection processing Be specific.
2、依据上述第一人脸框,从上述待处理图像中确定上述人脸区域。2. According to the first human face frame, determine the human face area from the image to be processed.
在一种可能的实现方式中,图像处理装置将第一人脸框所包围的区域作为人脸区域。In a possible implementation manner, the image processing apparatus uses the area surrounded by the first human face frame as the human face area.
作为一种可选的实施方式,第一人脸框包括上框线和下框线。或者,第一人脸框包括上框线、下框线、左框线和右框线;上框线和下框线均为上述第一人脸框中平行于待处理图像的像素坐标系的横轴的边,且上框线的纵坐标小于下框线的纵坐标;左框线和右框线均为第一人脸框中平行于待处理图像的像素坐标系的纵轴的边,且左框线的横坐标小于右框线的横坐标。As an optional implementation manner, the first human face frame includes an upper frame line and a lower frame line. Or, the first human face frame includes an upper frame line, a lower frame line, a left frame line and a right frame line; the upper frame line and the lower frame line are all parallel to the pixel coordinate system of the image to be processed in the first human face frame The side of the horizontal axis, and the ordinate of the upper frame line is less than the ordinate of the lower frame line; the left frame line and the right frame line are the sides parallel to the vertical axis of the pixel coordinate system of the image to be processed in the first face frame, And the abscissa of the left frame line is smaller than the abscissa of the right frame line.
在该种实施方式中,人脸区域包括额头区域,此时图像处理装置依据第一人脸框从待处理图像中确定人脸区域,即依据第一人脸框从待处理图像中确定额头区域。In this embodiment, the face area includes the forehead area. At this time, the image processing device determines the face area from the image to be processed according to the first face frame, that is, determines the forehead area from the image to be processed according to the first face frame. .
在一种确定额头区域的实现方式中,上框线和下框线的距离是第一人脸框包含的人脸的额头上边沿到下巴下边沿的距离,左框线和右框线的距离是第一人脸框包含的人脸的左耳内侧和右耳内侧的距离。一般来说,人脸的额头区域的宽度(即额头区域的上下边沿之间的距离)约占整个人脸的长度(即整个人脸的上下边沿之间的距离)的1/3,但是额头区域的宽度占人脸长度的比例是因人而异的。不过,每个人的额头区域的宽度占整个人脸的长度的比例均在30%到40%的范围内。在保持上框线的纵坐标不变的情况下,沿着待处理图像的像素坐标系的纵轴的负方向移动下框线,使得移动后的上框线和下框线的距离为上框线和下框线的初始距离的30%到40%,移动后的第一人脸框包含的区域为额头区域。在第一人脸框的坐标是一对对角坐标的时候,第一人脸框的左上角的坐标或者第一人脸框的右上角的坐标确定了额头区域的位置。因此,通过改变第一人脸框的大小和位置,可以使得第一人脸框内的区域为待处理图像中人脸的额头区域。In an implementation of determining the forehead area, the distance between the upper frame line and the lower frame line is the distance from the upper edge of the forehead to the lower edge of the chin of the face included in the first face frame, and the distance between the left frame line and the right frame line is the distance between the inner side of the left ear and the inner side of the right ear of the face contained in the first face frame. Generally speaking, the width of the forehead area of a face (that is, the distance between the upper and lower edges of the forehead area) accounts for about 1/3 of the length of the entire face (that is, the distance between the upper and lower edges of the entire face), but the forehead The ratio of the width of the region to the length of the face varies from person to person. However, the ratio of the width of the forehead area to the length of the entire human face is in the range of 30% to 40% for each person. In the case of keeping the vertical coordinate of the upper frame line unchanged, move the lower frame line along the negative direction of the vertical axis of the pixel coordinate system of the image to be processed, so that the distance between the moved upper frame line and the lower frame line is the upper frame 30% to 40% of the initial distance between the line and the lower frame line, the area included in the first face frame after the movement is the forehead area. When the coordinates of the first face frame are a pair of diagonal coordinates, the coordinates of the upper left corner of the first face frame or the coordinates of the upper right corner of the first face frame determine the position of the forehead area. Therefore, by changing the size and position of the first human face frame, the area within the first human face frame can be made to be the forehead area of the human face in the image to be processed.
在另一确定额头区域的实现方式中,图像处理装置通过执行以下步骤确定额头区域:In another implementation manner of determining the forehead area, the image processing device determines the forehead area by performing the following steps:
21、对上述待处理图像进行人脸关键点检测,得到至少一个人脸关键点;上述至少一个人脸关键点包括左眉毛关键点和右眉毛关键点。21. Perform face key point detection on the image to be processed to obtain at least one face key point; the at least one face key point includes a left eyebrow key point and a right eyebrow key point.
本申请实施例中,通过对上述待处理图像进行人脸关键点检测,得到至少一个人脸关键点,至少一个关键点包括左眉毛关键点和右眉毛关键点。In the embodiment of the present application, at least one key point of human face is obtained by performing human face key point detection on the image to be processed, and at least one key point includes a left eyebrow key point and a right eyebrow key point.
对待处理图像进行特征提取处理,获得特征数据,可以实现人脸关键点检测。其中,该特征提取处理可通过预先训练好的神经网络实现,也可通过特征提取模型实现,本申请对此不作限定。特征数据用于提取待处理图像中人脸的关键点信息。上述待处理图像为数字图像,通过对待处理图像进行特征提取处理得到特征数据可以理解为待处理图像的更深层次的语义信息。Feature extraction is performed on the image to be processed to obtain feature data, which can realize face key point detection. Wherein, the feature extraction process can be realized by a pre-trained neural network, or by a feature extraction model, which is not limited in this application. The feature data is used to extract the key point information of the face in the image to be processed. The above image to be processed is a digital image, and the feature data obtained by performing feature extraction on the image to be processed can be understood as deeper semantic information of the image to be processed.
在一种人脸关键点检测可能的实现方式中,建立训练用人脸图像集,标注需要检测的关键点位置。构建第一层深度神经网络并训练人脸区域估计模型,构建第二层深度神经网络,做人脸关键点初步检测;对内脸区域继续做局部区域划分,对每个局部区域分别构建第三层深度神经网络;对每个局部区域估计其旋转角度,按照估计的旋转角度做矫正,对每个局部区域的矫正数据集构建第四层深度神经网络。任给一张新的人脸图像,采用上述四层深度神经网络模型进行关键点检测,即可得到最终的人脸关键点检测结果。In a possible implementation of face key point detection, a face image set for training is established, and positions of key points to be detected are marked. Build the first layer of deep neural network and train the face area estimation model, build the second layer of deep neural network, and do preliminary detection of key points of the face; continue to divide the inner face area into local areas, and build the third layer for each local area Deep neural network: Estimate the rotation angle of each local area, correct it according to the estimated rotation angle, and construct a fourth-layer deep neural network for the correction data set of each local area. Given any new face image, the above four-layer deep neural network model is used for key point detection, and the final face key point detection result can be obtained.
又一种人脸关键点检测可能的实现方式中,通过将多张带有标注信息的图像作为训练数据,对卷积神经网络进行训练,使训练后的卷积神经网络可完成对图像的人脸关键点检测处理。训练数据中的图像的标注信息为人脸的关键点位置。在使用训练数据对卷积神经网络进行训练的过程中,卷积神经网络从图像中提取出图像的特征数据,并依据特征数据确定图像中人脸的关键点位置。以标注信息为监督信息监督卷积神经网络在训练过程中得到的结果,并更新卷积神经网络的参数,完成对卷积神经网络的训练。这样,可使用训练后的卷积神经网络对待处理图像进行处理,以得到待处理图像中的人脸的关键点位置。In yet another possible implementation of face key point detection, the convolutional neural network is trained by using multiple images with annotation information as training data, so that the trained convolutional neural network can complete the image recognition. Face keypoint detection processing. The annotation information of the image in the training data is the key point position of the face. In the process of using the training data to train the convolutional neural network, the convolutional neural network extracts the feature data of the image from the image, and determines the key point position of the face in the image according to the feature data. Use the labeling information as the supervision information to supervise the results obtained by the convolutional neural network during the training process, and update the parameters of the convolutional neural network to complete the training of the convolutional neural network. In this way, the image to be processed can be processed using the trained convolutional neural network to obtain key point positions of faces in the image to be processed.
又一种可能的实现方式中,通过至少两层卷积层对待处理图像逐层进行卷积处理,完成对待处理图像的特征提取处理。至少两层卷积层中的卷积层依次串联,即上一层卷一层的输出为下一层卷积层的输入,每层卷积层提取出的内容及语义信息均不一样,具体表现为,特征提取处理一步步地将待处理图像中人脸的特征抽象出来,同时也将逐步丢弃相对次要的特征数据,其中,相对次要的特征数据指除被检测人脸的特征数据之外的特征数据。因此,越到后面提取出的特征数据的尺寸越小,但内容及语义信息更浓缩。通过多层卷积层逐级对待处理图像进行卷积处理,可在获得待处理图像中的内容信息及语义信息的同时,将待处理图像的尺寸缩小,减小图像处理装置的数据处理量,提高图像处理装置的运算速度。In yet another possible implementation manner, at least two convolutional layers are used to perform convolution processing on the image to be processed layer by layer to complete the feature extraction process of the image to be processed. The convolutional layers in at least two convolutional layers are connected in sequence, that is, the output of the previous convolutional layer is the input of the next convolutional layer, and the content and semantic information extracted by each convolutional layer are different. Specifically The performance is that the feature extraction process abstracts the features of the face in the image to be processed step by step, and at the same time gradually discards the relatively minor feature data, wherein the relatively minor feature data refers to the feature data of the detected face other feature data. Therefore, the size of the feature data extracted later is smaller, but the content and semantic information are more concentrated. The image to be processed is convoluted step by step through the multi-layer convolution layer, which can reduce the size of the image to be processed while obtaining the content information and semantic information in the image to be processed, and reduce the data processing capacity of the image processing device. Improve the computing speed of the image processing device.
又一种人脸关键点检测可能的实现方式中,卷积处理的实现过程如下:通过使卷积核在待处理图像上滑动,并将待处理图像上与卷积核的中心像素对应的像素称为目标像 素。将待处理图像上的像素值与卷积核上对应的数值相乘,然后将所有相乘后的值相加得到卷积处理后的像素值。将卷积处理后的像素值作为目标像素的像素值。最终滑动处理完待处理图像,更新待处理图像中所有像素的像素值,完成对待处理图像的卷积处理,得到特征数据。在一种可能的实现方式中,通过提取出特征数据的神经网络对特征数据中的特征进行识别,可获得待处理图像中人脸的关键点信息。In another possible implementation of face key point detection, the implementation process of convolution processing is as follows: by sliding the convolution kernel on the image to be processed, and moving the pixel corresponding to the central pixel of the convolution kernel on the image to be processed called the target pixel. Multiply the pixel value on the image to be processed by the corresponding value on the convolution kernel, and then add all the multiplied values to obtain the pixel value after convolution. The pixel value after convolution processing is used as the pixel value of the target pixel. Finally, the image to be processed is slid and processed, the pixel values of all pixels in the image to be processed are updated, and the convolution processing of the image to be processed is completed to obtain feature data. In a possible implementation manner, the features in the feature data are identified by a neural network that extracts the feature data, so as to obtain the key point information of the face in the image to be processed.
又一种人脸关键点检测可能的实现方式中,采用人脸关键点检测算法实现人脸关键点检测,采用的人脸关键点检测算法可以是OpenFace、多任务级联卷积神经网络(multi-task cascaded convolutional networks,MTCNN)、调整卷积神经网络(tweaked convolutional neural networks,TCNN)、或任务约束深度卷积神经网络(tasks-constrained deep convolutional network,TCDCN)中的至少一种,本申请对人脸关键点检测算法不做限定。In another possible implementation of face key point detection, the face key point detection algorithm is adopted to realize the face key point detection, and the face key point detection algorithm adopted can be OpenFace, multi-task cascaded convolutional neural network (multi -at least one of task cascaded convolutional networks (MTCNN), adjusted convolutional neural networks (tweaked convolutional neural networks, TCNN), or task-constrained deep convolutional networks (tasks-constrained deep convolutional network, TCDCN), this application is for The face key point detection algorithm is not limited.
22、在保持上述第一人脸框的上框线的纵坐标不变的情况下,将上述第一人脸框的下框线沿上述待处理图像的像素坐标系的纵轴的负方向移动,使得上述第一人脸框的下框线所在直线与第一直线重合,得到第二人脸框。其中,第一直线为过上述左眉毛关键点和上述右眉毛关键点的直线。22. While keeping the ordinate of the upper frame line of the first face frame unchanged, move the lower frame line of the first face frame along the negative direction of the vertical axis of the pixel coordinate system of the image to be processed , so that the line where the lower frame line of the first face frame is located coincides with the first line to obtain the second face frame. Wherein, the first straight line is a straight line passing through the above-mentioned left eyebrow key point and the above-mentioned right eyebrow key point.
23、依据上述第二人脸框包含的区域,得到上述额头区域。23. Obtain the aforementioned forehead area according to the area included in the aforementioned second human face frame.
本申请实施例中,上述上框线和上述下框线的距离是上述第一人脸框包含的人脸的额头上边沿到下巴下边沿的距离,上述左框线和上述右框线的距离是上述第一人脸框包含的人脸的左耳内侧和右耳内侧的距离。第一直线是过上述左眉毛关键点和上述右眉毛关键点的直线。因为额头区域在第一人脸框包含的第一直线的上方,因此移动上述下框线至与第一直线重合,就可以使得移动后的第一人脸框包含的区域为额头区域。也就是在保持上述上框线的纵坐标不变的情况下,将上述下框线沿着上述待处理图像的像素坐标系的纵轴的负方向移动,使得移动后的上述下框线所在直线与上述第一直线重合,得到第二人脸框。第二人脸框包含的区域为额头区域。In the embodiment of the present application, the distance between the above-mentioned upper frame line and the above-mentioned lower frame line is the distance from the upper edge of the forehead to the lower edge of the chin of the face included in the first face frame, and the distance between the above-mentioned left frame line and the above-mentioned right frame line is the distance between the inside of the left ear and the inside of the right ear of the face included in the first face frame. The first straight line is a straight line passing through the above-mentioned left eyebrow key point and the above-mentioned right eyebrow key point. Because the forehead area is above the first straight line included in the first face frame, moving the lower frame line to coincide with the first straight line can make the area included in the moved first face frame the forehead area. That is, while keeping the ordinate of the above-mentioned upper frame line unchanged, move the above-mentioned lower frame line along the negative direction of the vertical axis of the pixel coordinate system of the image to be processed, so that the line where the above-mentioned lower frame line is located after the movement Coincident with the above-mentioned first straight line, the second face frame is obtained. The area contained in the second face frame is the forehead area.
作为一种可选的实施方式,图像处理装置在执行步骤23的过程中执行以下步骤:As an optional implementation manner, the image processing device performs the following steps during step 23:
24、在保持上述第二人脸框的下框线的纵坐标不变的情况下,将上述第二人脸框的上框线沿上述待处理图像的像素坐标系的纵轴移动,使得上述第二人脸框的上框线和上述第二人脸框的下框线的距离为预设距离,得到第三人脸框。24. While keeping the vertical coordinate of the lower frame line of the second human face frame unchanged, move the upper frame line of the second human face frame along the vertical axis of the pixel coordinate system of the image to be processed, so that the above The distance between the upper frame line of the second face frame and the lower frame line of the second face frame is a preset distance to obtain a third face frame.
25、依据上述第三人脸框包含的区域,得到额头区域。25. Obtain the forehead area according to the area included in the third face frame.
本申请实施例中,第二人脸框的左框线和第二人脸框的右框线的距离为第二人脸框包含的人脸的左耳内侧到右耳内侧的距离。第一人脸框的上框线和第一人脸框的下框线的距离为第一人脸框包含的人脸的额头上边沿到下巴下边沿的距离,一般来说额头区域的宽度大约占整个人脸的长度的1/3,但每个人的额头区域的宽度占人脸长度的比例不一样,不过,所有人的额头区域的宽度与人脸长度的比例均在30%到40%的范围内。因此,设置预设距离为第一人脸框的上框线和第一人脸框的下框线的距离的30%到40%。因此要让第二人脸框内的区域为额头区域,需要把第二人脸框的上框线和第二人脸框的下框线之间的距离缩小到上述第一人脸框的上框线和下框线之间的距离的30%到40%。在保持第二人脸框的下框线的纵坐标不变的情况下,将第二人脸框的上框线沿着上述待处理图像的像素坐标系的纵轴移动,使得上述第二人脸框的上框线和上述第二人脸框的下框线之间的距离为预设距离,得到第三人脸框。此时,第三人脸框包含的区域为额头区域。In the embodiment of the present application, the distance between the left frame line of the second face frame and the right frame line of the second face frame is the distance from the inside of the left ear to the inside of the right ear of the face included in the second face frame. The distance between the upper frame line of the first face frame and the lower frame line of the first face frame is the distance from the upper edge of the forehead to the lower edge of the chin of the face contained in the first face frame. Generally speaking, the width of the forehead area is the largest. It accounts for about 1/3 of the length of the entire face, but the ratio of the width of the forehead area to the length of the face is different for each person. However, the ratio of the width of the forehead area to the length of the face of all people is 30% to 40% %In the range. Therefore, the preset distance is set to be 30% to 40% of the distance between the upper frame line of the first human face frame and the lower frame line of the first human face frame. Therefore, to make the area inside the second face frame the forehead area, it is necessary to reduce the distance between the upper frame line of the second face frame and the lower frame line of the second face frame to the above-mentioned first face frame. 30% to 40% of the distance between the frame line and the bottom frame line. While keeping the ordinate of the lower frame line of the second face frame unchanged, move the upper frame line of the second face frame along the vertical axis of the pixel coordinate system of the image to be processed, so that the second person The distance between the upper frame line of the face frame and the lower frame line of the second face frame is a preset distance to obtain a third face frame. At this time, the area included in the third face frame is the forehead area.
作为一种可选的实施方式,图像处理装置在执行步骤25的过程中执行以下步骤:As an optional implementation manner, the image processing device performs the following steps during the execution of step 25:
26、在保持上述第三人脸框的左框线的横坐标不变的情况下,将上述第三人脸框的右框线沿上述待处理图像的像素坐标系的横轴移动,使得上述第三人脸框的右框线和上述第三人脸框的左框线之间的距离为参考距离,得到第四人脸框。其中,上述参考距离为第二直线与上述第三人脸框包含的人脸轮廓的两个交点之间的距离,上述第二直 线为在上述第一直线和第三直线之间且平行于上述第一直线或上述第三直线的直线,上述第三直线为过左嘴角关键点和右嘴角关键点的直线。26. While keeping the abscissa of the left frame of the third face frame unchanged, move the right frame of the third face frame along the abscissa of the pixel coordinate system of the image to be processed, so that the above The distance between the right frame line of the third face frame and the left frame line of the third face frame is a reference distance, and the fourth face frame is obtained. Wherein, the above-mentioned reference distance is the distance between the two intersection points of the second straight line and the human face contour included in the third human-face frame, and the above-mentioned second straight line is between the above-mentioned first straight line and the third straight line and parallel to The above-mentioned first straight line or the above-mentioned third straight line is a straight line passing through the key points of the left corner of the mouth and the key point of the right corner of the mouth.
27、将上述第四人脸框包含的区域作为上述额头区域。27. Use the region included in the fourth face frame as the forehead region.
本申请实施例中,上述至少一个人脸关键点还包括左嘴角关键点和右嘴角关键点。第三直线为过上述左嘴角关键点和右嘴角关键点的直线。第二直线在上述第一直线和第三直线之间,且第二直线平行于上述第一直线或者第三直线。将第二直线与上述第三人脸框包含的人脸图像的人脸轮廓的两个交点之间的距离作为参考距离。第二直线在第一直线和第三直线之间,也就是在眉毛区域和嘴巴区域的中间区域。因为眉毛区域和嘴巴区域的中间区域的人脸宽度是与额头区域的长度比较接近的,采用这部分区域的宽度来确定额头区域的长度是比较准确的。此时,额头区域的长度为人脸轮廓的宽度,也就是参考距离。在保持上述第三人脸框的左框线的横坐标不变的情况下,将上述第三人脸框的右框线沿着上述待处理图像的像素坐标系的横轴移动,使得上述第三人脸框的左框线和上述第三人脸框的右框线之间的距离为参考距离,得到第四人脸框。此时,第四人脸框包含的区域为额头区域。In the embodiment of the present application, the at least one human face key point further includes a left mouth corner key point and a right mouth corner key point. The third straight line is a straight line passing through the key points of the left corner of the mouth and the key point of the right corner of the mouth. The second straight line is between the first straight line and the third straight line, and the second straight line is parallel to the first straight line or the third straight line. The distance between the two intersection points of the second straight line and the face contour of the face image included in the third face frame is taken as the reference distance. The second straight line is between the first straight line and the third straight line, that is, in the middle area between the eyebrow area and the mouth area. Because the width of the human face in the middle area of the eyebrow area and the mouth area is relatively close to the length of the forehead area, it is more accurate to use the width of this part of the area to determine the length of the forehead area. At this time, the length of the forehead area is the width of the contour of the face, that is, the reference distance. While keeping the abscissa of the left frame line of the third face frame unchanged, move the right frame line of the third face frame along the abscissa of the pixel coordinate system of the image to be processed, so that the first The distance between the left frame line of the three face frames and the right frame line of the third face frame is a reference distance, and the fourth face frame is obtained. At this time, the area included in the fourth face frame is the forehead area.
又一种可能的实现方式中,在保持上述第三人脸框的右框线的横坐标不变的情况下,将上述第三人脸框的左框线沿着上述待处理图像的像素坐标系的横轴移动,使得移动后的上述第三人脸框的左框线和上述第三人脸框的右框线之间的距离为参考距离,移动后的上述第三人脸框包含的区域为额头区域。In yet another possible implementation, while keeping the abscissa of the right frame line of the third face frame unchanged, align the left frame line of the third face frame along the pixel coordinates of the image to be processed The horizontal axis of the system moves, so that the distance between the left frame line of the third human face frame after the movement and the right frame line of the third human face frame is the reference distance, and the third human face frame after the movement contains The area is the forehead area.
又一种可能的实现方式中,将上述第三人脸框的右框线沿着上述待处理图像的像素坐标系的横轴的负方向移动第三人脸框的左框线和右框线之间的距离与参考距离差值的一半的同时,将上述第三人脸框的左框线沿着上述待处理图像的像素坐标系的横轴的正方向移动第三人脸框的左框线和右框线之间的距离与参考距离差值的一半,使得移动后的上述第三人脸框的左框线和移动后的上述第三人脸框的右框线之间的距离为参考距离。此时,移动后的上述第三人脸框包含的区域为额头区域。In yet another possible implementation, the right frame line of the third face frame is moved along the negative direction of the horizontal axis of the pixel coordinate system of the image to be processed, and the left frame line and the right frame line of the third face frame are moved While the distance between them is half of the reference distance difference, move the left frame line of the third human face frame along the positive direction of the horizontal axis of the pixel coordinate system of the image to be processed to the left frame of the third human face frame The distance between the line and the right frame line is half of the difference between the reference distance, so that the distance between the left frame line of the above-mentioned third face frame after moving and the right frame line of the above-mentioned third face frame after moving is Reference distance. At this time, the region included in the moved third human face frame is the forehead region.
作为一种可选的实施方式,在确定待处理图像的待测区域中第一像素点的第一数量之前,图像处理装置还执行以下步骤:As an optional implementation manner, before determining the first number of first pixels in the region to be detected of the image to be processed, the image processing device further performs the following steps:
3、从上述第一人脸框包含的像素点区域中确定皮肤像素点区域。3. Determine the skin pixel area from the pixel area included in the first human face frame.
本申请实施例中,因为要找到皮肤区域中露出的皮肤的颜色基准,需要取皮肤像素点区域中的像素点的颜色值作为皮肤区域中露出的皮肤的颜色基准。因此,需要从上述第一人脸框包含的像素点区域中确定皮肤像素点区域。举例说明,如图1所示,皮肤像素点区域可以是第一人脸框包含的眼睛下方的脸颊区域,也可以是第一人脸框包含的鼻子下方区域和嘴巴上方区域的交集区域,还可以是第一人脸框包含的嘴巴下方区域。In the embodiment of the present application, to find the color reference of the exposed skin in the skin area, it is necessary to take the color value of the pixel in the skin pixel area as the color reference of the exposed skin in the skin area. Therefore, it is necessary to determine the skin pixel area from the pixel area included in the first human face frame. For example, as shown in Figure 1, the skin pixel point area can be the cheek area below the eyes included in the first human face frame, or the intersection area of the area below the nose and the area above the mouth included in the first human face frame, or It may be the region under the mouth contained in the first face frame.
作为一种可选的实施方式,在从上述人脸框包含的像素点区域中确定皮肤像素点区域之前,图像处理装置还执行以下步骤:As an optional implementation manner, before determining the skin pixel point area from the pixel point area contained in the above-mentioned face frame, the image processing device further performs the following steps:
31、对上述待处理图像进行口罩佩戴检测处理,得到检测结果。31. Perform mask wearing detection processing on the image to be processed to obtain a detection result.
本申请实施例中,对待处理图像进行口罩佩戴检测,得到检测结果包括:待处理图像中的人物已佩戴口罩或待处理图像中的人物未佩戴口罩。In the embodiment of the present application, the image to be processed is tested for wearing a mask, and the detection results obtained include: the person in the image to be processed has worn a mask or the person in the image to be processed has not worn a mask.
在一种可能实现的方式中,图像处理装置对待处理图像进行第一特征提取处理,得到第一特征数据,其中,第一特征数据携带待检测人物是否佩戴口罩的信息。图像处理装置依据口罩佩戴检测得到的第一特征数据,得到检测结果。In a possible implementation manner, the image processing device performs first feature extraction processing on the image to be processed to obtain first feature data, where the first feature data carries information about whether the person to be detected is wearing a mask. The image processing device obtains the detection result according to the first feature data obtained from the mask wearing detection.
可选的,第一特征提取处理可通过口罩检测网络实现。通过将至少一张带有标注信息的第一训练图像作为训练数据,对深度卷积神经网络进行训练可得到口罩检测网络。其中,标注信息包括第一训练图像中的人物是否佩戴口罩。Optionally, the first feature extraction process can be implemented through a mask detection network. By using at least one first training image with label information as training data, the mask detection network can be obtained by training the deep convolutional neural network. Wherein, the annotation information includes whether the person in the first training image is wearing a mask.
32、在检测结果为上述人脸区域未佩戴口罩的情况下,将人脸区域中除额头区域、嘴巴区域、眉毛区域和眼睛区域之外的像素点区域,作为上述皮肤像素点区域。其中,上述至少一个人脸关键点还包括左眼下眼睑关键点、右眼下眼睑关键点。32. When the detection result shows that the above-mentioned face area is not wearing a mask, use the pixel point area in the face area except the forehead area, mouth area, eyebrow area and eye area as the above-mentioned skin pixel point area. Wherein, the at least one human face key point also includes key points of the lower eyelid of the left eye and key points of the lower eyelid of the right eye.
在检测结果为上述人脸区域佩戴口罩的情况下,将人脸区域中上述第一直线和第四直线之间的像素点区域作为皮肤像素点区域。其中,第四直线为过左眼下眼睑关键点和右眼下眼睑关键点的直线;左眼下眼睑关键点和右眼下眼睑关键点均属于上述至少一个人脸关键点。If the detection result is that the face area wears a mask, the pixel point area between the first straight line and the fourth straight line in the face area is taken as the skin pixel point area. Wherein, the fourth straight line is a straight line passing through the key points of the lower eyelid of the left eye and the key point of the lower eyelid of the right eye; both the key points of the lower eyelid of the left eye and the key points of the lower eyelid of the right eye belong to at least one of the aforementioned key points of the human face.
本申请实施例中,在检测结果是人脸区域没有佩戴口罩的情况下,人脸区域的皮肤像素点区域为除了皮肤区域、嘴巴区域、眉毛区域以及眼睛区域以外的区域。因为人脸区域在眼睛区域和眉毛区域带有颜色值显示为黑色的像素点以及在嘴巴的区域带有颜色值显示为红色的像素点。因此,皮肤像素点区域不包括眼睛区域、嘴巴区域和眉毛区域。又因为在不确定皮肤区域是否处于戴帽子或者有刘海等的遮挡情况下,无法判断皮肤区域对应的皮肤像素点区域。因此,对待处理图像进行口罩佩戴检测处理确定上述人脸区域未佩戴口罩的情况下,皮肤像素点区域包括人脸区域中除皮肤区域、嘴巴区域、眉毛区域、眼睛区域之外的像素点区域。In the embodiment of the present application, when the detection result is that the face area is not wearing a mask, the skin pixel area of the face area is an area other than the skin area, mouth area, eyebrow area, and eye area. Because the face area has pixels whose color values are displayed as black in the eye area and eyebrow area, and pixels whose color value is displayed as red in the mouth area. Therefore, the skin pixel area does not include the eye area, mouth area and eyebrow area. And because it is not sure whether the skin area is covered by a hat or bangs, etc., it is impossible to determine the skin pixel area corresponding to the skin area. Therefore, when the mask wearing detection processing of the image to be processed determines that the above-mentioned face area is not wearing a mask, the skin pixel area includes the pixel area in the face area except the skin area, mouth area, eyebrow area, and eye area.
在检测结果是人脸区域佩戴口罩的情况下,人脸区域的鼻子以下大部分区域会被遮挡。所以,皮肤未被遮挡部分可以是眉心区域、眼皮区域、鼻根区域。人脸关键点检测可以得到左眼下眼睑关键点坐标、右眼下眼睑关键点坐标、左眉毛关键点坐标和右眉毛关键点坐标。第四直线是过左眼下眼睑关键点和右眼下眼睑关键点的直线,第一直线是过左眉毛关键点和右眉毛关键点的直线。眉心区域、眼皮区域、鼻根区域这三部分区域都在人脸区域内左眉毛和右眉毛确定的水平线与左眼下眼睑和右眼下眼睑确定的直线之间。因此,在上述检测结果为人脸区域佩戴口罩的情况下,将人脸区域中第一直线与第四直线之间的像素点区域作为上述皮肤像素点区域。In the case that the detection result is that the mask is worn in the face area, most of the area below the nose of the face area will be blocked. Therefore, the unoccluded part of the skin can be the eyebrow area, eyelid area, and nasion area. Face key point detection can obtain the key point coordinates of the lower eyelid of the left eye, the key point coordinates of the lower eyelid of the right eye, the key point coordinates of the left eyebrow, and the key point coordinates of the right eyebrow. The fourth straight line is the straight line passing through the key points of the lower eyelid of the left eye and the key point of the lower eyelid of the right eye, and the first straight line is the straight line passing through the key points of the left eyebrow and the right eyebrow. The three parts of the eyebrow area, the eyelid area and the nasion area are all between the horizontal line determined by the left eyebrow and the right eyebrow in the human face area and the straight line determined by the lower eyelid of the left eye and the lower eyelid of the right eye. Therefore, in the case that the detection result is that the face area wears a mask, the pixel point area between the first straight line and the fourth straight line in the human face area is taken as the skin pixel point area.
4、获取皮肤像素点区域中第二像素点的颜色值;4. Obtain the color value of the second pixel in the skin pixel area;
本申请实施例中,从皮肤像素点区域中获取第二像素点的颜色值,这里第二像素点的颜色值是作为衡量皮肤区域露出的皮肤颜色的基准。因此,第二像素点可以是皮肤像素点区域中的任意一点。In the embodiment of the present application, the color value of the second pixel point is obtained from the skin pixel point area, where the color value of the second pixel point is used as a benchmark for measuring the skin color exposed in the skin area. Therefore, the second pixel point may be any point in the skin pixel point area.
获取皮肤像素点区域中第二像素点的实现方式可以是:找到某个皮肤像素点区域的坐标平均值作为第二像素点;又或者找到一些关键点确定的直线的交点坐标处的像素点作为第二像素点;又或者是对一部分皮肤像素点区域的图像进行灰度化处理,将灰度值最大的像素点作为第二像素点。本申请实施例对获取第二像素点的方式不做限定。The implementation of obtaining the second pixel in the skin pixel area can be: find the coordinate average of a certain skin pixel area as the second pixel; or find the pixel at the intersection coordinates of the straight lines determined by some key points as The second pixel; or grayscale processing is performed on an image of a part of the skin pixel area, and the pixel with the largest grayscale value is used as the second pixel. The embodiment of the present application does not limit the manner of acquiring the second pixel.
一种可能的实现方式中,在右眉内侧区域和左眉内侧区域分别有两个关键点的情况下,设关键点为右眉内侧上方点、右眉内侧下方点、左眉内侧上方点、左眉内侧下方点。将右眉内侧上方点和左眉内侧下方点相连,左眉内侧上方点和右眉内侧下方点相连,获得两条相交的直线。通过这两条相交的直线可以获得唯一交点。如图所示,假设这四个关键点对应的编号分别为37、38、67、68。也就是将关键点37和68相连,关键点38和67相连,确定这两条直线后就可以得到一个交点。基于人脸框的位置,可以确定37、38、67、68这四个关键点的坐标,然后可以利用Opencv求解出交点的坐标。通过确定交点的坐标,就可以得到交点对应的像素点。将交点对应的像素点的RGB通道转换成HSV通道,就可以获取交点坐标对应的像素点的颜色值。交点坐标对应的像素点的颜色值就是第二像素点的颜色值。In a possible implementation, when there are two key points in the inner area of the right eyebrow and the inner area of the left eyebrow respectively, set the key points as the upper point on the inner side of the right eyebrow, the lower point on the inner side of the right eyebrow, the upper point on the inner side of the left eyebrow, Point below the inside of the left eyebrow. Connect the upper point on the inner side of the right eyebrow with the lower point on the inner side of the left eyebrow, connect the upper point on the inner side of the left eyebrow with the lower point on the inner side of the right eyebrow, and obtain two intersecting straight lines. The unique point of intersection can be obtained by these two intersecting straight lines. As shown in the figure, suppose the numbers corresponding to these four key points are 37, 38, 67, and 68 respectively. That is, the key points 37 and 68 are connected, and the key points 38 and 67 are connected. After determining these two straight lines, an intersection point can be obtained. Based on the position of the face frame, the coordinates of the four key points 37, 38, 67, and 68 can be determined, and then the coordinates of the intersection points can be solved by using Opencv. By determining the coordinates of the intersection point, the pixel point corresponding to the intersection point can be obtained. By converting the RGB channel of the pixel corresponding to the intersection point into an HSV channel, the color value of the pixel corresponding to the intersection coordinate can be obtained. The color value of the pixel corresponding to the intersection coordinate is the color value of the second pixel.
又一种可能的实现方式中,在右眉内侧区域和左眉内侧区域分别有两个关键点的情况下,设关键点为右眉内侧上方点、右眉内侧下方点、左眉内侧上方点、左眉内侧下方点。通过这4个关键点求一个矩形区域为眉心区域。如图所示,假设这四个关键点对应的编号分别为37、38、67、68,通过这四个关键点求一个矩形区域为眉心区域。获取关键点37、38、67、68的坐标分别定为(X1,Y1)、(X2,Y2)、(X3,Y3)、(X4,Y4)。取(X1,Y1),(X2,Y2)中Y坐标的最大值为Y5,取(X3,Y3)、(X4,Y4)中Y坐标的最小值为Y6,取(X1,Y1)、(X3,Y3)中X坐标的最大值为X5,取(X2,Y2)、(X4,Y4)中X坐标的最小值为X6,因此可以得到矩形区域。也就是截取的眉 心区域的4个坐标为(X6,Y6)、(X5,Y5)、(X5,Y6)、(X6,Y5)。基于人脸框的位置,可以确定37、38、67、68这四个关键点的坐标,就可以确定(X6,Y6)、(X5,Y5)、(X5,Y6)、(X6,Y5)这四个点的位置。将(X6,Y6)、(X5,Y5)相连,(X5,Y6)、(X6,Y5)相连,获得两条直线,通过这两个直线可以获得一个唯一交点。然后,可以利用Opencv求解出交点的坐标。通过确定交点的坐标,就可以得到交点对应的像素点。将交点对应的像素点的RGB通道转换成HSV通道,就可以获取交点坐标对应的像素点的颜色值。交点坐标对应的像素点的颜色值就是第二像素点的颜色值。In another possible implementation, when there are two key points in the inner area of the right eyebrow and the inner area of the left eyebrow respectively, set the key points as the upper point on the inner side of the right eyebrow, the lower point on the inner side of the right eyebrow, and the upper point on the inner side of the left eyebrow. , Point below the inside of the left eyebrow. Find a rectangular area through these 4 key points as the eyebrow area. As shown in the figure, assuming that the numbers corresponding to these four key points are 37, 38, 67, and 68 respectively, a rectangular area is calculated as the eyebrow area through these four key points. The obtained coordinates of the key points 37, 38, 67, 68 are defined as (X1, Y1), (X2, Y2), (X3, Y3), (X4, Y4) respectively. Take the maximum value of Y coordinates in (X1, Y1), (X2, Y2) as Y5, take the minimum value of Y coordinates in (X3, Y3), (X4, Y4) as Y6, take (X1, Y1), ( The maximum value of X coordinates in X3, Y3) is X5, and the minimum value of X coordinates in (X2, Y2), (X4, Y4) is X6, so a rectangular area can be obtained. That is to say, the four coordinates of the intercepted eyebrow area are (X6, Y6), (X5, Y5), (X5, Y6), (X6, Y5). Based on the position of the face frame, the coordinates of the four key points 37, 38, 67, and 68 can be determined, and (X6, Y6), (X5, Y5), (X5, Y6), (X6, Y5) can be determined The positions of these four points. Connect (X6, Y6) and (X5, Y5) and connect (X5, Y6) and (X6, Y5) to obtain two straight lines, and a unique intersection point can be obtained through these two straight lines. Then, Opencv can be used to solve the coordinates of the intersection point. By determining the coordinates of the intersection point, the pixel point corresponding to the intersection point can be obtained. By converting the RGB channel of the pixel corresponding to the intersection point into an HSV channel, the color value of the pixel corresponding to the intersection coordinate can be obtained. The color value of the pixel corresponding to the intersection coordinate is the color value of the second pixel.
作为一种可选的实施方式,图像处理装置在执行步骤4的过程中执行以下步骤:As an optional implementation manner, the image processing device performs the following steps during step 4:
41、在上述至少一个人脸关键点包含属于左眉内侧区域中的至少一个第一关键点,且包含属于右眉内侧区域中的至少一个第二关键点的情况下,根据上述至少一个第一关键点和上述至少一个第二关键点确定矩形区域。41. In the case where the above at least one face key point includes at least one first key point belonging to the inner area of the left eyebrow and at least one second key point belonging to the inner area of the right eyebrow, according to the above at least one first key point The key point and the at least one second key point define a rectangular area.
42、对上述矩形区域进行灰度化处理,得到矩形区域的灰度图。42. Perform grayscale processing on the above rectangular area to obtain a grayscale image of the rectangular area.
43、将矩形区域的灰度图中第一行和第一列的交点的颜色值作为上述第二像素点的颜色值,其中,第一行为上述灰度图中灰度值之和最大的行,第一列为上述灰度图中灰度值之和最大的列。43. Use the color value of the intersection of the first row and the first column in the grayscale image of the rectangular area as the color value of the second pixel, wherein the first row is the row with the largest sum of grayscale values in the grayscale image above , the first column is the column with the largest sum of gray values in the above grayscale image.
本申请实施例中,包含多种根据上述至少一个第一关键点和上述至少一个第二关键点,获取一个矩形区域的多种方案。对这个矩形区域进行灰度化处理,得到矩形区域的灰度图。计算灰度图的每一行的灰度值之和,记取得灰度值之和最大的行是第一行。同理,计算灰度图的每一列的灰度值之和,记取得灰度值之和最大的列是第一列。根据灰度值之和最大的行和最大的列,找到交点坐标。也就是第一行和第一列交点坐标。通过确定交点的坐标,就可以得到交点对应的像素点。将交点对应的像素点的RGB通道转换成HSV通道,就可以获取交点对应的像素点的颜色值。交点坐标对应的像素点的颜色值就是第二像素点的颜色值。In the embodiment of the present application, various schemes for obtaining a rectangular area according to the at least one first key point and the at least one second key point are included. Perform grayscale processing on this rectangular area to obtain a grayscale image of the rectangular area. Calculate the sum of the gray values of each row of the grayscale image, and remember that the row with the largest sum of gray values is the first row. In the same way, calculate the sum of the gray values of each column of the grayscale image, and remember that the column with the largest sum of gray values is the first column. Find the intersection coordinates according to the row and column with the largest sum of gray values. That is, the intersection coordinates of the first row and the first column. By determining the coordinates of the intersection point, the pixel point corresponding to the intersection point can be obtained. By converting the RGB channel of the pixel corresponding to the intersection to the HSV channel, the color value of the pixel corresponding to the intersection can be obtained. The color value of the pixel corresponding to the intersection coordinate is the color value of the second pixel.
一种获取矩形区域可能的实现方式中,在左眉内侧关键点和右眉内侧关键点各自只有一个且这两个关键点的纵坐标不一致的情况下,以这两个关键点纵坐标的差值作为矩形区域的宽度,以这两个关键点横坐标的差值作为矩形区域的长,确定出一个以这两个关键点为对角的矩形区域。In a possible implementation of obtaining a rectangular area, when there is only one key point on the inner side of the left eyebrow and one key point on the inner side of the right eyebrow and the vertical coordinates of these two key points are inconsistent, the difference between the vertical coordinates of these two key points The value is taken as the width of the rectangular area, and the difference between the abscissas of these two key points is taken as the length of the rectangular area to determine a rectangular area with these two key points as the diagonal.
又一种获取矩形区域的可能的实现方式中,在左眉内侧关键点有两个且右眉内侧关键点有一个的情况下,将左眉内侧的两个关键点的连线作为矩形区域的第一条边长,在左眉内侧的两个关键点中选取一个与右眉内侧关键点纵坐标不一致的关键点,将其与右眉内侧关键点的连线作为矩形区域的第二条边长。根据确定的第一条边长和第二条边长分别作平行线,可以得到矩形区域剩下的两条边长,从而确定出矩形区域。In yet another possible implementation of obtaining a rectangular area, in the case that there are two key points inside the left eyebrow and one key point inside the right eyebrow, the line connecting the two key points inside the left eyebrow is used as the key point of the rectangular area The length of the first side, select one of the two key points on the inner side of the left eyebrow that is inconsistent with the ordinate of the key point on the inner side of the right eyebrow, and use the line connecting it with the key point on the inner side of the right eyebrow as the second side of the rectangular area long. Draw parallel lines according to the determined first side length and second side length respectively, and obtain the remaining two side lengths of the rectangular area, thereby determining the rectangular area.
又一种获取矩形区域的可能实现方式中,在左眉内侧区域关键点和右眉内侧区域关键点分别有两个以上的情况下,可以选择其中的四个关键点组成一个四边形区域。然后再根据这四个关键点的坐标得到矩形区域。In yet another possible implementation of acquiring a rectangular area, when there are more than two key points in the inner area of the left eyebrow and more than two key points in the inner area of the right eyebrow, four of the key points can be selected to form a quadrilateral area. Then get the rectangular area according to the coordinates of these four key points.
又一种获取矩形区域的可能的实现方式中,至少一个第一关键点包括第三关键点和第四关键点;至少一个第二关键点包括第五关键点和第六关键点;第三关键点纵坐标小于第四关键点;第五关键点纵坐标小于第六关键点;第一横坐标和第一纵坐标确定第一坐标;第二横坐标和第一纵坐标确定第二坐标;第一横坐标和第二纵坐标确定第三坐标;第二横坐标和第二纵坐标确定第四坐标;第一纵坐标为第三关键点和第五关键点的纵坐标的最大值;第二纵坐标为第四关键点和第六关键点的纵坐标的最小值;第一横坐标为第三关键点和第四关键点的横坐标的最大值;第二横坐标为第五关键点和第六关键点的横坐标的最小值;第一坐标、第二坐标、第三坐标和第四坐标围成的区域作为矩形区域。举例说明,在左眉内侧区域关键点和右眉内侧区域关键点分别有两个的情况下,设这四个关键点分别为第三关键点(X1,Y1)、第五关键点(X2,Y2)、第四关键点(X3,Y3)、第六关键点(X4,Y4)。取(X1,Y1),(X2,Y2)中Y坐标的最大值为Y5,作 为第一纵坐标;取(X3,Y3)、(X4,Y4)中Y坐标的最小值为Y6,作为第二纵坐标;取(X1,Y1)、(X3,Y3)中X坐标的最大值为X5,作为第一横坐标;取(X2,Y2)、(X4,Y4)中X坐标的最小值为X6,作为第二横坐标。因此可以得到矩形区域的4个坐标为第一坐标(X5,Y5)、第二坐标(X6,Y5)、第三坐标(X5,Y6)、第四坐标(X6,Y6)。In yet another possible implementation of acquiring a rectangular area, at least one first key point includes a third key point and a fourth key point; at least one second key point includes a fifth key point and a sixth key point; the third key point The ordinate of the point is smaller than the fourth key point; the ordinate of the fifth key point is smaller than the sixth key point; the first abscissa and the first ordinate determine the first coordinate; the second abscissa and the first ordinate determine the second coordinate; An abscissa and the second ordinate determine the third coordinate; the second abscissa and the second ordinate determine the fourth coordinate; the first ordinate is the maximum value of the ordinate of the third key point and the fifth key point; the second The ordinate is the minimum value of the ordinate of the fourth key point and the sixth key point; the first abscissa is the maximum value of the abscissa of the third key point and the fourth key point; the second abscissa is the fifth key point and The minimum value of the abscissa of the sixth key point; the area enclosed by the first coordinate, the second coordinate, the third coordinate and the fourth coordinate is regarded as a rectangular area. For example, in the case where there are two key points in the inner area of the left eyebrow and two key points in the inner area of the right eyebrow, set these four key points as the third key point (X1, Y1), the fifth key point (X2, Y2), the fourth key point (X3, Y3), the sixth key point (X4, Y4). Take the maximum value of the Y coordinates in (X1, Y1), (X2, Y2) as Y5, as the first ordinate; take the minimum value of the Y coordinates in (X3, Y3), (X4, Y4) as Y6, as the first ordinate Two vertical coordinates; take the maximum value of the X coordinate in (X1, Y1), (X3, Y3) as X5, as the first horizontal coordinate; take the minimum value of the X coordinate in (X2, Y2), (X4, Y4) X6, as the second abscissa. Therefore, the four coordinates of the rectangular area can be obtained as the first coordinate (X5, Y5), the second coordinate (X6, Y5), the third coordinate (X5, Y6), and the fourth coordinate (X6, Y6).
作为另一种可选的实施方式,图像处理装置在执行步骤4的过程中执行以下步骤:As another optional implementation manner, the image processing device performs the following steps during step 4:
44、在上述至少一个人脸关键点包含属于左眉内侧区域中的至少一个第一关键点,且上述至少一个人脸关键点包含属于右眉内侧区域中的至少一个第二关键点的情况下,确定至少一个第一关键点和至少一个第二关键点的平均值坐标。44. In the case where the at least one face key point includes at least one first key point belonging to the inner area of the left eyebrow, and the at least one face key point includes at least one second key point belonging to the inner area of the right eyebrow , determine the average coordinates of at least one first key point and at least one second key point.
45、将依据平均值坐标确定的像素点的颜色值作为上述皮肤像素点区域中第二像素点的颜色值。45. Use the color value of the pixel point determined according to the average value coordinates as the color value of the second pixel point in the skin pixel point area.
本申请实施例中,在上述至少一个人脸关键点包含属于右眉内侧区域中的至少一个第二关键点,且上述至少一个人脸关键点包含属于左眉内侧区域中的至少一个第一关键点的情况下,对至少一个第一关键点和至少一个第二关键点的坐标求平均值。比如,在右眉内侧区域和左眉内侧区域的关键点坐标分别有两个的时候,设右眉内侧区域和左眉内侧区域的关键点为右眉内侧上方点、右眉内侧下方点、左眉内侧上方点、左眉内侧下方点四个点。如图4所示,假设这四个点对应的编号分别为37、38、67、68。获取37、38、67、68的坐标分别为(X1,Y1)、(X2,Y2)、(X3,Y3)、(X4,Y4),分别对这四个坐标的横坐标和纵坐标相加求平均值,得到平均值坐标为(X0,Y0)。将像素点的RGB通道转换成HSV通道,根据平均值坐标就可以获取平均值坐标为(X0,Y0)对应的像素点的颜色值。平均值坐标对应的像素点的颜色值就是第二像素点的颜色值。In the embodiment of the present application, the above-mentioned at least one human face key point includes at least one second key point belonging to the inner area of the right eyebrow, and the above-mentioned at least one human face key point includes at least one first key point belonging to the inner area of the left eyebrow In the case of points, the coordinates of at least one first keypoint and at least one second keypoint are averaged. For example, when there are two key point coordinates of the inner area of the right eyebrow and the inner area of the left eyebrow, the key points of the inner area of the right eyebrow and the inner area of the left eyebrow are set as the upper point of the inner right eyebrow, the lower point of the inner right eyebrow, and the lower point of the left inner eyebrow. Point on the upper inner side of the eyebrow and four points on the lower inner side of the left eyebrow. As shown in FIG. 4 , it is assumed that the numbers corresponding to these four points are 37, 38, 67, and 68 respectively. Get the coordinates of 37, 38, 67, and 68 as (X1, Y1), (X2, Y2), (X3, Y3), (X4, Y4), and add the abscissa and ordinate of these four coordinates respectively Calculate the average value to obtain the average value coordinates as (X0, Y0). The RGB channel of the pixel is converted into the HSV channel, and the color value of the pixel corresponding to the average coordinate (X0, Y0) can be obtained according to the average coordinate. The color value of the pixel point corresponding to the average value coordinate is the color value of the second pixel point.
作为又一种可选的实施方式,图像处理装置在执行步骤4的过程中执行以下步骤:As yet another optional implementation manner, the image processing device performs the following steps during step 4:
46、依据右眉内侧关键点和鼻根左侧关键点坐标确定第五直线;依据左眉内侧关键点和鼻根右侧关键点坐标确定第六直线。46. Determine the fifth straight line according to the coordinates of the key points inside the right eyebrow and the key points on the left side of the nasion; determine the sixth straight line according to the coordinates of the key points inside the left eyebrow and the key points on the right side of the nasion.
47、将依据第五直线和第六直线的交点坐标确定的像素点的颜色值,作为皮肤像素点区域中第二像素点的颜色值。47. Use the color value of the pixel determined according to the coordinates of the intersection of the fifth straight line and the sixth straight line as the color value of the second pixel in the skin pixel area.
本申请实施例中,上述至少一个人脸关键点还包括右眉内侧关键点、鼻根左侧关键点、鼻根右侧关键点和左眉内侧关键点。将右眉内侧关键点和鼻根左侧关键点相连,将左眉内侧关键点与鼻根右侧关键点相连,获得两条相交的直线分别为第五直线和第六直线。本申请对右眉内侧关键点和左眉内侧关键点不做限定,右眉内侧关键点是在右眉内侧区域取的任意一个关键点,左眉内侧关键点是在左眉内侧区域取的任意一个关键点。如图4所示,假设这四个关键点对应的编号分别为67、68、78、79时,也就是将关键点78和68相连,将关键点79和67相连,确定这两条直线后就可以得到一个交点。基于人脸框的位置,可以确定67、68、79、78这四个关键点的坐标,然后可以利用Opencv求解出交点的坐标。通过确定交点的坐标,就可以得到交点对应的像素点。将交点对应的像素点的RGB通道转换成HSV通道,就可以获取交点坐标对应的像素点的颜色值。交点坐标对应的像素点的颜色值就是第二像素点的颜色值。In the embodiment of the present application, the at least one facial key point further includes a key point inside the right eyebrow, a key point on the left side of the nasion, a key point on the right side of the nasion, and a key point inside the left eyebrow. Connect the key point inside the right eyebrow with the key point on the left side of the nasion, connect the key point inside the left eyebrow with the key point on the right side of the nasion, and obtain two intersecting straight lines as the fifth straight line and the sixth straight line. This application does not limit the key point inside the right eyebrow and the key point inside the left eyebrow. The key point inside the right eyebrow is any key point taken in the inner area of the right eyebrow, and the key point inside the left eyebrow is any key point taken in the area inside the left eyebrow. a key point. As shown in Figure 4, assuming that the numbers corresponding to these four key points are 67, 68, 78, and 79 respectively, that is, connecting key points 78 and 68, and connecting key points 79 and 67, after determining the two straight lines You can get a point of intersection. Based on the position of the face frame, the coordinates of the four key points 67, 68, 79, and 78 can be determined, and then the coordinates of the intersection points can be solved by using Opencv. By determining the coordinates of the intersection point, the pixel point corresponding to the intersection point can be obtained. By converting the RGB channel of the pixel corresponding to the intersection point into an HSV channel, the color value of the pixel corresponding to the intersection coordinate can be obtained. The color value of the pixel corresponding to the intersection coordinate is the color value of the second pixel.
5、将上述第二像素点的颜色值与第一值的差作为第二阈值,将第二像素点的颜色值与第二值的和作为第三阈值,其中,上述第一值和上述第二值均不超过待处理对象的颜色值中的最大值。5. The difference between the color value of the second pixel point and the first value is used as the second threshold, and the sum of the color value of the second pixel point and the second value is used as the third threshold, wherein the first value and the first value Neither value exceeds the maximum value among the color values of the object to be processed.
本申请实施例中,确定第二像素点的颜色值就能确定第二阈值和第三阈值。通过Opencv算法的函数可以把图像的表示形式从RGB通道图转换到HSV通道图,从而得到第二像素点的颜色值。In the embodiment of the present application, the second threshold and the third threshold can be determined by determining the color value of the second pixel. The function of the Opencv algorithm can convert the representation of the image from the RGB channel map to the HSV channel map, so as to obtain the color value of the second pixel.
颜色值包括色度、亮度、饱和度三个参数值。其中,色度的范围是0至180,亮 度和饱和度的范围均是0至255。也就是说颜色值的色度最大值是180,亮度和饱和度的最大值是255。需要理解的是,第一值和第二值也分别包括了色度、亮度、饱和度三个参数。因此,第一值的色度和第二值的色度均不超过180,第一值的亮度和第二值的亮度均不超过255,第一值的饱和度和第二值的饱和度均不超过255。一般来说,第一值和第二值的色度、亮度、饱和度三个参数值是一致的。也就是说第二像素点的颜色值的色度、亮度、饱和度三个参数值是第二阈值和第三阈值对应的色度、亮度、饱和度三个参数值的中间值。The color value includes three parameter values of chroma, brightness and saturation. Among them, the range of hue is 0 to 180, and the range of brightness and saturation are both 0 to 255. That is to say, the maximum value of chroma is 180, and the maximum value of brightness and saturation is 255. It should be understood that the first value and the second value also respectively include three parameters of hue, brightness and saturation. Therefore, neither the chroma of the first value nor the chroma of the second value exceeds 180, neither the brightness of the first value nor the brightness of the second value exceeds 255, and the saturation of the first value and the saturation of the second value both No more than 255. Generally speaking, the three parameter values of the first value and the second value of chroma, brightness, and saturation are consistent. That is to say, the three parameter values of chroma, brightness, and saturation of the color value of the second pixel point are intermediate values of the three parameter values of chroma, brightness, and saturation corresponding to the second threshold and the third threshold.
在一种获取第二像素点的颜色值和第二阈值以及第三阈值的映射关系的实现方式中,通过机器学习的二分类算法,例如Logistic回归、朴素贝叶斯算法,根据输入某个颜色的颜色值判断这个颜色是否属于第二像素点的颜色值进行分类。也就是输入一堆颜色值,对这些颜色值是否属于第二像素点的颜色值进行分类,确定在哪些颜色值是属于第二像素点的颜色值。通过机器算法可以得到第二像素点的颜色值与第二阈值、第三阈值的映射关系。In an implementation of obtaining the mapping relationship between the color value of the second pixel point and the second threshold and the third threshold, through machine learning binary classification algorithms, such as Logistic regression and naive Bayesian algorithm, according to the input of a certain color The color value judges whether this color belongs to the color value of the second pixel point for classification. That is, input a bunch of color values, classify whether these color values belong to the color values of the second pixel, and determine which color values belong to the color values of the second pixel. The mapping relationship between the color value of the second pixel point and the second threshold and the third threshold can be obtained through a machine algorithm.
可选的,第一值和第二值对应的色度、亮度、饱和度三个参数值分别为30、60、70。也就是说,得到第二像素点的颜色值后,对应的第二阈值是对色度减少30,亮度减少60,饱和度减少70,对应的第三阈值是对色度增加30,亮度增加60,饱和度增加70。Optionally, the three parameter values of chroma, brightness and saturation corresponding to the first value and the second value are 30, 60 and 70 respectively. That is to say, after obtaining the color value of the second pixel, the corresponding second threshold is to decrease the chroma by 30, the brightness by 60, and the saturation by 70, and the corresponding third threshold is to increase the chroma by 30 and the brightness by 60 , increase the saturation by 70.
作为一种可选的实施方式,图像处理装置在执行步骤203的过程中执行以下步骤:As an optional implementation manner, the image processing device performs the following steps during the execution of step 203:
6、在上述第一数量与上述待测区域内像素点的数量的第一比值超过第一阈值的情况下,确定上述皮肤遮挡检测结果为上述皮肤区域处于未遮挡状态。6. When the first ratio of the first number to the number of pixels in the area to be detected exceeds a first threshold, determine that the skin occlusion detection result is that the skin area is in an unoccluded state.
本申请实施例中,图像处理装置根据第一数量和待测区域内像素点的数量的第一比值是否超过第一阈值的结果,判断皮肤区域是否处于遮挡状态。在第一比值比第一阈值小的情况下,确定上述皮肤遮挡检测结果为皮肤区域处于遮挡状态。举例说明,第一数量为50,待测区域内像素点的数量为100,第一阈值为60%。因为第一比值为50/100=50%,小于60%。那么认为皮肤遮挡检测结果为皮肤区域处于遮挡状态。In the embodiment of the present application, the image processing device judges whether the skin area is in an occluded state according to whether the first ratio of the first number to the number of pixels in the area to be detected exceeds a first threshold. If the first ratio is smaller than the first threshold, it is determined that the skin occlusion detection result is that the skin area is in an occlusion state. For example, the first number is 50, the number of pixels in the region to be tested is 100, and the first threshold is 60%. Because the first ratio is 50/100=50%, less than 60%. Then it is considered that the skin occlusion detection result indicates that the skin area is in an occlusion state.
在皮肤遮挡检测结果为皮肤区域处于遮挡的情况下,图像处理装置输出需要露出皮肤的提示信息。可以根据露出皮肤的提示信息,露出皮肤后再重新进行皮肤遮挡检测,或者进行其他的操作。本申请不做限定。If the skin occlusion detection result shows that the skin area is occluded, the image processing device outputs prompt information that the skin needs to be exposed. According to the prompt message of exposing the skin, the skin occlusion detection can be performed again after exposing the skin, or other operations can be performed. This application is not limited.
7、在上述第一比值超过上述第一阈值的情况下,确定上述皮肤遮挡检测结果为上述皮肤区域处于未遮挡状态。7. When the first ratio exceeds the first threshold, determine that the skin occlusion detection result indicates that the skin area is in an unoccluded state.
本申请实施例中,图像处理装置根据第一数量和待测区域内像素点的数量的第一比值等于或者大于第一阈值的结果,确定上述皮肤遮挡检测结果为皮肤区域处于未遮挡状态。举例说明,第一数量为60,待测区域内像素点的数量为100,第一阈值为60%。因为第一比值为60/100=60%,等于60%。那么认为皮肤遮挡检测结果为皮肤区域处于未遮挡状态。又或者,第一数量为70,待测区域内像素点的数量为100,第一阈值为60%。因为第一比值为70/100=70%,大于60%,那么认为皮肤遮挡检测结果为皮肤区域处于未遮挡状态。In the embodiment of the present application, the image processing device determines that the skin occlusion detection result is that the skin area is in an unoccluded state according to the result that the first ratio of the first number to the number of pixels in the area to be detected is equal to or greater than the first threshold. For example, the first number is 60, the number of pixels in the region to be tested is 100, and the first threshold is 60%. Since the first ratio is 60/100=60%, it is equal to 60%. Then it is considered that the skin occlusion detection result indicates that the skin area is in an unoccluded state. Alternatively, the first number is 70, the number of pixels in the region to be tested is 100, and the first threshold is 60%. Since the first ratio is 70/100=70%, which is greater than 60%, it is considered that the skin occlusion detection result indicates that the skin area is in an unoccluded state.
在确定皮肤遮挡检测结果为皮肤区域处于未遮挡状态的情况下,可以实行测温的操作或者其他的操作。如果在皮肤遮挡检测结果为皮肤区域处于未遮挡状态的情况下进行测温,可以提高检测温度的准确性。对于皮肤遮挡检测结果为皮肤区域处于未遮挡状态的情况下进行的后续操作,本申请在这里不做限定。When it is determined that the skin occlusion detection result indicates that the skin area is in an unoccluded state, a temperature measurement operation or other operations may be performed. If the temperature measurement is performed when the skin occlusion detection result shows that the skin area is in an unoccluded state, the accuracy of temperature detection can be improved. The present application does not limit the subsequent operations performed when the skin occlusion detection result shows that the skin area is in an unoccluded state.
作为一种可选的实施方式,图像处理装置还执行以下步骤:As an optional implementation manner, the image processing device also performs the following steps:
8、获取上述待处理图像的温度热力图。8. Obtain the temperature thermodynamic map of the image to be processed above.
本申请实施例中的图像处理方法可用于测温领域,上述皮肤区域属于待检测人物。温度热力图中的每个像素点都携带对应像素点的温度信息。可选的,温度热力图由图像处理装置上的红外热成像设备采集得到。图像处理装置通过对温度热力图和待处理 图像进行图像匹配处理,从温度热力图中确定与上述待处理图像的人脸区域对应的像素点区域,得到在温度热力图上的待处理图像的人脸区域对应的像素点区域。The image processing method in the embodiment of the present application can be used in the field of temperature measurement, and the above skin area belongs to the person to be detected. Each pixel in the temperature thermodynamic map carries the temperature information of the corresponding pixel. Optionally, the temperature thermodynamic map is collected by an infrared thermal imaging device on the image processing device. The image processing device performs image matching processing on the temperature thermodynamic map and the image to be processed, determines the pixel point area corresponding to the face area of the image to be processed from the temperature thermodynamic map, and obtains the person in the image to be processed on the temperature thermodynamic map. The pixel area corresponding to the face area.
9、在上述皮肤遮挡检测结果为上述皮肤区域处于未遮挡状态的情况下,从上述温度热力图中读取上述皮肤区域的温度,作为上述待检测人物的体温。9. When the skin occlusion detection result shows that the skin area is in an unoccluded state, read the temperature of the skin area from the temperature thermodynamic map as the body temperature of the person to be detected.
在本申请通过检测待测对象的额头区域温度确定其体温的实施例中,在上述皮肤遮挡检测结果为皮肤区域处于未被遮挡状态的情况下,从温度热力图中先找到与上述待处理图像的人脸区域对应的像素点区域,一般来说皮肤区域是位于整个人脸区域的上30%至40%的部分,因此可以获取温度热力图中皮肤区域对应的温度。可以将皮肤区域的平均值温度作为上述待检测人物的体温,也可以将皮肤区域的最高温度作为上述待检测人物的体温,本申请不做限定。In the embodiment of the present application in which the body temperature of the subject is determined by detecting the temperature of the forehead area of the subject, in the case that the above-mentioned skin occlusion detection result shows that the skin area is in an unoccluded state, first find the image to be processed from the temperature thermodynamic map The pixel area corresponding to the face area, generally speaking, the skin area is located in the upper 30% to 40% of the entire face area, so the temperature corresponding to the skin area in the temperature thermodynamic map can be obtained. The average temperature of the skin area can be used as the body temperature of the person to be detected, or the highest temperature of the skin area can be used as the body temperature of the person to be detected, which is not limited in this application.
请参阅图3,图3是本申请实施例提供的一种应用图像处理方法的流程示意图。Please refer to FIG. 3 . FIG. 3 is a schematic flowchart of an applied image processing method provided by an embodiment of the present application.
基于本申请实施例提供的图像处理方法,本申请实施例还提供了一种图像处理方法可能的应用场景。Based on the image processing method provided in the embodiment of the present application, the embodiment of the present application also provides a possible application scenario of the image processing method.
在使用热成像设备对行人进行非接触测温的时候,一般测量的是行人额头区域的温度。但是行人有刘海遮挡额头或戴帽子时,因为无法确定额头区域是否处于遮挡状态,会对测温带来一定程度的干扰,这给当前的测温工作带来了一定挑战。因此,在测温前对行人进行额头遮挡状态检测,在额头区域处于未遮挡的状态下,对行人的额头区域进行测温,能够提高测温的准确性。When thermal imaging equipment is used to measure the temperature of pedestrians in a non-contact manner, the temperature of the forehead area of pedestrians is generally measured. However, when pedestrians have bangs covering their foreheads or wearing hats, because it is impossible to determine whether the forehead area is covered, it will cause a certain degree of interference to the temperature measurement, which brings certain challenges to the current temperature measurement work. Therefore, before measuring the temperature, the pedestrian's forehead is covered by detection, and when the forehead is not covered, the temperature of the pedestrian's forehead can be measured, which can improve the accuracy of temperature measurement.
如图3所示,图像处理装置获取相机帧数据,也就是一张待处理图像。对待处理图像进行人脸检测,如果人脸检测的结果为待处理图像中不存在人脸,那么图像处理装置重新去获取一张待处理图像。如果人脸检测的结果为存在人脸,那么图像处理装置就将待处理图像输入到已经训练好的神经网络,可以输出待处理图像的人脸框(如图1的D所示)和人脸框坐标(如图1所示)以及106个关键点的坐标(如图4所示)。需要理解的是,人脸框的坐标可以是一对对角坐标包括左上角坐标和右下角坐标或者左下角坐标和右上角坐标,本申请实施例为便于理解给出了人脸框的四个角点坐标(如图1所示)。本申请实施例中输出待处理图像的人脸框坐标和106个关键点坐标的神经网络可以是一个神经网络,也可以是分别实现人脸检测和人脸关键点检测的两个神经网络的串联。As shown in FIG. 3 , the image processing device acquires camera frame data, that is, an image to be processed. Face detection is performed on the image to be processed, and if the result of the face detection is that there is no human face in the image to be processed, the image processing device acquires a new image to be processed. If the result of face detection is that there is a human face, then the image processing device will input the image to be processed into the trained neural network, and can output the human face frame (as shown in D of Figure 1 ) and the human face of the image to be processed. Box coordinates (as shown in Figure 1) and coordinates of 106 key points (as shown in Figure 4). It should be understood that the coordinates of the face frame can be a pair of diagonal coordinates including the upper left corner coordinate and the lower right corner coordinate or the lower left corner coordinate and the upper right corner coordinate. Corner coordinates (as shown in Figure 1). In the embodiment of the present application, the neural network that outputs the coordinates of the face frame of the image to be processed and the coordinates of 106 key points can be a neural network, or it can be a series of two neural networks that realize face detection and face key point detection respectively. .
为了检测额头区域露出的皮肤区域,以眉心区域的最亮像素点的颜色值作为额头区域露出的皮肤区域的颜色值基准。最亮像素点是上述第二像素点。因此需要先获取眉心区域。通过人脸关键点检测,获取左眉毛内侧区域和右眉毛内侧的关键点。在右眉毛内侧区域和左眉毛内侧区域分别有两个关键点的情况下,关键点为右眉内侧上方点、右眉内侧下方点、左眉内侧上方点、左眉内侧下方点。通过这四个关键点求一个矩形区域为眉心区域。本申请实施例以106个关键点坐标为例,右眉内侧上方点、右眉内侧下方点、左眉内侧上方点、左眉内侧下方点对应的也就是37、38、67、68这四个关键点。需要理解的是,这里的关键点的数量和关键点的编号并不构成限定,只要是分别取右眉内侧区域和左眉内侧区域的两个关键点都是本申请所要求保护的范围。In order to detect the exposed skin area of the forehead area, the color value of the brightest pixel point in the brow area is used as the color value reference of the exposed skin area of the forehead area. The brightest pixel is the above-mentioned second pixel. Therefore, it is necessary to obtain the eyebrow area first. Through face key point detection, the key points of the inner area of the left eyebrow and the inner area of the right eyebrow are obtained. In the case where there are two key points in the inner area of the right eyebrow and the inner area of the left eyebrow respectively, the key points are the upper point on the inner side of the right eyebrow, the lower point on the inner side of the right eyebrow, the upper point on the inner side of the left eyebrow, and the lower point on the inner side of the left eyebrow. Find a rectangular area through these four key points as the eyebrow area. The embodiment of the present application takes the coordinates of 106 key points as an example. The upper point on the inner side of the right eyebrow, the lower point on the inner side of the right eyebrow, the upper point on the inner side of the left eyebrow, and the lower point on the inner side of the left eyebrow correspond to the four points 37, 38, 67, and 68. key point. It should be understood that the number of key points and the number of key points here do not constitute a limitation, as long as the two key points of the inner area of the right eyebrow and the inner area of the left eyebrow are taken respectively, they are within the scope of protection claimed by this application.
通过获取37、38、67、68关键点的坐标分别定为(X1,Y1)、(X2,Y2)、(X3,Y3)、(X4,Y4)。取(X1,Y1),(X2,Y2)中Y坐标的最大值为Y5取(X3,Y3)、(X4,Y4)中Y坐标的最小值为Y6,取(X1,Y1)、(X3,Y3)中X坐标的最大值为X5,取(X2,Y2)、(X4,Y4)中X坐标的最小值为X6。把得到的X5、X6坐标和Y5、Y6坐标进行组合,得到四个坐标。根据这四个坐标就可以确定一个矩形区域。其中,矩形区域的四个顶点坐标为(X6,Y6)、(X5,Y5)、(X5,Y6)、(X6,Y5),这个矩形区域也就是要截取的眉心区域。通过人脸的关键点检测可以确定37、38、67、68这四个点的坐标,那么就可以确定(X6,Y6)、(X5,Y5)、(X5,Y6)、(X6,Y5)这四个点的位置。截取根据这四个点确定的矩形区域,获取眉心区域。The coordinates of key points 37, 38, 67, and 68 are obtained as (X1, Y1), (X2, Y2), (X3, Y3), and (X4, Y4) respectively. Take the maximum value of Y coordinate in (X1, Y1), (X2, Y2) as Y5 Take the minimum value of Y coordinate in (X3, Y3), (X4, Y4) as Y6, take (X1, Y1), (X3 , Y3), the maximum value of X coordinates is X5, and the minimum value of X coordinates among (X2, Y2), (X4, Y4) is X6. Combine the obtained X5, X6 coordinates with Y5, Y6 coordinates to obtain four coordinates. According to these four coordinates, a rectangular area can be determined. Wherein, the coordinates of the four vertices of the rectangular area are (X6, Y6), (X5, Y5), (X5, Y6), (X6, Y5), and this rectangular area is also the brow area to be intercepted. The coordinates of the four points 37, 38, 67, and 68 can be determined through the key point detection of the face, then (X6, Y6), (X5, Y5), (X5, Y6), (X6, Y5) can be determined The positions of these four points. Intercept the rectangular area determined according to these four points to obtain the area between the eyebrows.
获取眉心区域后,需要找到眉心区域中的最亮像素点。因此对眉心区域进行灰度化处理,得到眉心区域的灰度图。本申请实例中,灰度化处理就是让像素点矩阵中的每一个像素点都满足下面的关系:R=G=B。也就是让红色变量的值,绿色变量的值和蓝色变量的值相等。这个“=”的意思是数学中的相等,此时的这个值叫做灰度值。一般灰度处理经常使用两种方法来进行处理:After obtaining the brow area, you need to find the brightest pixel in the brow area. Therefore, gray-scale processing is performed on the brow area to obtain a gray-scale image of the brow area. In the example of this application, the grayscale processing is to make each pixel in the pixel matrix satisfy the following relationship: R=G=B. That is to make the value of the red variable, the value of the green variable and the value of the blue variable equal. This "=" means equality in mathematics, and this value at this time is called a gray value. Generally, grayscale processing often uses two methods for processing:
方法一:灰度化后的R=灰度化后的G=灰度化后的B=(处理前的R+处理前的G+处理前的B)/3Method 1: R after grayscale=G after grayscale=B after grayscale=(R before processing+G before processing+B before processing)/3
举例说明:图片A的像素点m的R为100,G为120,B为110。也就是说,在灰度化处理前像素点m的R为100,G为120,B为110。那么对图片A进行灰度化处理,灰度化处理后像素点m的R=G=B=(100+120+110)/3=110。For example: the R of the pixel point m of the picture A is 100, the G is 120, and the B is 110. That is to say, the R of the pixel point m is 100, the G is 120, and the B is 110 before grayscale processing. Then grayscale processing is performed on the picture A, and R=G=B=(100+120+110)/3=110 of the pixel point m after the grayscale processing.
方法二:灰度化后的R=灰度化后的G=灰度化后的B=处理前的R*0.3+处理前的G*0.59+处理前的B*0.11Method 2: R after grayscale = G after grayscale = B after grayscale = R*0.3 before processing + G*0.59 before processing + B*0.11 before processing
举例说明:图片A的像素点m的R为100,G为120,B为110。也就是说,在灰度化处理前像素点m的R为100,G为120,B为110。那么对图片A进行灰度化处理,灰度化处理后像素点m的R=G=B=100*0.3+120*0.59+110*0.11=112.9。For example: the R of the pixel point m of the picture A is 100, the G is 120, and the B is 110. That is to say, the R of the pixel point m is 100, the G is 120, and the B is 110 before grayscale processing. Then grayscale processing is performed on the picture A, and R=G=B=100*0.3+120*0.59+110*0.11=112.9 of the pixel point m after the grayscale processing.
还可以采用Opencv函数对眉心区域进行灰度化处理,本申请中对眉心区域的灰度化处理方法不做限定。为了求出最亮像素点的颜色值,也就是找到眉心区域灰度化处理后的灰度值最大的像素点的颜色值。对眉心区域的灰度图的每一行的灰度值进行相加,记录取得灰度值之和最大的行的坐标。同理,对眉心区域的灰度图像的每一列的灰度值进行相加,记录取得灰度值之和最大的列的坐标。通过获得灰度值之和最大行和最大列的坐标确定的交点坐标,得到眉心区域最亮像素点的坐标。通过RGB和HSV的转换关系,找到眉心区域最亮像素点的RGB值可以通过公式转换得到对应的HSV值,也可以通过opencv的cvtcolor函数将眉心区域的RGB通道转换为HSV通道,找到最亮像素点的HSV值。因为眉心区域最亮像素点的HSV值和第二阈值以及第三阈值具有确定的关系,也就是说眉心区域最亮像素点的HSV值可以确定对应的第二阈值和第三阈值。The Opencv function can also be used to perform grayscale processing on the region between the eyebrows, and the grayscale processing method of the region between the eyebrows is not limited in this application. In order to obtain the color value of the brightest pixel point, that is to find the color value of the pixel point with the largest gray value after the gray scale processing in the brow area. Add the gray values of each row of the gray image of the brow area, and record the coordinates of the row with the largest sum of gray values. Similarly, the gray value of each column of the gray image of the brow area is added, and the coordinates of the column with the largest sum of gray values are recorded. The coordinates of the brightest pixel in the eyebrow area are obtained by obtaining the intersection coordinates determined by the coordinates of the maximum row and maximum column of the sum of gray values. Through the conversion relationship between RGB and HSV, find the RGB value of the brightest pixel in the brow area. You can convert the corresponding HSV value through the formula. You can also convert the RGB channel of the brow area into an HSV channel through the cvtcolor function of opencv to find the brightest pixel. The HSV value of the point. Because the HSV value of the brightest pixel in the eyebrow area has a definite relationship with the second threshold and the third threshold, that is to say, the HSV value of the brightest pixel in the eyebrow area can determine the corresponding second threshold and third threshold.
获取额头区域需要确定额头区域的大小和位置。额头区域的长度是人脸的宽度。通过计算关键点0和关键点32的距离,缩小人脸框使得人脸框的左框线和右框线的距离为关键点0和关键点32之间的距离。也就是说,把关键点0和关键点32的之间的距离作为额头区域的长度。额头区域的宽度约占整个人脸框的1/3,虽然每个人的额头区域的宽度占整个人脸的长度的比例是不一样的,但是额头区域的宽度几乎都在人脸长度的30%到40%的范围内。因此,把人脸框的上框线和下框线之间的距离缩小到原人脸框的上框线和下框线之间距离的30%到40%,作为额头区域的宽度。额头区域是位于眉毛以上的区域。这里关键点35和40确定的水平线是眉毛的位置。因此移动改变大小的人脸框,使得改变大小的人脸框的下框线位于35和40这两个关键点确定的水平线,得到改变位置和大小的人脸框。改变大小和位置的人脸框所包含的矩形区域就是额头区域。Obtaining the forehead region requires determining the size and location of the forehead region. The length of the forehead area is the width of the human face. By calculating the distance between key point 0 and key point 32, the face frame is reduced so that the distance between the left frame line and the right frame line of the face frame is the distance between key point 0 and key point 32. That is to say, the distance between the key point 0 and the key point 32 is taken as the length of the forehead area. The width of the forehead area accounts for about 1/3 of the entire face frame. Although the ratio of the width of the forehead area to the length of the entire face is different for each person, the width of the forehead area is almost 30% of the length of the face. to the 40% range. Therefore, the distance between the upper frame line and the lower frame line of the face frame is reduced to 30% to 40% of the distance between the upper frame line and the lower frame line of the original face frame, as the width of the forehead area. The forehead area is the area located above the eyebrows. Here the horizontal line defined by key points 35 and 40 is the position of the eyebrows. Therefore, move the size-changed face frame so that the lower frame of the size-changed face frame is located at the horizontal line determined by the two key points 35 and 40, and obtain a changed position and size face frame. The rectangular area contained in the face frame whose size and position are changed is the forehead area.
截取额头区域,然后根据第二阈值和第三阈值对额头区域进行二值化,得到额头区域的二值化图像。这里采用二值化图像,可以减少数据处理量,加快图像处理装置检测额头区域的速度。二值化的标准就是:额头区域的某个像素点的HSV值大于等于第二阈值且小于等于第三阈值,那么这个像素点的灰度值为255,额头区域的某个像素点的HSV值小于第二阈值或者大于第三阈值,那么这个像素点的灰度值为0。首先,把额头区域图像从RGB通道图转换成HSV通道图。然后,统计额头区域灰度值为255的像素点的数量,也就是灰度图中颜色为白色的像素点的数量。在白色的像素点的数量与额头区域内的像素点的数量之比达到阈值的情况下,认为额头区域处于未被遮挡的状态,因此进行热力成像测温操作。在白色的像素点的数量与额头区域内的像素点的数量之比没有达到阈值的情况下,认为额头区域处于遮挡状态,此时进行测温操作会影响测温的准确性,因此输出需要露出额头的提示,并且需要图像处理装置重新获取一张图像重新 进行额头遮挡状态检测。举例说明:假设第二阈值为(100,50,70),第三阈值为(120,90,100),额头区域的像素点q的颜色值为(110,60,70),额头区域的像素点p的颜色值为(130,90,20)。那么q在第二阈值和第三阈值的范围内,p不在第二阈值和第三阈值的范围内。在进行额头区域二值化处理的时候,像素点q的灰度值为255,像素点p的灰度值为0。假设阈值为60%,额头区域内像素点的数量为100,白色像素点的数量为50,那么白色像素点的数量和额头区域内像素点的数量的比值为50%,没有达到阈值,额头区域处于遮挡状态,因此输出需要露出额头的提示。The forehead area is intercepted, and then the forehead area is binarized according to the second threshold and the third threshold to obtain a binarized image of the forehead area. The binary image is used here, which can reduce the amount of data processing and speed up the detection of the forehead area by the image processing device. The binarization standard is: the HSV value of a certain pixel in the forehead area is greater than or equal to the second threshold and less than or equal to the third threshold, then the gray value of this pixel is 255, and the HSV value of a certain pixel in the forehead area If it is less than the second threshold or greater than the third threshold, then the gray value of this pixel is 0. First, convert the forehead region image from RGB channel map to HSV channel map. Then, count the number of pixels with a gray value of 255 in the forehead area, that is, the number of pixels whose color is white in the gray scale image. When the ratio of the number of white pixels to the number of pixels in the forehead area reaches the threshold, it is considered that the forehead area is not blocked, and thus the thermal imaging temperature measurement operation is performed. When the ratio of the number of white pixels to the number of pixels in the forehead area does not reach the threshold, the forehead area is considered to be in a blocked state, and the temperature measurement operation at this time will affect the accuracy of temperature measurement, so the output needs to be exposed Forehead prompts, and the image processing device needs to re-acquire an image to re-detect the forehead occlusion state. For example: Suppose the second threshold is (100, 50, 70), the third threshold is (120, 90, 100), the color value of the pixel point q in the forehead area is (110, 60, 70), the pixel in the forehead area The color value of point p is (130, 90, 20). Then q is within the range of the second threshold and the third threshold, and p is not within the range of the second threshold and the third threshold. During the binarization process of the forehead area, the gray value of the pixel point q is 255, and the gray value of the pixel point p is 0. Suppose the threshold is 60%, the number of pixels in the forehead area is 100, and the number of white pixels is 50, then the ratio of the number of white pixels to the number of pixels in the forehead area is 50%, and the threshold is not reached, the forehead area It is in an occluded state, so the output needs to show the prompt of the forehead.
本领域技术人员可以理解,在上述方法的具体实施方式中,各步骤的撰写顺序并不意味着严格的执行顺序而对实施过程构成任何限定,各步骤的具体执行顺序应当以其功能和可能的内在逻辑确定。Those skilled in the art can understand that in the specific implementation of the above method, the writing order of each step does not mean a strict execution order and constitutes any limitation on the implementation process. The specific execution order of each step should be based on its function and possible The inner logic is OK.
上述详细阐述了本申请实施例的方法,下面提供了本申请实施例的装置。The method of the embodiment of the present application has been described in detail above, and the device of the embodiment of the present application is provided below.
请参阅图5,图5为本申请实施例提供的一种图像处理装置的结构示意图,其中,该装置1包括获取单元11、第一处理单元12、检测单元13,可选的,图像处理装置1还包括第二处理单元14、确定单元15、第三处理单元16,第四处理单元17,其中:获取单元11,用于获取待处理图像、第一阈值、第二阈值和第三阈值,所述第一阈值和所述第二阈值不同,所述第一阈值和所述第三阈值不同,所述第二阈值小于等于所述第三阈值;第一处理单元12,用于确定所述待处理图像的待测区域中第一像素点的第一数量;所述第一像素点为颜色值大于等于第二阈值且小于等于第三阈值的像素点;检测单元13,用于依据所述第一数量与所述待测区域内像素点的数量的第一比值和所述第一阈值,得到所述待处理图像的皮肤遮挡检测结果。Please refer to FIG. 5. FIG. 5 is a schematic structural diagram of an image processing device provided by an embodiment of the present application, wherein the device 1 includes an acquisition unit 11, a first processing unit 12, and a detection unit 13. Optionally, an image processing device 1 also includes a second processing unit 14, a determination unit 15, a third processing unit 16, and a fourth processing unit 17, wherein: the acquisition unit 11 is used to acquire the image to be processed, the first threshold, the second threshold and the third threshold, The first threshold is different from the second threshold, the first threshold is different from the third threshold, and the second threshold is less than or equal to the third threshold; the first processing unit 12 is configured to determine the The first quantity of the first pixel in the area to be detected of the image to be processed; the first pixel is a pixel whose color value is greater than or equal to the second threshold and less than or equal to the third threshold; the detection unit 13 is configured to The first ratio of the first number to the number of pixels in the region to be detected and the first threshold are used to obtain a skin occlusion detection result of the image to be processed.
结合本申请任一实施方式,所述待测区域包括人脸区域,所述皮肤遮挡检测结果包括人脸遮挡检测结果;所述图像处理装置还包括:第二处理单元14,用于在所述确定所述待处理图像的待测区域中第一像素点的第一数量之前,对所述待处理图像进行人脸检测处理,得到第一人脸框;依据所述第一人脸框,从所述待处理图像中确定所述人脸区域。In combination with any embodiment of the present application, the area to be tested includes a human face area, and the skin occlusion detection result includes a human face occlusion detection result; the image processing device further includes: a second processing unit 14, configured to Before determining the first number of first pixels in the area to be detected of the image to be processed, performing face detection processing on the image to be processed to obtain a first face frame; according to the first face frame, from The face area is determined in the image to be processed.
结合本申请任一实施方式,所述人脸区域包括额头区域,所述人脸遮挡检测结果包括额头遮挡检测结果,所述第一人脸框包括:上框线和下框线;所述上框线和所述下框线均为所述第一人脸框中平行于所述待处理图像的像素坐标系的横轴的边,且所述上框线的纵坐标小于所述下框线的纵坐标;所述第二处理单元14用于:对所述待处理图像进行人脸关键点检测,得到至少一个人脸关键点;所述至少一个人脸关键点包括左眉毛关键点和右眉毛关键点;在保持所述上框线的纵坐标不变的情况下,将所述下框线沿所述待处理图像的像素坐标系的纵轴的负方向移动,使得所述下框线所在直线与第一直线重合,得到第二人脸框;所述第一直线为过所述左眉毛关键点和所述右眉毛关键点的直线;依据所述第二人脸框包含的区域,得到所述额头区域。In combination with any embodiment of the present application, the face area includes a forehead area, the face occlusion detection result includes a forehead occlusion detection result, and the first face frame includes: an upper frame line and a lower frame line; Both the frame line and the lower frame line are sides parallel to the horizontal axis of the pixel coordinate system of the image to be processed in the first face frame, and the ordinate of the upper frame line is smaller than the lower frame line The ordinate; the second processing unit 14 is used to: detect the key points of the human face on the image to be processed to obtain at least one key point of the human face; the at least one key point of the human face includes the left eyebrow key point and the right eyebrow key point Eyebrow key point; under the condition of keeping the ordinate of the upper frame line unchanged, move the lower frame line along the negative direction of the vertical axis of the pixel coordinate system of the image to be processed, so that the lower frame line Where the straight line coincides with the first straight line to obtain the second human face frame; the first straight line is a straight line passing through the left eyebrow key point and the right eyebrow key point; according to the second human face frame included region to get the forehead region.
结合本申请任一实施方式,所述第二处理单元14用于:在保持所述第二人脸框的下框线的纵坐标不变的情况下,将所述第二人脸框的上框线沿所述待处理图像的像素坐标系的纵轴移动,使得所述第二人脸框的上框线和所述第二人脸框的下框线的距离为预设距离,得到第三人脸框;依据所述第三人脸框包含的区域,得到所述额头区域。In combination with any embodiment of the present application, the second processing unit 14 is configured to: keep the vertical coordinate of the lower frame line of the second face frame unchanged, and convert the upper frame line of the second face frame to The frame line moves along the vertical axis of the pixel coordinate system of the image to be processed, so that the distance between the upper frame line of the second human face frame and the lower frame line of the second human face frame is a preset distance, and the first Three face frames; according to the area included in the third face frame, the forehead area is obtained.
结合本申请任一实施方式,所述至少一个人脸关键点还包括左嘴角关键点和右嘴角关键点;所述第一人脸框还包括:左框线和右框线;所述左框线和所述右框线均为所述第一人脸框中平行于所述待处理图像的像素坐标系的纵轴的边,且所述左框线的横坐标小于所述右框线的横坐标;所述第二处理单元14用于:在保持所述第三人脸框的左框线的横坐标不变的情况下,将所述第三人脸框的右框线沿所述待处理图像的像素坐标系的横轴移动,使得所述第三人脸框的右框线和所述第三人脸框的左框线的距离为参考距离,得到第四人脸框;所述参考距离为第二直线与所述第三人脸框包含的人脸轮廓的两个交点之间的距离;所述第二直线为在所述第一直线和第三直线之间且平行于所述 第一直线或所述第三直线的直线;所述第三直线为过所述左嘴角关键点和所述右嘴角关键点的直线;将所述第四人脸框包含的区域作为所述额头区域。In combination with any embodiment of the present application, the at least one human face key point also includes a left mouth corner key point and a right mouth corner key point; the first human face frame further includes: a left frame line and a right frame line; the left frame line and the right frame line are both sides parallel to the vertical axis of the pixel coordinate system of the image to be processed in the first face frame, and the abscissa of the left frame line is smaller than that of the right frame line Abscissa; the second processing unit 14 is used to: keep the abscissa of the left frame line of the third human face frame unchanged, and place the right frame line of the third human face frame along the The horizontal axis of the pixel coordinate system of the image to be processed moves, so that the distance between the right frame line of the third human face frame and the left frame line of the third human face frame is a reference distance, and the fourth human face frame is obtained; The reference distance is the distance between the second straight line and the two intersection points of the human face contour included in the third human face frame; the second straight line is between the first straight line and the third straight line and parallel A straight line on the first straight line or the third straight line; the third straight line is a straight line passing through the key point of the left corner of the mouth and the key point of the right corner of the mouth; the region included in the fourth human face frame as the forehead area.
结合本申请任一实施方式,所述图像装置还包括:确定单元15,用于在所述确定所述待处理图像的待测区域中第一像素点的第一数量之前,从所述第一人脸框包含的像素点区域中确定皮肤像素点区域;所述获取单元11,还用于获取所述皮肤像素点区域中第二像素点的颜色值;所述第一处理单元12,还用于将所述第二像素点的颜色值与第一值的差作为所述第二阈值,将所述第二像素点的颜色值与第二值的和作为所述第三阈值;所述第一值和所述第二值均不超过所述待处理图像的颜色值中的最大值。In combination with any embodiment of the present application, the image device further includes: a determining unit 15, configured to, before determining the first number of first pixels in the region to be detected of the image to be processed, from the first Determine the skin pixel point area in the pixel point area included in the human face frame; the acquisition unit 11 is also used to obtain the color value of the second pixel point in the skin pixel point area; the first processing unit 12 is also used The difference between the color value of the second pixel point and the first value is used as the second threshold, and the sum of the color value of the second pixel point and the second value is used as the third threshold; Neither the first value nor the second value exceeds the maximum value among the color values of the image to be processed.
结合本申请任一实施方式,所述图像处理装置还包括:第三处理单元16,用于在所述从所述第一人脸框包含的像素点区域中确定皮肤像素点区域之前,对所述待处理图像进行口罩佩戴检测处理,得到检测结果;所述确定单元15用于:在检测到所述待处理图像中人脸区域未佩戴口罩的情况下,将所述人脸区域中除所述额头区域、嘴巴区域、眉毛区域和眼睛区域之外的像素点区域,作为所述皮肤像素点区域;在检测到所述待处理图像中人脸区域佩戴口罩的情况下,将所述第一直线和第四直线之间的像素点区域作为所述皮肤像素点区域。其中,所述第四直线为过左眼下眼睑关键点和右眼下眼睑关键点的直线;所述左眼下眼睑关键点和所述右眼下眼睑关键点均属于所述至少一个人脸关键点。In combination with any embodiment of the present application, the image processing device further includes: a third processing unit 16, configured to, before determining the skin pixel area from the pixel area included in the first human face frame, The mask wearing detection process is carried out on the image to be processed, and the detection result is obtained; the determination unit 15 is used to: when it is detected that the face area in the image to be processed is not wearing a mask, remove all masks from the face area. The forehead area, the mouth area, the eyebrow area and the pixel area outside the eye area are used as the skin pixel area; when it is detected that the face area in the image to be processed is wearing a mask, the first The pixel point area between the straight line and the fourth straight line is used as the skin pixel point area. Wherein, the fourth straight line is a straight line passing through the key points of the lower eyelid of the left eye and the key point of the lower eyelid of the right eye; both the key points of the lower eyelid of the left eye and the key points of the lower eyelid of the right eye belong to the at least one human face key point.
结合本申请任一实施方式,所述获取单元11用于:在所述至少一个人脸关键点包含属于左眉内侧区域中的至少一个第一关键点,且包含属于右眉内侧区域中的至少一个第二关键点的情况下,根据所述至少一个第一关键点和所述至少一个第二关键点确定矩形区域;对所述矩形区域进行灰度化处理,得到矩形区域的灰度图;将矩形区域的灰度图中第一行和第一列的交点的颜色值作为所述第二像素点的颜色值;所述第一行为所述灰度图中灰度值之和最大的行,所述第一列为所述灰度图中灰度值之和最大的列。In combination with any embodiment of the present application, the acquisition unit 11 is configured to: include at least one first key point belonging to the inner area of the left eyebrow in the at least one key point of the human face, and include at least one first key point belonging to the inner area of the right eyebrow. In the case of one second key point, determining a rectangular area according to the at least one first key point and the at least one second key point; performing grayscale processing on the rectangular area to obtain a grayscale image of the rectangular area; The color value of the intersection point of the first row and the first column in the grayscale image of the rectangular area is used as the color value of the second pixel point; the first row is the row with the largest sum of grayscale values in the grayscale image , the first column is the column with the largest sum of gray values in the gray scale image.
结合本申请任一实施方式,所述检测单元13用于:在所述第一比值未超过所述第一阈值的情况下,确定所述皮肤遮挡检测结果为所述待测区域对应的皮肤区域处于遮挡状态;在所述第一比值超过所述第一阈值的情况下,确定所述皮肤遮挡检测结果为所述待测区域对应的皮肤区域处于未遮挡状态。In combination with any embodiment of the present application, the detection unit 13 is configured to: if the first ratio does not exceed the first threshold, determine that the skin occlusion detection result is the skin area corresponding to the area to be tested In an occluded state; when the first ratio exceeds the first threshold, it is determined that the skin occlusion detection result indicates that the skin area corresponding to the region to be detected is in an unoccluded state.
结合本申请任一实施方式,所述皮肤区域属于待检测人物,所述获取单元11还用于:获取所述待处理图像的温度热力图;所述图像处理装置还包括:第四处理单元17,用于在所述皮肤遮挡检测结果为所述皮肤区域处于未遮挡状态的情况下,从所述温度热力图中读取所述皮肤区域的温度,作为所述待检测人物的体温。In combination with any embodiment of the present application, the skin area belongs to the person to be detected, and the acquisition unit 11 is further configured to: acquire the temperature thermodynamic map of the image to be processed; the image processing device further includes: a fourth processing unit 17 , for reading the temperature of the skin area from the temperature thermodynamic map as the body temperature of the person to be detected when the skin occlusion detection result shows that the skin area is in an unoccluded state.
在一些实施例中,本申请实施例提供的装置具有的功能或包含的模块可以用于执行上文方法实施例描述的方法,其具体实现可以参照上文方法实施例的描述,为了简洁,这里不再赘述。In some embodiments, the functions or modules included in the device provided by the embodiments of the present application can be used to execute the methods described in the above method embodiments, and its specific implementation can refer to the descriptions of the above method embodiments. For brevity, here No longer.
图6为本申请实施例提供的一种图像处理装置的硬件结构示意图。该图像处理装置2包括处理器21,存储器22,输入装置23,输出装置24。该处理器21、存储器22、输入装置23和输出装置24通过连接器25相耦合,该连接器25包括各类接口、传输线或总线等等,本申请实施例对此不作限定。应当理解,本申请的各个实施例中,耦合是指通过特定方式的相互联系,包括直接相连或者通过其他设备间接相连,例如可以通过各类接口、传输线、总线等相连。FIG. 6 is a schematic diagram of a hardware structure of an image processing device provided by an embodiment of the present application. The image processing device 2 includes a processor 21 , a memory 22 , an input device 23 and an output device 24 . The processor 21, the memory 22, the input device 23 and the output device 24 are coupled through a connector 25, and the connector 25 includes various interfaces, transmission lines or buses, etc., which are not limited in this embodiment of the present application. It should be understood that in various embodiments of the present application, coupling refers to interconnection in a specific way, including direct connection or indirect connection through other devices, for example, connection through various interfaces, transmission lines, and buses.
处理器21可以是一个或多个图形处理器(graphics processing unit,GPU),在处理器21是一个GPU的情况下,该GPU可以是单核GPU,也可以是多核GPU。可选的,处理器21可以是多个GPU构成的处理器组,多个处理器之间通过一个或多个总线彼此耦合。可选的,该处理器还可以为其他类型的处理器等等,本申请实施例不作限定。The processor 21 may be one or more graphics processing units (graphics processing unit, GPU), and in the case where the processor 21 is a GPU, the GPU may be a single-core GPU or a multi-core GPU. Optionally, the processor 21 may be a processor group composed of multiple GPUs, and the multiple processors are coupled to each other through one or more buses. Optionally, the processor may also be other types of processors, etc., which are not limited in this embodiment of the present application.
存储器22可用于存储计算机程序指令,以及用于执行本申请方案的程序代码在内的各类计算机程序代码。可选地,存储器包括但不限于是随机存储记忆体(random access memory,RAM)、只读存储器(read-only memory,ROM)、可擦除可编程只读存储器(erasable programmable read only memory,EPROM)、或便携式只读存储器(compact disc read-only memory,CD-ROM),该存储器用于相关指令及数据。The memory 22 can be used to store computer program instructions and various computer program codes including program codes for implementing the solutions of the present application. Optionally, the memory includes but is not limited to random access memory (random access memory, RAM), read-only memory (read-only memory, ROM), erasable programmable read-only memory (erasable programmable read only memory, EPROM ), or portable read-only memory (compact disc read-only memory, CD-ROM), which is used for related instructions and data.
输入装置23用于输入数据和/或信号,以及输出装置24用于输出数据和/或信号。输入装置23和输出装置24可以是相独立的器件,也可以是一个整体的器件。The input device 23 is used for inputting data and/or signals and the output device 24 is used for outputting data and/or signals. The input device 23 and the output device 24 can be independent devices, or an integrated device.
可理解,本申请实施例中,存储器22不仅可用于存储相关指令,还可用于存储,如该存储器22可用于存储通过输入装置23获取的数据,又或者该存储器22还可用于存储通过处理器21处理的数据等等,本申请实施例对于该存储器中具体所存储的数据不作限定。It can be understood that in the embodiment of the present application, the memory 22 can not only be used to store relevant instructions, but also can be used for storage, for example, the memory 22 can be used to store data obtained through the input device 23, or the memory 22 can also be used to store data obtained through the processor. 21 processed data, etc., the embodiment of the present application does not limit the specific data stored in the memory.
可以理解的是,图6仅仅示出了图像处理装置的简化设计。在实际应用中,图像处理装置还可以分别包含必要的其他元件,包含但不限于任意数量的输入/输出装置、处理器、存储器等,而所有可以实现本申请实施例的图像处理装置都应在本申请的保护范围之内。It can be understood that Fig. 6 only shows a simplified design of the image processing device. In practical applications, the image processing device can also include other necessary components, including but not limited to any number of input/output devices, processors, memories, etc., and all image processing devices that can implement the embodiments of the present application should be in Within the protection scope of this application.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those skilled in the art can appreciate that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。所属领域的技术人员还可以清楚地了解到,本申请各个实施例描述各有侧重,为描述的方便和简洁,相同或类似的部分在不同实施例中可能没有赘述,因此,在某一实施例未描述或未详细描述的部分可以参见其他实施例的记载。Those skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here. Those skilled in the art can also clearly understand that the descriptions of each embodiment of the present application have their own emphases. For the convenience and brevity of description, the same or similar parts may not be repeated in different embodiments. Therefore, in a certain embodiment For parts not described or not described in detail, reference may be made to the descriptions of other embodiments.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,上述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the above units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or can be Integrate into another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
上述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个第一处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present application may be integrated into a first processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。上述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行上述计算机程序指令时,全部或部分地产生按照本申请实施例上述的流程或功能。上述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。上述计算机指令可以存储在计算机可读存储介质中,或者通过上述计算机可读存储介质进行传输。上述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。上述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。上述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如, 数字通用光盘(digital versatile disc,DVD))、或者半导体介质(例如固态硬盘(solid state disk,SSD))等。In the above embodiments, all or part of them may be implemented by software, hardware, firmware or any combination thereof. When implemented using software, it may be implemented in whole or in part in the form of a computer program product. The computer program product described above comprises one or more computer instructions. When the above-mentioned computer program instructions are loaded and executed on the computer, all or part of the above-mentioned processes or functions according to the embodiments of the present application will be generated. The above-mentioned computers may be general-purpose computers, special-purpose computers, computer networks, or other programmable devices. The above computer instructions may be stored in a computer-readable storage medium, or transmitted through the above-mentioned computer-readable storage medium. The above computer instructions can be sent from one website site, computer, server or data center to another via wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) A website site, computer, server or data center for transmission. The above-mentioned computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server or a data center integrated with one or more available media. The above available medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a digital versatile disc (digital versatile disc, DVD)), or a semiconductor medium (for example, a solid state disk (solid state disk, SSD)) Wait.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,该流程可以由计算机程序来指令相关的硬件完成,该程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法实施例的流程。而前述的存储介质包括:只读存储器(read-only memory,ROM)或随机存储存储器(random access memory,RAM)、磁碟或者光盘等各种可存储程序代码的介质。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments are realized. The processes can be completed by computer programs to instruct related hardware. The programs can be stored in computer-readable storage media. When the programs are executed , may include the processes of the foregoing method embodiments. The aforementioned storage medium includes: various media capable of storing program codes such as read-only memory (ROM) or random access memory (RAM), magnetic disk or optical disk.
Claims (14)
- 一种图像处理方法,其特征在于,所述方法包括:An image processing method, characterized in that the method comprises:获取待处理图像、第一阈值、第二阈值和第三阈值,所述第一阈值和所述第二阈值不同,所述第一阈值和所述第三阈值不同,所述第二阈值小于等于所述第三阈值;Acquire the image to be processed, a first threshold, a second threshold, and a third threshold, the first threshold is different from the second threshold, the first threshold is different from the third threshold, and the second threshold is less than or equal to said third threshold;确定所述待处理图像的待测区域中第一像素点的第一数量;所述第一像素点为颜色值大于等于所述第二阈值、且小于等于所述第三阈值的像素点;determining a first number of first pixels in the region to be measured of the image to be processed; the first pixels are pixels whose color values are greater than or equal to the second threshold and less than or equal to the third threshold;依据所述第一数量与所述待测区域内像素点的数量的第一比值和所述第一阈值,得到所述待处理图像的皮肤遮挡检测结果。A skin occlusion detection result of the image to be processed is obtained according to a first ratio of the first number to the number of pixels in the region to be detected and the first threshold.
- 根据权利要求1所述方法,其特征在于,所述确定所述待处理图像的所述待测区域中第一像素点的第一数量,包括:The method according to claim 1, wherein the determining the first number of first pixels in the region to be measured of the image to be processed comprises:对所述待处理图像进行人脸检测处理,得到第一人脸框;Performing face detection processing on the image to be processed to obtain a first face frame;依据所述第一人脸框,从所述待处理图像中确定所述待测区域;Determining the region to be detected from the image to be processed according to the first face frame;确定所述待测区域中所述第一像素点的第一数量。A first quantity of the first pixel points in the region to be tested is determined.
- 根据权利要求2所述方法,其特征在于,所述第一人脸框包括上框线和下框线;所述上框线和所述下框线均为所述第一人脸框中平行于所述待处理图像的像素坐标系的横轴的边,且所述上框线的纵坐标小于所述下框线的纵坐标;所述依据所述第一人脸框,从所述待处理图像中确定所述待测区域,包括:The method according to claim 2, wherein the first human face frame includes an upper frame line and a lower frame line; both the upper frame line and the lower frame line are parallel in the first human face frame On the side of the horizontal axis of the pixel coordinate system of the image to be processed, and the vertical coordinate of the upper frame line is smaller than the vertical coordinate of the lower frame line; Determining the area to be tested in the processed image includes:对所述待处理图像进行人脸关键点检测,得到至少一个人脸关键点;所述至少一个人脸关键点包括左眉毛关键点和右眉毛关键点;Carrying out human face key point detection on the image to be processed to obtain at least one human face key point; the at least one human face key point includes a left eyebrow key point and a right eyebrow key point;在保持所述上框线的纵坐标不变的情况下,将所述下框线沿所述待处理图像的像素坐标系的纵轴的负方向移动,使得所述下框线所在直线与第一直线重合,得到第二人脸框;所述第一直线为过所述左眉毛关键点和所述右眉毛关键点的直线;In the case of keeping the vertical coordinate of the upper frame line unchanged, move the lower frame line along the negative direction of the vertical axis of the pixel coordinate system of the image to be processed, so that the line where the lower frame line is located is in line with the first A straight line overlaps to obtain the second human face frame; the first straight line is a straight line passing through the left eyebrow key point and the right eyebrow key point;依据所述第二人脸框包含的区域,得到所述待测区域。The region to be detected is obtained according to the region included in the second human face frame.
- 根据权利要求3所述方法,其特征在于,所述依据所述第二人脸框包含的区域,得到所述待测区域,包括:The method according to claim 3, wherein the obtaining the region to be tested according to the region contained in the second human face frame includes:在保持所述第二人脸框的下框线的纵坐标不变的情况下,将所述第二人脸框的上框线沿所述待处理图像的像素坐标系的纵轴移动,使得所述第二人脸框的上框线和所述第二人脸框的下框线之间的距离为预设距离,得到第三人脸框;Under the condition of keeping the ordinate of the lower frame line of the second human face frame unchanged, move the upper frame line of the second human face frame along the vertical axis of the pixel coordinate system of the image to be processed, so that The distance between the upper frame line of the second human face frame and the lower frame line of the second human face frame is a preset distance to obtain a third human face frame;依据所述第三人脸框包含的区域,得到所述待测区域。The region to be detected is obtained according to the region included in the third human face frame.
- 根据权利要求4所述方法,其特征在于,所述至少一个人脸关键点还包括左嘴角关键点和右嘴角关键点;所述第一人脸框还包括左框线和右框线;所述左框线和所述右框线均为所述第一人脸框中平行于所述待处理图像的像素坐标系的纵轴的边,且所述左框线的横坐标小于所述右框线的横坐标;所述依据所述第三人脸框包含的区域,得到所述待测区域,包括:The method according to claim 4, wherein said at least one human face key point also includes a left mouth corner key point and a right mouth corner key point; said first human face frame also includes a left frame line and a right frame line; Both the left frame line and the right frame line are sides parallel to the vertical axis of the pixel coordinate system of the image to be processed in the first face frame, and the abscissa of the left frame line is smaller than the right The abscissa of frame line; Described according to the area that described the 3rd people's face frame comprises, obtain described area to be tested, comprise:在保持所述第三人脸框的左框线的横坐标不变的情况下,将所述第三人脸框的右框线沿所述待处理图像的像素坐标系的横轴移动,使得所述第三人脸框的右框线和所述第三人脸框的左框线之间的距离为参考距离,得到第四人脸框;所述参考距离为第二直线与所述第三人脸框包含的人脸轮廓的两个交点之间的距离;所述第二直线为在所述第一直线和第三直线之间且平行于所述第一直线或所述第三直线的直线;所述第三直线为过所述左嘴角关键点和所述右嘴角关键点的直线;While keeping the abscissa of the left frame line of the third face frame unchanged, move the right frame line of the third face frame along the abscissa of the pixel coordinate system of the image to be processed, so that The distance between the right frame line of the third human face frame and the left frame line of the third human face frame is a reference distance to obtain a fourth human face frame; the reference distance is the second straight line and the first straight line The distance between two intersection points of the human face contours contained in the three human face frames; the second straight line is between the first straight line and the third straight line and parallel to the first straight line or the first straight line A straight line of three straight lines; the third straight line is a straight line passing through the key point of the left corner of the mouth and the key point of the right corner of the mouth;将所述第四人脸框包含的区域作为所述待测区域。The region included in the fourth human face frame is used as the region to be detected.
- 根据权利要求2至5中任意一项所述方法,其特征在于,所述获取第二阈值和第三阈值,包括:The method according to any one of claims 2 to 5, wherein said obtaining the second threshold and the third threshold comprises:从所述第一人脸框包含的像素点区域中确定皮肤像素点区域;Determining the skin pixel point area from the pixel point area included in the first human face frame;获取所述皮肤像素点区域中第二像素点的颜色值;Acquiring the color value of the second pixel in the skin pixel area;将所述第二像素点的颜色值与第一值的差作为所述第二阈值,using the difference between the color value of the second pixel point and the first value as the second threshold,将所述第二像素点的颜色值与第二值的和作为所述第三阈值;其中,所述第一值和所述第二值均不超过所述待处理图像的颜色值中的最大值。Taking the sum of the color value of the second pixel and the second value as the third threshold; wherein neither the first value nor the second value exceeds the maximum color value of the image to be processed value.
- 根据权利要求6所述方法,其特征在于,所述从所述第一人脸框包含的像素点区域中确定皮肤像素点区域,包括:The method according to claim 6, wherein the determining the skin pixel area from the pixel area included in the first human face frame comprises:在检测到所述待处理图像中人脸区域未佩戴口罩的情况下,将所述人脸区域中除额头区域、嘴巴区域、眉毛区域和眼睛区域之外的像素点区域,作为所述皮肤像素点区域;When it is detected that the face area in the image to be processed does not wear a mask, the pixel point area in the face area except the forehead area, mouth area, eyebrow area and eye area is used as the skin pixel point area;在检测到所述待处理图像中人脸区域佩戴口罩的情况下,将所述第一直线和第四直线之间的像素点区域作为所述皮肤像素点区域;所述第四直线为过左眼下眼睑关键点和右眼下眼睑关键点的直线;所述左眼下眼睑关键点和所述右眼下眼睑关键点均属于所述至少一个人脸关键点。When it is detected that the face area in the image to be processed wears a mask, the pixel point area between the first straight line and the fourth straight line is used as the skin pixel point area; The straight line of the key point of the lower eyelid of the left eye and the key point of the lower eyelid of the right eye; the key point of the lower eyelid of the left eye and the key point of the lower eyelid of the right eye belong to the at least one human face key point.
- 根据权利要求6或7所述方法,其特征在于,所述获取所述皮肤像素点区域中第二像素点的颜色值,包括:The method according to claim 6 or 7, wherein said acquiring the color value of the second pixel in the skin pixel area comprises:在所述至少一个人脸关键点包含属于左眉内侧区域中的至少一个第一关键点,且所述至少一个人脸关键点包含属于右眉内侧区域中的至少一个第二关键点的情况下,根据所述至少一个第一关键点和所述至少一个第二关键点确定矩形区域;In the case where the at least one human face key point includes at least one first key point belonging to the inner area of the left eyebrow, and the at least one human face key point includes at least one second key point belonging to the inner area of the right eyebrow , determining a rectangular area according to the at least one first key point and the at least one second key point;对所述矩形区域进行灰度化处理,得到所述矩形区域的灰度图;performing grayscale processing on the rectangular area to obtain a grayscale image of the rectangular area;将第一行和第一列的交点的颜色值作为所述第二像素点的颜色值;所述第一行为所述灰度图中灰度值之和最大的行,所述第一列为所述灰度图中灰度值之和最大的列。The color value of the intersection point of the first row and the first column is used as the color value of the second pixel point; the first row is the row with the largest sum of grayscale values in the grayscale image, and the first column is The column with the largest sum of grayscale values in the grayscale image.
- 根据权利要求1至8中任意一项所述方法,其特征在于,所述依据所述第一数量与所述待测区域内像素点的数量的第一比值和所述第一阈值,得到所述待处理图像的皮肤遮挡检测结果,包括:The method according to any one of claims 1 to 8, characterized in that, according to the first ratio of the first number to the number of pixels in the region to be tested and the first threshold, the obtained Describe the skin occlusion detection results of the image to be processed, including:在所述第一比值未超过所述第一阈值的情况下,确定所述皮肤遮挡检测结果为所述待测区域对应的皮肤区域处于遮挡状态;If the first ratio does not exceed the first threshold, determine that the skin occlusion detection result indicates that the skin area corresponding to the area to be tested is in an occlusion state;在所述第一比值超过所述第一阈值的情况下,确定所述皮肤遮挡检测结果为所述待测区域对应的皮肤区域处于未遮挡状态。In a case where the first ratio exceeds the first threshold, it is determined that the skin occlusion detection result indicates that the skin area corresponding to the area to be detected is in an unoccluded state.
- 根据权利要求9所述的方法,其特征在于,所述皮肤区域属于待检测人物,所述方法还包括:The method according to claim 9, wherein the skin area belongs to a person to be detected, and the method further comprises:获取所述待处理图像的温度热力图;Acquiring a temperature thermodynamic map of the image to be processed;在所述皮肤遮挡检测结果为所述皮肤区域处于未遮挡状态的情况下,从所述温度热力图中读取所述皮肤区域的温度,作为所述待检测人物的体温。If the skin occlusion detection result shows that the skin area is in an unoccluded state, read the temperature of the skin area from the temperature thermodynamic map as the body temperature of the person to be detected.
- 一种图像处理装置,其特征在于,所述装置包括:An image processing device, characterized in that the device comprises:获取单元,用于获取待处理图像、第一阈值、第二阈值和第三阈值,所述第一阈值和所述第二阈值不同,所述第一阈值和所述第三阈值不同,所述第二阈值小于等于所述第三阈值;an acquiring unit, configured to acquire an image to be processed, a first threshold, a second threshold, and a third threshold, the first threshold is different from the second threshold, the first threshold is different from the third threshold, and the The second threshold is less than or equal to the third threshold;第一处理单元,用于确定所述待处理图像的待测区域中第一像素点的第一数量;所述第一像素点为颜色值大于等于所述第二阈值且小于等于所述第三阈值的像素点;A first processing unit, configured to determine a first number of first pixels in the region to be detected of the image to be processed; the first pixel is a color value greater than or equal to the second threshold and less than or equal to the third threshold Threshold pixels;检测单元,用于依据所述第一数量与所述待测区域内像素点的数量的第一比值和所述第一阈值,得到所述待处理图像的皮肤遮挡检测结果。A detection unit, configured to obtain a skin occlusion detection result of the image to be processed according to a first ratio of the first number to the number of pixels in the region to be detected and the first threshold.
- 一种处理器,其特征在于,所述处理器用于执行如权利要求1至10中任意一项所述的方法。A processor, wherein the processor is configured to execute the method according to any one of claims 1-10.
- 一种电子设备,其特征在于,包括:处理器和存储器,所述存储器用于存储计算机程序代码,所述计算机程序代码包括计算机指令,在所述处理器执行所述计算机指令的情况下,所述电子设备执行如权利要求1至10中任意一项所述的方法。An electronic device, characterized in that it includes: a processor and a memory, the memory is used to store computer program codes, the computer program codes include computer instructions, and when the processor executes the computer instructions, the The electronic device executes the method according to any one of claims 1-10.
- 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有计算机程序,所述计算机程序包括程序指令,在所述程序指令被处理器执行的情况下,使所述处理器执行权利要求1至10中任意一项所述的方法。A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, the computer program includes program instructions, and when the program instructions are executed by a processor, the processing The device performs the method according to any one of claims 1 to 10.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110600103.1A CN113222973B (en) | 2021-05-31 | 2021-05-31 | Image processing method and device, processor, electronic equipment and storage medium |
CN202110600103.1 | 2021-05-31 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2022252737A1 true WO2022252737A1 (en) | 2022-12-08 |
Family
ID=77082028
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2022/080403 WO2022252737A1 (en) | 2021-05-31 | 2022-03-11 | Image processing method and apparatus, processor, electronic device, and storage medium |
Country Status (3)
Country | Link |
---|---|
CN (1) | CN113222973B (en) |
TW (1) | TWI787113B (en) |
WO (1) | WO2022252737A1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117495855A (en) * | 2023-12-29 | 2024-02-02 | 广州中科医疗美容仪器有限公司 | Skin defect evaluation method and system based on image processing |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113222973B (en) * | 2021-05-31 | 2024-03-08 | 深圳市商汤科技有限公司 | Image processing method and device, processor, electronic equipment and storage medium |
CN113592884B (en) * | 2021-08-19 | 2022-08-09 | 遨博(北京)智能科技有限公司 | Human body mask generation method |
CN113936292A (en) * | 2021-09-01 | 2022-01-14 | 北京旷视科技有限公司 | Skin detection method, device, equipment and medium |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108319953A (en) * | 2017-07-27 | 2018-07-24 | 腾讯科技(深圳)有限公司 | Occlusion detection method and device, electronic equipment and the storage medium of target object |
CN108427918A (en) * | 2018-02-12 | 2018-08-21 | 杭州电子科技大学 | Face method for secret protection based on image processing techniques |
CN110532871A (en) * | 2019-07-24 | 2019-12-03 | 华为技术有限公司 | The method and apparatus of image procossing |
US20200104570A1 (en) * | 2018-09-28 | 2020-04-02 | Apple Inc. | Network performance by including attributes |
CN111428581A (en) * | 2020-03-05 | 2020-07-17 | 平安科技(深圳)有限公司 | Face shielding detection method and system |
CN112633144A (en) * | 2020-12-21 | 2021-04-09 | 平安科技(深圳)有限公司 | Face occlusion detection method, system, device and storage medium |
CN113222973A (en) * | 2021-05-31 | 2021-08-06 | 深圳市商汤科技有限公司 | Image processing method and device, processor, electronic device and storage medium |
Family Cites Families (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105426870B (en) * | 2015-12-15 | 2019-09-24 | 北京文安智能技术股份有限公司 | A kind of face key independent positioning method and device |
CN105740758A (en) * | 2015-12-31 | 2016-07-06 | 上海极链网络科技有限公司 | Internet video face recognition method based on deep learning |
CN107145833A (en) * | 2017-04-11 | 2017-09-08 | 腾讯科技(上海)有限公司 | The determination method and apparatus of human face region |
TWI639137B (en) * | 2017-04-27 | 2018-10-21 | 立特克科技股份有限公司 | Skin detection device and the method therefor |
CN107633252B (en) * | 2017-09-19 | 2020-04-21 | 广州市百果园信息技术有限公司 | Skin color detection method, device and storage medium |
CN110443747B (en) * | 2019-07-30 | 2023-04-18 | Oppo广东移动通信有限公司 | Image processing method, device, terminal and computer readable storage medium |
CN111524080A (en) * | 2020-04-22 | 2020-08-11 | 杭州夭灵夭智能科技有限公司 | Face skin feature identification method, terminal and computer equipment |
CN112861661B (en) * | 2021-01-22 | 2022-11-08 | 深圳市慧鲤科技有限公司 | Image processing method and device, electronic equipment and computer readable storage medium |
CN112836625A (en) * | 2021-01-29 | 2021-05-25 | 汉王科技股份有限公司 | Face living body detection method and device and electronic equipment |
-
2021
- 2021-05-31 CN CN202110600103.1A patent/CN113222973B/en active Active
-
2022
- 2022-03-11 WO PCT/CN2022/080403 patent/WO2022252737A1/en active Application Filing
- 2022-04-19 TW TW111114745A patent/TWI787113B/en not_active IP Right Cessation
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108319953A (en) * | 2017-07-27 | 2018-07-24 | 腾讯科技(深圳)有限公司 | Occlusion detection method and device, electronic equipment and the storage medium of target object |
CN108427918A (en) * | 2018-02-12 | 2018-08-21 | 杭州电子科技大学 | Face method for secret protection based on image processing techniques |
US20200104570A1 (en) * | 2018-09-28 | 2020-04-02 | Apple Inc. | Network performance by including attributes |
CN110532871A (en) * | 2019-07-24 | 2019-12-03 | 华为技术有限公司 | The method and apparatus of image procossing |
CN111428581A (en) * | 2020-03-05 | 2020-07-17 | 平安科技(深圳)有限公司 | Face shielding detection method and system |
CN112633144A (en) * | 2020-12-21 | 2021-04-09 | 平安科技(深圳)有限公司 | Face occlusion detection method, system, device and storage medium |
CN113222973A (en) * | 2021-05-31 | 2021-08-06 | 深圳市商汤科技有限公司 | Image processing method and device, processor, electronic device and storage medium |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117495855A (en) * | 2023-12-29 | 2024-02-02 | 广州中科医疗美容仪器有限公司 | Skin defect evaluation method and system based on image processing |
CN117495855B (en) * | 2023-12-29 | 2024-03-29 | 广州中科医疗美容仪器有限公司 | Skin defect evaluation method and system based on image processing |
Also Published As
Publication number | Publication date |
---|---|
CN113222973A (en) | 2021-08-06 |
CN113222973B (en) | 2024-03-08 |
TW202248954A (en) | 2022-12-16 |
TWI787113B (en) | 2022-12-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2022252737A1 (en) | Image processing method and apparatus, processor, electronic device, and storage medium | |
Kumar et al. | Face detection techniques: a review | |
US10783354B2 (en) | Facial image processing method and apparatus, and storage medium | |
US11043011B2 (en) | Image processing method, apparatus, terminal, and storage medium for fusing images of two objects | |
TWI777092B (en) | Image processing method, electronic device, and storage medium | |
WO2020215552A1 (en) | Multi-target tracking method, apparatus, computer device, and storage medium | |
WO2018188453A1 (en) | Method for determining human face area, storage medium, and computer device | |
US11361587B2 (en) | Age recognition method, storage medium and electronic device | |
CN111539276B (en) | Method for detecting safety helmet in real time in power scene | |
WO2022267653A1 (en) | Image processing method, electronic device, and computer readable storage medium | |
CN112232205B (en) | Mobile terminal CPU real-time multifunctional face detection method | |
CN110751635A (en) | Oral cavity detection method based on interframe difference and HSV color space | |
CN117133032A (en) | Personnel identification and positioning method based on RGB-D image under face shielding condition | |
Spivak et al. | Approach to Recognizing of Visualized Human Emotions for Marketing Decision Making Systems. | |
WO2018113206A1 (en) | Image processing method and terminal | |
RU2768797C1 (en) | Method and system for determining synthetically modified face images on video | |
Xiao et al. | Facial mask detection system based on YOLOv4 algorithm | |
CN116895090A (en) | Face five sense organ state detection method and system based on machine vision | |
KR102066892B1 (en) | Make-up evaluation system and operating method thereof | |
CN115995097A (en) | Deep learning-based safety helmet wearing standard judging method | |
KR20050052657A (en) | Vision-based humanbeing detection method and apparatus | |
Sun et al. | Flame Image Detection Algorithm Based onComputer Vision. | |
JP6467994B2 (en) | Image processing program, image processing apparatus, and image processing method | |
CN112818728B (en) | Age identification method and related products | |
JP2018147046A (en) | Face detection device and method for controlling the same |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 22814785 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 22814785 Country of ref document: EP Kind code of ref document: A1 |