Image processing device, image processing method, and program
Patent Information
- Application Number
- JP2021152320
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2021-03-26
- Filing Date
- 2021-09-17
- Publication Date
- 2024-09-19
- Estimated Expiration
- 2041-09-17
AI Technical Summary
Existing methods for estimating pulse information from images face challenges in accurately identifying skin color due to mixing with hair and background colors in large face detection frames and require repetitive processing, leading to inefficiencies and incorrect pulse estimation.
An image processing device that dynamically determines the skin color range using color information statistics within an elliptical region, adjusting for lighting conditions and individual variations, and applies a background mask to exclude non-skin color areas.
Enables rapid and accurate setting of the skin color range for pulse estimation, ensuring stable pulse estimation even in varying lighting and environmental conditions.
Abstract
Description
Technical Field
[0001] The present invention relates to a technique for estimating pulse information from an image.
Background Art
[0002] As a means for obtaining pulse information from an image, there is a method that assumes a certain illumination environment, extracts a partial region of the face, obtains the change in skin color within that region, and measures the period of the change. Patent Document 1 detects a face from an image, generates a color histogram from the region including the detected face, and specifies the range of skin color in the image (values in color spaces such as YUV, RGB, HSV, etc.) based on that histogram. Further, Patent Document 2 repeatedly performs face detection and skin color region detection while relaxing the skin color condition for the image, and specifies the range of skin color when the ratio of the area of the face detection region to the area of the skin color region exceeds a predetermined value and a face is detected.
Prior Art Documents
Patent Documents
[0003]
Patent Document 1
Patent Document 2
Summary of the Invention
Problems to be Solved by the Invention
[0004] However, in the method of Patent Document 1, when specifying skin color within a large face detection frame, the color of hair and background is mixed, and when specifying skin color within a small face detection frame, the color outside the cheeks and forehead is excluded, so it may not be possible to appropriately specify the range of skin color. Further, in the method of Patent Document 2, since face detection and skin color region detection are repeated while relaxing the skin color condition for the image, the processing takes time. The present invention has been made in view of the above problems, and an object thereof is to quickly set an appropriate range of skin color.
Means for Solving the Problems
[0005] The present invention relates to an image processing apparatus for estimating the pulse rate of a person detected from an image, and is characterized by comprising: setting means for setting an elliptical region including a face identified from an image; acquisition means for acquiring color information of pixels included in the set elliptical region; determination means for determining whether the acquired color information satisfies predetermined conditions; and, if the determination means determines that the acquired color information satisfies the predetermined conditions, determination means for determining a threshold indicating the range of skin color based on the color information in the elliptical region. [Effects of the Invention]
[0006] This invention allows for the rapid setting of an appropriate skin tone range. [Brief explanation of the drawing]
[0007] [Figure 1] This is a block diagram showing an example of the hardware configuration of an image processing device. [Figure 2] This is a block diagram showing an example of the functional configuration of an image processing device. [Figure 3] This is a flowchart illustrating the processes performed by an image processing device. [Figure 4] This is a flowchart illustrating the processes performed by an image processing device. [Figure 5] (A)~(C) These figures show examples of images to be processed. [Figure 6] This table shows an example of a skin tone threshold determination table. [Figure 7] This is a flowchart illustrating the processes performed by an image processing device. [Figure 8] This figure shows an example of a variation. [Figure 9] This is a block diagram showing an example of the functional configuration of an image processing device. [Figure 10] This is a flowchart illustrating the processes performed by an image processing device. [Figure 11]This figure shows an example of a background mask. [Figure 12] This is a flowchart illustrating the processes performed by an image processing device. [Figure 13] This is a flowchart illustrating the processes performed by an image processing device. [Figure 14] (A)~(D) These figures show examples of saturation threshold correction processes. [Figure 15] This is a flowchart illustrating the processes performed by an image processing device. [Figure 16] (A)~(F) This figure shows an example of threshold correction processing. [Figure 17] (A) to (G) are diagrams showing examples of threshold correction processes. [Figure 18] (A) to (G) are diagrams showing examples of threshold correction processes. [Modes for carrying out the invention]
[0008] Hereinafter, preferred embodiments of the present invention will be described with reference to the drawings.
[0009] <Embodiment 1> One method for obtaining pulse information from images involves assuming a constant lighting environment, extracting a portion of the face, determining the change in skin color within that area, and measuring the period of change. However, when extracting a portion of the face, it is susceptible to influences from the direction of lighting and the orientation of the face. Therefore, when the subject's position cannot be predetermined, such as with surveillance cameras, it is necessary to consider that the appearance of skin color will fluctuate. Furthermore, if the conditions for the skin color of the entire face are fixed in advance, deviations from the fixed value may occur due to individual differences, differences in cameras, and the color temperature of the lighting. If these deviations flicker over time, noise is introduced into the period of change in the target color, making it impossible to accurately estimate the pulse. Based on these considerations, this paper describes a method for dynamically determining the definition of skin color (range of RGB values) in an image so that pulse estimation from images is stable even when the shooting conditions are not constant.
[0010] FIG. 1 is a block diagram showing an example of the hardware configuration of the image processing apparatus according to the present embodiment. The central processing unit (CPU) 11 reads and executes an OS and other programs stored in the ROM 12 and the storage device 14 using the RAM 13 as a work memory, controls each component connected to the system bus 19, and performs operations such as arithmetic operations and logical judgments of various processes. The processing executed by the CPU 11 includes the image processing of the embodiment. The storage device 14 is a hard disk drive, an external storage device, etc., and stores programs and various data related to the image processing of the embodiment. The input unit 15 is an input device such as an imaging device such as a camera, a button for inputting user instructions, a keyboard, a touch panel, etc. Note that the storage device 14 is connected to the system bus 19 via an interface such as SATA, and the input unit 15 is connected to the system bus 19 via a serial bus such as USB, but their details are omitted. The communication I / F 16 communicates with external devices by wireless communication. The display unit 17 is a display. The sensor 18 is an image sensor or a distance sensor. Note that the image processing apparatus does not have to have a part of the hardware described here. For example, when the image processing apparatus is a network camera, an input device such as a keyboard or the display unit 17 may or may not be provided.
[0011] FIG. 2 is a block diagram showing an example of the functional configuration of the image processing apparatus 1. The image processing apparatus 1 estimates the pulse of a person detected from an image. The image processing apparatus 1 includes an image acquisition unit 101, a face detection unit 102, a skin color threshold determination unit 103, a skin color region detection unit 104, a hue calculation unit 105, a hue change management unit 106, a pulse estimation unit 107, and a pulse recording unit 108. Note that an imaging device that acquires an image and an output device that displays the result of pulse estimation may be connected as external devices.
[0012] The image acquisition unit 101 acquires an image in which a target person is imaged. For example, an image captured by an imaging unit included in the image processing apparatus 1 may be acquired, or an image may be acquired from a video stored in a storage unit.
[0013] The face detection unit 102 detects faces from the acquired images. Face tracking may be performed by detecting faces over multiple frames. The face detection method uses existing image recognition techniques. Specifically, a face detector trained on face images in a neural network may be used, or detection may be performed by template matching of face images. Alternatively, a screen may be generated to guide the target person into a predetermined field of view, and a face image may be obtained by extracting the face region from the image when the person is within the frame of that screen. In any case, it is sufficient that the size of the face in the image is above a certain level, and the orientation of the face and lighting conditions do not necessarily need to be constant. Although pulse estimation can be performed with greater accuracy if the orientation of the face and lighting conditions are constant, this embodiment can suitably perform pulse estimation even when the orientation of the face and lighting conditions fluctuate to some extent.
[0014] The skin tone threshold determination unit 103 determines the threshold (conditions for extracting color information as skin tone) for the target color (in this case, skin tone) in the input video based on the color information in the face region. First, the skin tone threshold determination unit 103 sets an elliptical region containing the face identified from the image. Next, it acquires color information such as hue from each pixel in the set elliptical region. Color information refers to hue, saturation, and brightness. Furthermore, it determines whether the color information satisfies predetermined conditions based on the statistical values of the acquired color information. The statistical values of color information refer to the mean and standard deviation of hue, saturation, and brightness. If the statistical values of the color information contained in the set elliptical region satisfy the conditions, the threshold of the color information to be extracted as skin tone is determined based on that color information. Details will be described later. Since the color information to be extracted as skin tone differs depending on the lighting conditions of the video or the skin tone of the subject, specifying the skin tone threshold for each video makes it possible to estimate pulse rate robustly to lighting conditions, face orientation, and individual characteristics.
[0015] The skin tone region determination unit 104 acquires a partial image (skin tone region) from the image to be used for pulse estimation based on the threshold color of the determined target. Details will be described later. The hue calculation unit 105 calculates the hue based on the color information of each pixel in the determined skin tone region. The hue change management unit 106 calculates the hue change (frequency) based on the hue calculated in multiple frames. The pulse estimation unit 107 estimates the pulse of the target person from the calculated hue frequency. Estimating the pulse from an image has the advantage of allowing the health status of a person to be checked even from a distance. Details will be described later. The above is a brief explanation of the processing of each functional unit.
[0016] Next, we will explain the processes performed by each functional unit using the flowchart in Figure 3. In the following explanation, we will omit the notation of each process (step) by prefixing it with "S". However, it is not necessary to perform all the steps described in this flowchart.
[0017] In S201, the image acquisition unit 101 acquires images one frame at a time from the video captured by the imaging device. In S202, the image acquisition unit 101 determines whether imaging by the imaging device has finished. If imaging is continuing, it proceeds to S203; if it has finished, it terminates the pulse estimation process. The decision to continue processing may also be made based on user instructions. If processing continues, in S203, the face detection unit 102 detects faces from the acquired images. Since images of multiple frames are acquired, faces are detected from each image. If multiple faces are included, the faces of the same person are associated. In S204, the face detection unit 102 determines the image to output for the next process for each detected person. Processing from S205 to S211 is performed for all detected faces. In S205, the skin tone threshold determination unit 103 determines whether the input image is the first face image in which the target person was detected. If it is the first face image, the skin tone threshold is determined in S206, and the process proceeds to S207. The processing in S206 will be described later. If it is not the first face image, proceed directly to S207. Note that the determination here can be made by any method as long as it can be determined whether or not a skin tone threshold has been determined for the target person. For example, if the face detection unit 102 performs face authentication with a registered person and a registered person is detected and the skin tone threshold corresponding to that person is stored, the process may proceed to S207. Also, if detection results for multiple frames have been obtained for a certain target person, an image for determining the skin tone threshold may be obtained from any image. Here, face detection is performed frame by frame, and if a person who has not been detected before is detected, proceed to S206. If a person who has been detected before is detected, determine from the corresponding tracking information that it is not the first image and proceed to S207. The processing of S206 will be described later, and the processing of S207 will be explained first.
[0018] In S207, the skin tone region extraction unit 104 uses a skin tone threshold determined for each target person to extract pixels with skin tone color information within a set face region as skin tone regions. At this time, the detected face frame (a rectangular bounding box) is enlarged, for example, by 1.5 times so that all of the skin tone regions of the face fit within the detection target frame, and skin tone regions are detected for all pixels within that frame.
[0019] In S208, the hue calculation unit 105 calculates and records the average hue of the detected skin-colored region. In S209, the hue change management unit 106 determines whether the number of frames for which the average hue value has been recorded meets a predetermined number. If the predetermined number is met, the process proceeds to S210. In S210, the pulse estimation unit 107 performs pulse estimation using the change in the average hue value, and in S211, the pulse rate subcostal unit 108 records the pulse value. Once pulse estimation for a person is complete, the process returns to S204 and performs pulse estimation again for the next person. When pulse estimation processing is completed for all detected face tracking, the process proceeds to S201 and continues processing the next image.
[0020] Regarding pulse rate estimation methods, there are various methods such as calculating the moving average of the intervals between peaks, performing frequency spectrum analysis, and performing principal component analysis, and this invention does not limit the pulse rate estimation method.
[0021] In this example, the skin tone threshold was determined based on the first face image during tracking, but it is also possible to determine the skin tone threshold for intermediate images during tracking if certain conditions are met. For example, the threshold could be determined based on when the size of the skin tone area is maximized. Alternatively, the threshold could be determined when the tracked subject moves a certain distance, when the hue change value exceeds a certain level, or when the face direction changes by adding a means to detect face direction. Furthermore, although face tracking is performed in this example, it is also possible to perform full-body tracking and consider images with the same tracking ID as the same person. If the same person is considered through full-body tracking even when the face is not visible, there is no need to change the skin tone threshold when the face is next visible.
[0022] Figure 4 is a subflowchart of S206, and Figure 5 is a diagram showing an example of skin tone threshold determination.
[0023] In S301, the skin tone threshold determination unit 103 sets a frame corresponding to the face region in the input image based on the face detected by the face detection unit 102. Here, while the face detected by the face detection unit 102 is rectangular, an elliptical frame is set as the frame corresponding to the face region. That is, the initial setting of the elliptical face frame is performed. For example, 401 in Figure 5(A) is the image (input image) acquired by the image acquisition unit 101, 402 and 403 are the tracking results of face tracking, and 404 and 405 are the face frame (rectangular bounding box) detected by face tracking 102. In this example, the face detection frame tends to be detected as smaller than the entire face, and it needs to be enlarged to include the entire face. As shown in 406 in Figure 5(B) and 410 in Figure 5(C), a frame about 1.5 times the size of the face detection frames 404 and 405 is set. If the classifier of the face detection unit 102 is trained to detect faces in a larger size, such as 406, it is advisable to adjust the enlargement or reduction of the face detection frame to match the trend of that detection frame. Next, an ellipse with a predetermined ratio is initially placed within the face detection frame. This ellipse is set to be larger than the face detection frame and to enclose the face detection frame. In this example, the ellipse ratio of the enlarged face frame is set to 0.85 (vertical 1 horizontal 0.85) as the initial face frame ellipse. 407 in Figure 5(B) and 411 in Figure 5(C) are examples of this. This initial ellipse ratio should be determined in advance by investigating the trend of face detection size.
[0024] In S302, the skin tone threshold determination unit 103 obtains HSV color information from the RGB values for all pixels within the set face frame ellipse. The method for converting from RGB to HSV is known, so the explanation is omitted. Next, in S303, the skin tone threshold determination unit 103 calculates the mean and standard deviation of each HSV value.
[0025] In S304, the skin tone threshold determination unit 103 determines whether the standard deviation of H is less than or equal to the target value, and in S305, the skin tone threshold determination unit 103 determines whether the standard deviation of V is less than or equal to the target value. If either is greater than the target value, the process proceeds to S308 to shrink the face frame ellipse, and in S303, the mean and standard deviation of the HSV of the pixels within the shrunk face frame ellipse are calculated. Since the HSV values have already been calculated for all pixels within the original face frame ellipse, there is no need to calculate them again. Figures 5(B) 408 and 409 and Figures 5(C) 412-412 are examples of the shrunk face frame ellipse. When shrinking the ellipse, the vertical dimension may be reduced by a ratio of 1 / 2 to the horizontal dimension. An ellipse ratio of 0.85 results in a vertical of 1 and a horizontal of 0.85, while an ellipse ratio of 0.80 results in a vertical of 0.975 and a horizontal of 0.80.
[0026] If the standard deviations of both H and V fall below the target value, the process proceeds to S306, where the skin tone threshold determination unit 103 sets the thresholds (ranges) for H and S. The thresholds are determined using the mean value as the center, with the standard deviation multiplied by a predetermined multiple A. The value obtained by subtracting this from the mean is set as the lower threshold (minimum value of the range), and the value obtained by adding this to the mean is set as the upper threshold (maximum value of the range). In addition, when determining the threshold for S, a predetermined multiple A2, separate from the predetermined multiple A for H, may be provided to determine the range.
[0027] In S307, the skin tone threshold determination unit 103 determines the threshold for V. The threshold may be determined in the same way as for HS, but in facial images, the standard deviation of V tends to be larger than that of H and S, so determining the range with the same multiple as H and S would result in a wider range. Within the range of a first predetermined value indicating the lower limit of the target value and a second predetermined value indicating the upper limit of the target value, a pre-set fixed value is used. If the average value is smaller than the first predetermined value, the threshold is determined based on statistical values. That is, the lower limit threshold is obtained by subtracting the value of the average by multiplying the standard deviation by a predetermined multiple B. The upper limit threshold remains fixed. Also, if the average value of V is larger than the second predetermined value, the threshold is determined based on statistical values. That is, the lower limit threshold is obtained by subtracting the value of the average by multiplying the standard deviation by a predetermined multiple B, and the upper limit threshold is obtained by adding the value of the average by multiplying the standard deviation by a predetermined multiple C. The predetermined multiples A, B, and C are those determined experimentally.
[0028] In addition, S304 determines whether the standard deviation of H is below the target value, and S305 determines whether the standard deviation of V is below the target value. However, if either of them falls below the target value first, the mean and standard deviation at that time may be retained, and the mean and standard deviation at that time may be used for threshold determination. In addition, although S304 and S305 determine whether the standard deviations of H and V are below the target value, an individual target value may also be set for S, and the determination of whether it is below the target value may be made accordingly.
[0029] Figure 6 shows an example of the ellipse ratio, mean, and standard deviation of the HSV when the face frame ellipse is being reduced. When the value falls below the target value, the upper and lower limits are determined and thresholds are set for each tracking. In this example, the predetermined multiples A is 2.0, B is 0.6, and C is 2.0. The ellipse ratio to be reduced may be decreased at regular intervals. The reduction rate of the face frame ellipse may be increased by a predetermined percentage. Furthermore, the rate of change in the reduction rate may be increased when the value is far from the target value, and decreased as the value approaches the target value.
[0030] As described above, since the skin tone threshold can be determined for each person or shooting environment, pulse rate can be accurately estimated from images even when shooting conditions are not consistent.
[0031] <Embodiment 2> In Embodiment 1, in S206, the mean and standard deviation are calculated for all pixels within the ellipse. In this case, if the person has bangs covering their face or is wearing accessories such as glasses or a face mask, colors other than skin tone may be mixed within the ellipse of the face, and the color information for each color may not reach the target value. In such cases, the shape of the ellipse may be replaced, and the mean and standard deviation of each color information may be calculated accordingly.
[0032] Figure 7 is a flowchart illustrating the process performed by the image processing device when replacing the shape of the face frame ellipse in S206. The processes from S301 to S308 are the same as the corresponding code processes in Figure 4, so their explanation is omitted.
[0033] In S601, the skin tone threshold determination unit 103 determines whether the ellipse ratio is below a predetermined value (the reduction ratio is above a predetermined value). If it is below the predetermined value, ellipse shape replacement is performed in S602. Figures 701 to 703 in Figure 7 are candidate ellipse shapes for replacement. Pixels in the gray areas are not included in the calculation of the mean and standard deviation. 701 is a figure with bangs covering the face, 702 is a figure wearing a face mask, and 703 is a figure wearing sunglasses. Note that combinations of these may be created. The shape to be changed is arbitrarily selected, and if the ellipse ratio of that shape becomes below the predetermined value, the deformation region of another shape is set as the ellipse region. In S603, the skin tone threshold determination unit 103 sets the ellipse ratio to the initial ellipse ratio and proceeds to S303, repeating the process.
[0034] Furthermore, a means for detecting worn objects may be added to complement face detection. In that case, the corresponding elliptical shape is selected from the outset. For example, in the face detection unit 102, simultaneously with face detection, a detector that detects objects obscuring the face is used to detect specific objects such as worn objects (masks, glasses, sunglasses, etc.) or bangs. If a specific object is detected, the skin color threshold determination unit 103 sets different deformation regions corresponding to that specific object.
[0035] As described above, if there is any wear that obstructs the skin-colored area of the face, the shape of the elliptical face frame to be set is replaced with another shape. This makes it possible to set the skin-colored area while suppressing colors other than skin color, making it easier to set the skin color threshold and improving the accuracy of pulse estimation.
[0036] <Embodiment 3> If the background color is similar to skin tone and falls within the range of color information defined as skin tone, calculating the skin tone region using the determined threshold may result in the hue average being calculated including the background. In that case, the accuracy of pulse estimation may decrease. Therefore, when determining the skin tone threshold, it may be advisable to check the degree of confusion with the background color, and if confusion occurs, create a background mask to exclude the background region from subsequent skin tone region detection.
[0037] Figure 9 is a block diagram showing an image processing device 1 that performs a process to mask the background area. Components 101 to 108 have the same configuration as the image processing device in Figure 1, so their explanation is omitted. The background mask setting unit 801 sets a mask for the background area using a histogram based on the color information in the image.
[0038] Figure 10 is a flowchart illustrating the processes performed by the image processing device 1. Steps S201 to S211 are the same as in Figure 2, so their explanation is omitted. In S901, the skin tone region detection unit 104 performs skin tone region detection using the determined skin tone threshold. The background mask setting unit 801 sets the background mask in S902. The background mask may be set when there is confusion between the background color and the skin tone of the face, or it may be set even when there is no confusion between the background and the face. Details of the process in S902 will be described later.
[0039] In S903, the skin tone area detection unit 104 determines whether or not a background mask is set. If a background mask exists, in S904 the background mask is applied to the pixels within the face frame to exclude them from the detection target of the skin tone area, and the process proceeds to S208. In other words, the skin tone area detection unit 104 extracts the skin tone area from the area not included in the background mask. If there is no background mask, the process proceeds directly to S208.
[0040] Figure 11 shows an example of a background mask, and Figure 12 is a flowchart of the background mask setting process (S902). Face image 1001 in Figure 11 is an example where the skin tone of the face is similar to that of the background.
[0041] In S1101 of Figure 12, the background mask setting unit 801 generates a histogram showing the distribution of skin-colored pixels along the horizontal axis of the image. Figure 1002 of Figure 10 shows an example of the generated histogram. The x-axis represents the position of pixels in the horizontal direction of the image, and the y-axis represents the number of skin-colored pixels present at each x-coordinate. Here, the points 1003 and 1004, where the y-value drops near both ends, can be considered to represent the x-coordinates outside the face. In S1102, the background mask setting unit 801 determines whether or not there is confusion between the background and face colors based on the generated histogram. For example, if the shape of the histogram shows that the y-value is large outside the valleys on both sides, it is determined that there is confusion between the background color and the skin color. Two points with a pixel count lower than a predetermined value may be selected as the endpoints of the face, or endpoints with a minimum value may be searched based on the slope of the curve. To determine if images are confused, specifically, if the number of pixels in the range where the X-coordinate is smaller than the left endpoint is a predetermined amount greater than the number of pixels at the endpoint, or if the slope is a negative value, then the left half of the face and the background may have similar colors. The same applies to the right endpoint; by comparing the number of pixels in the range where the X-coordinate is larger than the right endpoint, or if the slope of the line graph in that range is a positive value, then it can be determined that the right endpoint is the edge of the face and the background is confused as being of the same color. Other methods may be used to determine whether a boundary between the face and the background is visible.
[0042] If S1103 determines that background skin tone confusion has occurred, the background mask setting unit 801 generates a background mask in S1104. If it determines that no confusion has occurred, a mask is not generated, and the process in S901 is terminated.
[0043] The background mask is an elliptical region that excludes areas where the y-value drops near both ends. In other words, the width of the background mask is determined based on the histogram. Note that the shape of the background mask is not limited to an ellipse; it may also be a shape like that shown in Figure 8. Figure 11, 1005 is the created background mask, and Figure 11, 1006 is the face image to which the background mask has been applied, which is created by the background mask generation process S904 in Figure 9. Note that the shape of the background mask is not limited to an ellipse; it may also be a shape that excludes both sides, as shown in Figure 11, 1007.
[0044] Furthermore, if various objects are visible in the background and some parts are confused with the skin tone of the face, a histogram like the one shown in Figure 11 (1010) will be created. There are objects on both sides of the valleys 1008 and 1009 that are judged to be skin tone. In this case, it is determined that confusion between the background color and skin tone is occurring. Also, if the size of the background mask created is fixed, it cannot be used when the size of the face detection frame changes. Therefore, the position of the valleys can be recorded as a ratio to the overall size, and an ellipse of that ratio can be used as the background mask, which can then be recreated and applied according to the subsequent size of the face.
[0045] Furthermore, if, for example, a person moves and the background changes, the application of a background mask may be determined for every frame. In that case, the determination of color confusion between the background and face should be made not only when setting the skin tone threshold, but also every time in the pulse estimation frame. Specifically, after detecting the skin tone area, the confusion determination in S1103 is performed to decide whether or not to generate a background mask. This process enables pulse estimation using images even when there are changes in the environment.
[0046] <Embodiment 4> In Embodiment 1, statistical values are calculated until the standard deviations of hue H and lightness V fall below the target value, and the threshold for the skin tone range is determined based on the mean and standard deviation. However, even if the standard deviations of H and V reach the target value, the standard deviation of saturation S may remain large, and determining the threshold by calculating a certain multiple of the standard deviation from the mean value of S may exceed the highest or lowest possible value of S. This is caused by the influence of the type of camera, auto white balance, lighting color, background color, etc.
[0047] In this case, even if the threshold is set by limiting it to the highest and lowest values of S, the range of the threshold for S may become too large, causing the background to be mistakenly identified as skin. If the standard deviation of S becomes too large and the threshold range becomes too wide, it may be better to limit it to upper and lower margin values, which are obtained by adding a margin to the highest and lowest values.
[0048] Figure 13 is a flowchart illustrating the process performed by the image processing device 1. This process relates to the determination of S in the threshold determination process of H and S shown in S306 of Figure 4. Figures 14(B) to (D) show examples of the process.
[0049] In S1301, the skin tone threshold determination unit 103 determines the threshold using the mean and standard deviation of the saturation S. Specifically, the lower threshold (minimum value of the range) is the value obtained by subtracting the value obtained by multiplying the standard deviation of the saturation S by a predetermined multiple A from the mean value of the saturation S. The upper threshold (maximum value of the range) is the value obtained by adding the value obtained by multiplying the standard deviation of the saturation S by a predetermined multiple A to the mean value of the saturation S. Figure 14(A) shows an example of determining the skin tone threshold from the image in Figure 14(B). This is a calculation example when the predetermined multiple A is 2.0, and as shown in 1401, the lower limit of the saturation S is -6. The setting of the maximum and minimum values that the saturation S can take differs depending on the calculation method, but in this example, it is set from 0 to 255, which exceeds the minimum value that the saturation S can take. Figure 14(C) shows a diagram where skin tones are represented as white and all other colors as black, either using this value as is or limiting the possible values to a threshold between 0 and 255. The background also extends to a white area, which is skin-colored.
[0050] In S1302, the skin tone threshold determination unit 103 determines whether the upper limit of the determined saturation S threshold exceeds the upper limit margin value Uth. For example, the upper limit margin value Uth is calculated by adding 75% of the difference between the upper limit of the possible values of saturation S (255) and the average value to the average value. If the upper limit of the saturation S threshold is greater than Uth, in S1303 the upper limit margin value Uth is set as the upper limit of the saturation S threshold. If it is smaller, it remains the upper limit determined in S1301.
[0051] In S1304, the skin tone threshold determination unit 103 determines whether the lower limit of the threshold determined in S1301 is smaller than the lower limit margin value. For example, the lower limit margin value Lth is set to 25% of the mean value. If it is smaller than Lth, S1303 sets the lower limit value Lth with margin as the lower limit of the saturation S threshold. If it is larger, it remains the lower limit determined in S1301. Figure 14(D) shows an example where the threshold of saturation S is limited to the lower limit margin value. The white areas representing skin tone in the background are gone. In this example, the margin is calculated based on the mean value, but it may be a fixed value, or it may be calculated using the mean value and standard deviation.
[0052] <Embodiment 5> In Embodiment 2, if the standard deviation does not reach the target value, the shape of the ellipse is changed, assuming that the person may be wearing accessories such as glasses or a face mask. However, due to the influence of camera type, auto white balance, lighting color, background color, etc., there are times when the standard deviation of hue H does not reach the target even without any accessories being worn. If the threshold is determined using the standard deviation when the target is not reached, the area considered to be skin-colored becomes wider, and parts of the background may appear to be skin-colored.
[0053] In Embodiment 3, a background mask is applied when a skin-colored area appears in the background. This background mask excludes areas other than the face, but it does not accurately capture the shape of the face, and may include the background or exclude the face. It would be preferable if a threshold could be determined that distinguishes between skin and background colors.
[0054] Therefore, the skin tone threshold determination unit 103 may determine a provisional threshold, examine the skin tone content inside and outside the ellipse where a face is assumed to be located, and adjust the skin tone threshold based on the skin tone content inside and outside the ellipse. If the content outside the ellipse is above a certain value, the provisional threshold is changed by reducing the value of the standard deviation that determines the threshold width. If the skin tone content inside the ellipse becomes too small, the provisional threshold is returned to the previous value.
[0055] Figure 15 is a flowchart illustrating the processes performed by the image processing device 1. The threshold correction process may be performed as a post-processing step after the process at S307 in the flowchart of Figure 4, after the threshold has been determined, or as a process after S601 in Figure 7 when the standard deviation does not reach the target value. If it is placed after S601, the threshold correction process is performed and the process ends.
[0056] Figures (A) through (F) in Figure 16 show examples of the process.
[0057] In S1501, the skin tone threshold determination unit 103 provisionally determines the skin tone threshold. The method of provisional determination is the same as the skin tone threshold determination method in the flowchart of Figure 4. Figure 16(A) shows an example of the threshold determined using the image in Figure 16(B). 1601 is the standard deviation of hue H, which is greater than the target value. 1602 is the standard deviation of saturation S, which is slightly larger. In this example, the target value of hue H is 12, and the target value of saturation S is 20.
[0058] In S1502, the skin tone region detection unit 104 uses the determined threshold to determine the skin tone content inside and outside the ellipse representing the face. Figure 16(C) shows the areas identified as skin tone in white and the areas identified as other skin tones in black. Figure 16(D) shows the ellipse 1608 that separates the inside and outside. This ellipse is the one initially used for threshold determination and is not the ellipse that has been narrowed down to determine the threshold.
[0059] In S1503, the skin tone region detection unit 104 determines whether the skin tone content outside the ellipse exceeds a certain value Oth. In this example, Oth is set to 10%. If it does not exceed this value, the process proceeds to S1504, where a provisional threshold is set as the skin tone threshold.
[0060] In Figure 16(A), the skin tone content 1603 outside the ellipse is 40%, which exceeds the constant value Oth. If it exceeds this value, the process proceeds to S1505, where the skin tone threshold determination unit 103 determines whether the standard deviation value that determines the threshold width can be reduced. In this embodiment, the standard deviation value of hue H is used to determine the threshold width. Once this value is reduced, it loses its statistical meaning, but for convenience, the term standard deviation is used. In this example, the reductionable value is set to 1.2 times or more the target value, and the reduction is limited to one time and cannot be made smaller than 1.2 times the target value. If reduction is possible, the process proceeds to S1507, where it is determined whether the skin tone content inside the ellipse is greater than the constant value Ith. In this example, Ith is set to 50%. In Figure 16(A), the standard deviation value of hue H is reductionable and the skin tone content 1604 inside the ellipse is 64%, which is greater than the constant value Ith. In S1509, the standard deviation value is reduced, and the process returns to S1501 and is repeated. The values 1605 and 1606 in Figure 16(A) are scaled values. Note that the scaling can be started with a larger multiple and repeated multiple times.
[0061] Figures 16(E) and (F) show an example where the skin tone threshold is determined using the reduced standard deviation, and the skin tone content is examined again in S1502. Since the skin tone content 1607 outside the ellipse of 1609 is 6%, which is smaller than the constant value Oth, the skin tone threshold determination unit 103 sets the threshold in S1504 and terminates.
[0062] Figure 17 shows an example where the background and skin tone could not be distinguished within the range that could be reduced. Figure 17(A) is an example of a threshold determined using the image in Figure 17(B). Both 1701 and 1702 in Figure 17(A) are large values. Figures 17(C) and (D) show the areas designated as skin tone in white and the areas not designated as skin tone in black. When the skin tone content inside and outside the ellipse 1707 is calculated, the skin tone content outside the ellipse 1703 is 50%. Figures 17(E) and (F) show the distribution of the areas designated as skin after reducing the standard deviation and correcting the threshold, as in 1704 and 1705. When the skin tone content inside and outside the ellipse 1708 in Figure 17(F) is calculated, the skin tone content outside the ellipse 1706 is 32%, which exceeds the constant value Oth. S1504 checks if reduction is possible, but reduction to 1.2 times the target value has been completed, and further reduction is not possible. Proceed to S1506 to set a background mask that excludes the area outside the ellipse from pulse estimation, then proceed to S1504 to set a temporary threshold as the skin tone threshold.
[0063] Figure 17(G), number 1709, is an example of a background mask.
[0064] Figures 18(A) through (G) show examples of how reducing the standard deviation prevents the range of skin tones from becoming too narrow, thus preventing an increase in areas of the face that are not considered skin-colored. The skin tone threshold is determined from the image in Figure 18(B). The values of 1801 and 1802 in Figure 18(A) are slightly large. Figures 18(C) and (D) show areas that are considered skin-colored in white and areas that are not in black. As shown in Figure 18(C), there is a small area in the background that is considered skin-colored. In Figure 18(D), the skin-color content outside the ellipse 1809 is 12%, which is slightly larger than the constant value Oth. The standard deviation is reduced to 1807 and 1808 to determine the skin tone. Figures 18(E) and (F) show the distribution of areas that are considered skin after correcting the threshold. As shown in Figure 18(E), the area of the background that is considered skin-colored has decreased, but the area of non-skin-colored areas in the face has increased. In Figure 18(F), the skin tone content 1806 within ellipse 1810 is 47%, which is smaller than the constant value Ith.
[0065] In S1507, if the skin tone threshold determination unit 103 determines that the skin tone content within the ellipse is less than a certain value Ith, the process proceeds to S1508, where the temporary threshold is restored to its original value. Values 1807 and 1808 in Figure 18(A) are the same as values 1801 and 1802. Next, the process proceeds to S1506 to set a background mask that excludes the area outside the ellipse from the pulse estimation range. 1811 in Figure 18(G) is that background mask. Next, in S1504, the temporary threshold is set as the skin tone threshold. Note that if the process of reducing the standard deviation is skipped and the process proceeds to S1508, the skin tone threshold determination unit 103 does not change the temporary threshold.
[0066] Note that while an ellipse is used to examine the skin tone content of the face and background, a rectangular area corresponding to the neck position may be added to the bottom of the ellipse, and this area may also be included in the measurement.
[0067] (Other embodiments) The present invention can also be realized by performing the following process: that is, supplying software (program) that implements the functions of the above-described embodiment to a system or device via a data communication network or various storage media; and then having the computer (or CPU, MPU, etc.) of that system or device read and execute the program. Alternatively, the program may be provided by recording it on a computer-readable recording medium.
[0068] Furthermore, for the face detection unit 102 and other processing units described above, a pre-trained model developed through machine learning may be used instead. In this case, for example, multiple combinations of input and output data for the processing unit are prepared as training data, knowledge is acquired from these through machine learning, and a pre-trained model is generated that outputs output data for the input data based on the acquired knowledge. The pre-trained model can be configured as, for example, a neural network model. The pre-trained model then operates in cooperation with a CPU or GPU, etc., as a program to perform processing equivalent to that of the processing unit, thereby performing the processing of the processing unit. Furthermore, the pre-trained model may be updated after a certain amount of processing as needed. [Explanation of Symbols]
[0069] 1 Image Processing Device 101 Image acquisition unit 102 Face detection unit 103 Skin Tone Threshold Determination Unit 104 Skin tone area detection unit 105 Hue calculation section 106 Hue Change Management Department 107 Pulse rate estimation unit 108 Pulse recording unit
Claims
1. An image processing device that estimates a pulse rate of a person detected from an image, A setting means for setting an area including a face identified from an image; an acquisition means for acquiring color information of pixels included in the set area; a determination means for determining whether each component of the acquired color information satisfies a predetermined condition; a determination means for determining a threshold value indicating a skin color range based on the color information in the region when the determination means determines that the acquired color information satisfies the predetermined condition, An image processing device characterized in that, when the judgment means judges that the color information does not satisfy the specified condition, the setting means reduces the size of the region depending on at least one of the components until the component satisfies the specified condition.
2. The color information includes hue, saturation, and brightness. 2 . The image processing apparatus according to claim 1 , wherein the acquiring means acquires statistical values of hue and brightness for pixels included in the region.
3. the determining means determines, as the predetermined condition, whether or not the statistical values of hue and brightness of the pixels included in the region satisfy a target value; 3. The image processing apparatus according to claim 2, wherein the determining means determines the threshold value from the color information in the region when the statistical values of the hue and brightness of the pixels included in the region satisfy the target value.
4. 4. The image processing apparatus according to claim 3, wherein the determining means determines the threshold value based on the statistical values of hue and saturation or a preset fixed value.
5. The statistical values are a standard deviation and an average value of each color information, The image processing apparatus according to claim 4 , wherein the determining means determines the threshold value based on standard deviations of hue and saturation.
6. 6. The image processing apparatus according to claim 5, wherein the determining means determines the saturation threshold value of the determined skin color threshold value to be a value obtained by adding or subtracting a predetermined value from the average saturation value.
7. the determining means determines the average brightness value to be a preset fixed value if the average brightness value is within a range between a first predetermined value indicating a lower limit of the target value and a second predetermined value indicating an upper limit of the target value; 7. The image processing apparatus according to claim 5, wherein when the average brightness value is smaller than the first predetermined value or larger than the second predetermined value, the threshold value is determined based on the statistical value.
8. 8. The image processing device according to claim 1, wherein the setting means sets a deformation area showing a predetermined shape in the area when the determination means determines that the color information does not satisfy the predetermined condition.
9. 9. The image processing apparatus according to claim 8, wherein said setting means sets said modification area in said area when the size of said area becomes equal to or smaller than a predetermined value.
10. a detection means for detecting an object that is occluding the face detected from the image; 10. The image processing apparatus according to claim 8, wherein the setting means sets the deformation area differently depending on the detected object.
11. 11. The image processing apparatus according to claim 10, wherein the detection means detects front hair, glasses, and a mask.
12. an extraction means for extracting a skin color area from an input image including the face based on the determined skin color threshold; 12. The image processing apparatus according to claim 1, further comprising: an estimation unit for estimating a pulse rate of a person based on the extracted skin-tone area.
13. The face tracking device further includes a tracking means for tracking the face, The image processing device according to claim 12 , wherein the estimation means estimates a pulse rate for the tracked face.
14. A generating means for generating a background mask for the input image, 14. The image processing apparatus according to claim 12, wherein the extraction means extracts the skin color area from an area not included in the background mask.
15. 15. The image processing device according to claim 14, further comprising an update means for updating the determined skin color threshold value in accordance with a skin color content rate in the region or a skin color content rate outside the region, calculated using the determined skin color threshold value.
16. 16. The image processing device according to claim 15, wherein the updating means reduces the determined skin color threshold value when it is determined that the skin color content rate outside the region is greater than a predetermined value and that the skin color content rate in the region is greater than a predetermined value.
17. 17. The image processing device according to claim 15, wherein the updating means does not update the determined skin color threshold value when it determines that the skin color content rate outside the region is greater than a predetermined value and that the skin color content rate in the region is smaller than a predetermined value.
18. 18. The image processing device according to claim 15, wherein the generating means generates a background mask for the input image when the updating means determines that the content rate of skin color outside the region is greater than a predetermined value.
19. 19. The image processing device according to claim 14, wherein the generating means generates a histogram indicating the number of pixels included in the determined threshold based on color information of pixels included in the region, and generates the background mask based on the histogram.
20. 1. An image processing method for estimating a pulse rate of a person detected from an image, comprising: A setting step of setting an area including a face identified from the image; acquiring color information of pixels included in the set area; a determination step of determining whether each component of the acquired color information satisfies a predetermined condition; a determination step of determining a threshold value indicating a skin color range based on the color information in the region when the acquired color information is determined to satisfy the predetermined condition, An image processing method characterized in that, if it is determined in the judgment process that the color information does not satisfy the specified condition, in the setting process, a size of the region is reduced depending on at least one of the components until the component satisfies the specified condition.
21. A program for causing a computer to function as each of the means included in the image processing apparatus according to any one of claims 1 to 19.
