Living body skin detection method, living body detection method, system, equipment and storage medium
By using speckle structured light images and DCT transformations in live skin detection, frequency components are extracted to distinguish live skin from non-living skin, solving the problem of low detection accuracy in the prior art, and achieving higher detection accuracy and reliability.
Patent Information
- Application Number
- CN202510639823.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-19
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2045-05-19
AI Technical Summary
The existing live skin detection methods are highly dependent on skin surface characteristics, difficult to balance measurement accuracy and resolution, and are sensitive to environmental conditions, resulting in low detection accuracy.
Using speckled structured light images, image energy is converted from the spatial domain to the frequency domain through discrete cosine transformation (DCT), and frequency components are extracted to distinguish between living skin and inviolable skin.
It improves the accuracy and reliability of live skin detection, reduces the dependence on laser speckle clarity, simplifies operation and improves detection efficiency.
Smart Images

Figure CN120164265A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of biometric technologies, and particularly to a method for detecting living skin, a method for living detection, a system, a device, and a storage medium. Background Art
[0002] With the popularization of electronic devices, biometric technologies have been widely applied in various technical fields. For example: identity authentication, security monitoring, financial payment, etc. The detection of living skin is mainly used to distinguish real living organisms from non-living organisms. And the detection of living organisms, as an important link in biometric identification, its accuracy and security are crucial.
[0003] In the prior art, a detection method based on physical characteristics has been proposed for detecting living skin. It mainly uses a 3D camera to capture a face, obtain 3D data of the skin area, and judge whether it is a stereoscopic image based on the 3D data analysis. This method can effectively identify non-living skin such as flat photos and screen replays. However, this method not only has a strong dependence on the surface characteristics of the skin, but also faces the balance between measurement accuracy and resolution, and is more sensitive to environmental conditions. Therefore, the detection accuracy rate is low.
[0004] Therefore, the prior art needs to be further improved. Summary of the Invention
[0005] In view of the above deficiencies in the prior art, the purpose of the present invention is to provide a method for detecting living skin, a method for living detection, a system, a device, and a storage medium, so as to improve the accuracy and reliability of living skin detection and living detection.
[0006] In a first aspect, the present application discloses a method for detecting living skin, which includes: Obtaining a speckle structured light image containing the skin of the object to be detected; Dividing the speckle structured light image into a plurality of consecutive detection regions; Respectively calculating the frequency components corresponding to the discrete cosine transform coefficients of each detection region; Determining the living skin region of the object to be detected according to the frequency components corresponding to the discrete cosine transform coefficients of each detection region.
[0007] Optionally, the step of dividing the speckle structured light image into a plurality of consecutive detection regions includes: Using a rectangular frame with a preset size as the basic sliding window block, sliding the basic sliding window block according to a preset sliding size, and slidingly dividing the speckle structured light image into a plurality of consecutive detection regions.
[0008] Optionally, the step of respectively calculating the frequency components corresponding to the discrete cosine transform coefficients of each detection region includes: Convert each detection area into a grayscale image; Calculate the discrete cosine transform coefficients corresponding to each grayscale image respectively; Calculate the signal energy values of the discrete cosine transform coefficients corresponding to each detection area respectively; Sort the discrete cosine transform coefficients according to the signal energy values corresponding to each detection area, and perform normalization processing on the sorted signal energy values; After energy normalization, the frequency components with an energy proportion greater than the preset energy threshold in each detection area are used as low-frequency components, and the frequency components greater than or equal to the preset energy threshold are used as high-frequency components.
[0009] Optionally, the frequency components include low-frequency components and high-frequency components; The step of determining the living skin area of the object to be detected according to the frequency components corresponding to the discrete cosine transform coefficients of each detection area includes: Calculate the energy ratio between the energy value corresponding to the low-frequency component and the energy value corresponding to the high-frequency component in each detection area respectively; Determine the living skin area of the object to be detected according to the energy value of the low-frequency component corresponding to each detection area and the calculated energy ratio corresponding to each detection area.
[0010] Optionally, the step of determining the living skin area of the object to be detected according to the frequency components corresponding to the discrete cosine transform coefficients of each detection area includes: Determine the detection areas with the energy proportion of the low-frequency component greater than the preset energy threshold as the living skin areas.
[0011] Optionally, after the step of determining the detection areas with the energy proportion of the low-frequency component greater than the preset energy threshold as the living skin areas, it further includes: Within the range where each selected living skin area is located, calculate the difference between each living skin area and the detection areas in the adjacent row or adjacent column respectively, and obtain the overlap degree of the coverage area between the living skin area and the adjacent detection areas; Determine the adjacent detection areas with the overlap degree of the coverage area greater than the preset overlap degree threshold as the living skin areas, and obtain the updated living skin area of the object to be detected.
[0012] In a second aspect, the present application provides a living body detection method implemented by using the above-mentioned living skin detection method, wherein, it includes: Judge whether the speckle structured light image of the skin of the object to be detected contains a living skin area; If it contains a living skin area, determine that the object to be detected is a living body, otherwise, determine that the object to be detected is a non-living body.
[0013] In a third aspect, the present application also discloses a living skin detection system, which includes: An image acquisition module, configured to acquire a speckle structured light image including the skin of an object to be detected; A detection area division module, configured to divide the speckle structured light image into a plurality of consecutive detection areas; An energy calculation module, configured to calculate the frequency components corresponding to the discrete cosine transform coefficients of each detection area respectively; A detection result output module, configured to determine the living skin area of the object to be detected according to the frequency components corresponding to the discrete cosine transform coefficients of each detection area.
[0014] In a fourth aspect, the present application also discloses a living skin detection device, which includes a processor and a storage medium communicatively connected to the processor. The storage medium is adapted to store a plurality of instructions; the processor is adapted to call the instructions in the storage medium to execute the steps of implementing the living skin detection method described in any one of the above.
[0015] In a fifth aspect, the present application also discloses a computer-readable storage medium, wherein the computer-readable storage medium stores one or more computer-readable programs. The one or more computer-readable programs can be executed by one or more processors. When the computer-readable program is executed by the processor, the living skin detection method described above is implemented, or the living detection method is implemented.
[0016] Advantageous effects: The present invention provides a living skin detection method, a living detection method, a system, a device and a storage medium. An image acquisition module acquires a speckle structured light image including the skin of an object to be detected; a detection area division module divides the speckle structured light image into a plurality of consecutive detection areas as a whole; an energy calculation module calculates the frequency components corresponding to the discrete cosine transform coefficients of each detection area respectively; a detection result output module determines the living skin area of the object to be detected according to the frequency components corresponding to the discrete cosine transform coefficients of each detection area. The method of the present invention proposes a method for effectively distinguishing living skin and non-living skin by using the frequency components corresponding to the discrete cosine transform coefficients based on the difference in the frequency domain sharpness characteristics of laser speckles on the skin and non-skin surfaces. Since this method converts the image energy information from the spatial domain to the frequency domain, more discriminative frequency features are extracted, improving the accuracy and reliability of the detection. Description of the Drawings
[0017] Figure 1 is a flowchart of the steps of the living skin detection method provided by the present invention; Figure 2 is a speckle structured light image of the skin of an object to be detected provided in the method of an embodiment of the present invention; Figure 3 It is a schematic diagram of continuously sliding a window on a speckle structure image in the method of the embodiment of the present invention; Figure 4 It is a schematic diagram of a basic sliding window block in the method of the embodiment of the present invention; Figure 5 It is a schematic diagram of discrete cosine transform coefficients in a detection area in the method of the embodiment of the present invention; Figure 6 It is a distribution diagram of the normalized average energy values of high-frequency components and low-frequency components corresponding to a living skin area and a non-living skin area in the method of the embodiment of the present invention; Figure 7 It is a distribution diagram of the normalized average energy values of high-frequency components and low-frequency components corresponding to an entire image in the method provided by the present invention; Figure 8 It is a visualization schematic diagram of a detected area screened out in the method provided by the present invention; Figure 9 It is a visualization schematic diagram of the coincidence degree of detected areas in the method provided by the present invention; Figure 10 It is a color schematic diagram of the position where a detected living skin area is located in the method provided by the present invention; Figure 11 It is a framed schematic diagram of the position where a detected living skin area is located in the method provided by the present invention; Figure 12 It is a principle structure block diagram of the living skin detection system provided by the present invention. Detailed implementation manners
[0018] To make the objectives, technical solutions and advantages of the present invention clearer and more definite, the following further describes the present invention in detail with reference to the accompanying drawings and by way of examples. It should be understood that the specific examples described herein are only used to explain the present invention and are not used to limit the present invention.
[0019] The main purpose of living body detection skin technology is to distinguish real human skin features from forged prosthetic skin features to prevent illegal intrusion and fraud.
[0020] The existing living skin detection solutions mainly include the following categories: 1) Live skin detection based on texture features of static images. Such as Local Binary Pattern (LBP), Local Phase Quantization (LPQ), Histogram of Oriented Gradient (HOG), Scale Invariant Feature Transform (SIFT), Speeded-Up Robust Features (SURF), Image Distortion Analysis (IDA), and deep learning features. Although these texture feature-based methods are effective, they are vulnerable to high-definition photos and high-definition videos.
[0021] 2) Live skin detection based on extraction of facial motion features. Such as blinking and mouth movement. Although these methods are effective, their drawback is that since they require the subject to actively cooperate with specific actions, they are not completely passive measurements, which is not applicable in situations such as sleep or unconsciousness.
[0022] 3) Live skin detection using 3D sensing technology to measure the three-dimensional structure of the face. Such as structured light projection, Time of Flight (TOF). This depth information-based detection method can effectively resist 2D attack means such as flat photos, videos, and screens, but is vulnerable to 3D skin masks and dummies.
[0023] 4) Live skin detection based on physiological signals. Such as Remote Photoplethysmography (rPPG). It uses reflected ambient light to measure the subtle brightness changes of the skin caused by blood flow induced by heartbeats. However, since pulse signal-based methods require at least 2 - 3 seconds to measure 2 - 3 consecutive heartbeat cycles, they cannot achieve fast live detection. In addition, they are also vulnerable to interference in high-definition videos.
[0024] In addition to the above methods, recent research has found that due to the interaction between laser photons and tissues within the multi-layer skin structure, the frequency domain sharpness features of laser speckles on the skin and non-skin surfaces (sharpness is an important indicator to measure image quality, reflecting the quantity and clarity of details in the image. Sharpness is determined by the boundaries between different brightness or color regions, and the clearer the boundary, the higher the sharpness) show obvious differences, and based on this discovery, the Energy of Gradient (EOG) can be used to effectively distinguish live skin from non-live skin.
[0025] However, in actual research, it is found that the above method using the energy gradient function has relatively high requirements for the clarity of speckles. When the clarity of the speckles does not reach the expected level, the difference between living skin and non-living skin is weakened, resulting in a low recognition accuracy of the method using the energy gradient function. This high dependence on high-definition laser not only increases the operation complexity but also limits the scope of application of this method in practice.
[0026] To overcome the above problems, the present application provides a method for detecting living skin, a method for living detection, a system and a storage medium, which include: obtaining a speckle structured light image containing the skin of the object to be detected; dividing the whole speckle structured light image into multiple consecutive detection regions; respectively calculating the frequency components corresponding to the discrete cosine transform coefficients of each detection region; and determining the living skin region of the object to be detected according to the frequency components corresponding to the discrete cosine transform coefficients of each detection region. The method and system provided by the present application innovatively introduce the Discrete Cosine Transform (DCT) into the structured light living skin detection to realize the conversion of the image energy information from the spatial domain to the frequency domain through signal transformation by using DCT, so as to extract more discriminative frequency features. Moreover, due to the energy concentration characteristic of the DCT transform, the main information in the data can be concentrated on the low-frequency coefficients, thereby reducing the data dimension and improving the calculation efficiency.
[0027] The following further describes the method for detecting living skin, the method for living detection, the living skin detection system, the device and the storage medium disclosed in the present application in more detail with reference to the accompanying drawings.
[0028] In the first aspect, the method for detecting living skin for EOG not only depends on the high clarity of laser speckles but also increases the operation complexity. Therefore, this embodiment provides a method for detecting living skin, as Figure 1 shown, the method for detecting living skin includes: Step S1, obtaining a speckle structured light image containing the skin of the object to be detected.
[0029] Speckle structured light is formed based on the speckle effect when structured light irradiates on the surface of a rough object. The speckle patterns corresponding to these speckle structured lights show randomness in spatial and intensity distributions.
[0030] There are various ways to obtain the speckle structured light image of the skin of the object to be detected in this step. For example: the saved speckle structured light image can be directly obtained from other intelligent devices, or it can be connected to a speckle structured light camera. When the speckle structured light camera captures a speckle structured light image, the speckle structured light image of the skin of the object to be detected is obtained from the camera.
[0031] In one embodiment, a speckle structured light depth camera is used as the acquisition camera. The depth camera captures the skin area of the object to be detected to obtain a speckle structured light image containing the corresponding skin to be detected. Further, in this step, structured light (such as laser) is used as the light source to project a speckle pattern onto the skin surface of the object to be detected, and the speckle structured light image reflected from the skin surface of the object to be detected is collected.
[0032] Step S2: Divide the whole speckle structured light image into multiple consecutive detection regions.
[0033] Since the obtained speckle structured light image may contain a living skin area and a non-living skin area, the non-living skin area may include: a clothing area, an environment area, or a dummy model area. After converting the speckle structured light image from a color image to a grayscale image, if individual speckles in the grayscale image are processed, the living skin area and the non-living skin area cannot be distinguished.
[0034] To better capture the gradient changes between speckles on the grayscale image, in this step, after obtaining the speckle structured light image, the method of dividing the whole region of the speckle structured light image is adopted to obtain multiple consecutive detection regions. By dividing into blocks, each detection region can contain multiple speckles and reflect the gradient change information between the speckles, so as to capture the differences between the detection regions, and thus identify the living skin area and the non-living skin area from multiple detection regions, and identify the dummy model area, clothing area, or environment area, etc. in the non-living skin area.
[0035] In specific implementation, there are two different ways to divide the whole region of the speckle structured light image. The first is the continuous sliding window method, and the second is the fixed block division method.
[0036] The continuous sliding window method mainly includes: using a rectangular frame with a preset size as the basic sliding window block, sliding the basic sliding window block according to a preset sliding size, and slidingly dividing the speckle structured light image into multiple consecutive detection regions.
[0037] To achieve a better detection area division effect, in specific implementation, a rectangular frame with a preset size can be selected as the basic sliding window block, and this basic sliding window block is used to slide on the speckle structured light image according to the preset size, thereby dividing multiple detection areas. The preset size can be custom-set, or the size of the basic sliding window block can be adjusted according to the proportion of the contour of the object to be detected in the speckle structured light image. For example: when the proportion of the contour of the object to be detected is small, in order to more accurately identify the living skin area, the basic sliding window block can use a rectangle that is several times smaller (such as 1 / 4, 1 / 6 times) than the contour of the object to be detected as the basic sliding window block, so as to obtain a more accurate detection result.
[0038] In order to obtain more image information while reducing the data processing volume and improving the information processing efficiency. In one implementation, based on that each speckle diameter is about 5 pixel points, in this method, when performing continuous sliding window operations, the basic sliding window block moves 5 pixel points to the right each time in the same row, and the basic sliding window block moves 5 pixel points down each time in the same column. Thus, it is realized that each speckle in the image is judged to identify whether it is the light spot corresponding to the living skin. The accuracy and reliability of the detection method are increased.
[0039] The method of dividing the detection area by the fixed block method is: dividing the speckle structured light image into multiple detection areas with a fixed size and non-overlapping areas according to the preset size.
[0040] This fixed block method is to divide the speckle structured light image with a fixed size, and each divided detection area does not overlap. In specific implementation, the size can also be determined according to the proportion of the contour of the object to be detected in the entire image area, so as to realize the division of the speckle structured light image.
[0041] In order to determine a more suitable preset size, in this step, the contour of the target object in the speckle structured light image can be recognized first, the contour of the area where the contained object is located is recognized, and a suitable size is determined based on the recognized object contour. The preset size can also be a fixed set size value.
[0042] Although both the continuous sliding window method and the fixed block method can realize the division of the detection area, and detecting and identifying each detection area can distinguish between the living skin area and the non-living skin area, the continuous sliding window has higher flexibility and can adapt to the recognition of detection targets in more scenarios. Moreover, since there is overlap between the detection areas in the continuous sliding window method, the local features of the data can be captured more accurately, enhancing the reliability of the detection method.
[0043] Step S3: Calculate the frequency components corresponding to the discrete cosine transform coefficients of each detection area respectively.
[0044] After the speckle structured light image is divided into multiple detection areas, the discrete cosine transform coefficients corresponding to each detection area are calculated respectively. The frequency components in each detection area are obtained based on the discrete cosine transform coefficients. The frequency components include: low-frequency components and high-frequency components.
[0045] In detail, the steps of respectively calculating the frequency components corresponding to the discrete cosine transform coefficients of each detection area include: Convert each detection area into a grayscale image; calculate the discrete cosine transform coefficients corresponding to each grayscale image; calculate the signal energy value of the discrete cosine transform coefficients corresponding to each detection area. Sort the discrete cosine transform coefficients according to the signal energy values corresponding to each detection area, and normalize the sorted signal energy values; after energy normalization, the frequency components in each detection area whose energy ratio is greater than the preset energy threshold are regarded as low-frequency components, and the frequency components greater than or equal to the preset energy threshold are regarded as high-frequency components.
[0046] Specifically, in order to obtain the frequency components of each detection area, first, the sliding window basic block is used to translate in the same row according to the preset size in turn to locate each detection area, and each located detection area is used as the processing area in turn. The process of processing each detection area includes: first converting the color image in the detection area into a grayscale image, and then using the dct2() function to calculate the DCT coefficient of the detection area. Secondly, the corresponding energy value is calculated based on the DCT coefficient. In one implementation, the energy value corresponding to the DCT coefficient is obtained by calculating the square of the DCT coefficient. Thirdly, the discrete cosine transform coefficients are sorted according to the calculated energy value, and the sorted signal energy value is normalized. After normalization, the frequency components whose energy proportion is greater than the preset energy threshold are regarded as low-frequency components, and the frequency components whose energy proportion is less than or equal to the preset energy threshold are regarded as high-frequency components.
[0047] In this step, the energy values calculated by the DCT coefficients of each detection area are first collected to obtain an energy value set. Linear normalization or Z-Score normalization is selected as the normalization method, and each energy value in the energy value set is scaled within the target range to obtain the energy normalization value corresponding to each detection area. In the process of normalizing the energy value, it is necessary to calculate the normalization parameter based on the scaled target range. The normalization parameter usually refers to the scaling factor, offset or standardization parameter (such as mean and standard deviation) used in the normalization process.
[0048] The energy values after energy normalization are divided according to a preset energy threshold. When the energy ratio is greater than the preset energy threshold, it is classified as a low-frequency component. When the energy ratio is less than the preset energy threshold, it is classified as a high-frequency component. In specific implementation, the preset energy threshold can be 95%, and the range of the preset energy threshold can be from 88% to 97%.
[0049] Step S4: Determine the living skin area of the object to be detected according to the frequency components corresponding to the discrete cosine transform coefficients of each detection area.
[0050] After calculating the frequency components corresponding to the discrete cosine transform coefficients of each detection area, according to the divided low-frequency components and high-frequency components, it can be determined whether each detection area corresponds to a living skin area, so as to determine the detection result of the living skin of the object to be detected.
[0051] Specifically, in this step, there are two different implementation methods for determining the living skin area of the object to be detected according to the frequency components corresponding to the discrete cosine transform coefficients of the detection area. One implementation method is to screen out the living skin area based on the low-frequency components and the energy ratio. Another method is to screen out the living skin area only based on the low-frequency components. This method can further optimize the living skin area screened out only based on the low-frequency components by calculating the region coincidence degree, so as to improve the accuracy of the living skin area detection.
[0052] Specifically, the steps of screening out the living skin area based on the low-frequency components and the energy ratio include: Step S41: Calculate the energy ratio between the energy value corresponding to the low-frequency component and the energy value corresponding to the high-frequency component in each detection area respectively.
[0053] Since each detection area corresponds to a picture located by a sliding window, frequency domain analysis is performed on the located picture, so as to obtain the energy value corresponding to the low-frequency component and the energy value corresponding to the high-frequency component in the picture. A corresponding set of energy values of the low-frequency component and the energy value of the high-frequency component is obtained for each picture. Therefore, for different detection areas, a corresponding set of energy values of the low-frequency component and the energy value of the high-frequency component is obtained respectively. Divide the energy value of the low-frequency component corresponding to each detection area by the energy value of the high-frequency component, and then obtain the energy ratio corresponding to each detection area.
[0054] Step S42: Determine the living skin area of the object to be detected according to the energy value corresponding to the low-frequency component of each detection area and / or the calculated energy ratio corresponding to each detection area.
[0055] According to the energy value corresponding to the low-frequency component of each detection area and the energy ratio calculated in the above steps, screen out the detection areas belonging to the living skin area.
[0056] Since the energy ratio corresponding to the living skin area is significantly different from the energy ratios of non-living areas (such as mannequin model areas, environmental areas, clothing areas, etc.), the living skin area and the non-living skin area can be distinguished.
[0057] Specifically, when only using the energy ratio to divide the living skin area and the non-living skin area, the detection area with an energy ratio greater than the preset energy threshold is determined as the living skin area, and the detection area with a ratio less than the preset energy threshold is determined as the non-living skin area.
[0058] The method for determining the preset energy threshold includes: respectively determining the standard ratio between the energy value corresponding to the low-frequency component and the energy value corresponding to the high-frequency component of the living sample skin area and the non-living sample skin area; determining the preset energy threshold according to the standard ratios corresponding to the living sample skin area and the non-living sample skin area.
[0059] In order to determine the preset energy threshold, in one implementation, the standard ratio between the energy value corresponding to the low-frequency component and the energy value corresponding to the high-frequency component of the living sample skin area and the non-living sample area can be used to calculate a better range of the preset energy threshold, and then based on the current environmental state of the object to be detected, a suitable preset energy threshold is selected for identifying the living skin area and the non-living skin area in the obtained speckle structured light image.
[0060] In this step, the detection result of the living skin determined according to the energy ratio is based on the significant difference between the energy ratio corresponding to the living skin area and the energy ratio corresponding to the non-living skin area. The energy ratio corresponding to the living skin area is significantly smaller than that of the non-living skin area.
[0061] Specifically, the range of the preset energy threshold can be set between 88% and 97%. Taking the preset energy threshold of 95% as an example, after normalizing the energy values, the part with an energy ratio greater than 95% is selected as the low-frequency signal, and the rest is used as the high-frequency signal.
[0062] Since the low-frequency component of the living skin area has the largest energy ratio and the high-frequency component has the smallest energy ratio, by calculating the ratio of the energy value corresponding to the low-frequency component to the energy value corresponding to the high-frequency component, the difference between the low-frequency signal and the high-frequency signal can be further amplified, so the living skin area and the non-living skin area in the picture can be effectively distinguished.
[0063] To verify the difference in the energy ratio between the energy value corresponding to the low-frequency component and the energy value corresponding to the high-frequency component presented by the living skin area and the non-living skin area in the speckle structured light image, the following is combined with Figures 2 to 6Describe it in detail.
[0064] In the first step, different from the mode of using the Realsense speckle structured light depth camera in combination with the ids camera, in this step, the Realsense speckle structured light depth camera is first used as the light source and the acquisition camera. As Figure 2 shown, the depth camera takes a single shot of the target verification object containing the skin area and the dummy model area, and the captured speckle structured light image simultaneously obtains the living skin area, the dummy model area, the clothing area, and the environment area. Since only the structured light depth camera is used to capture images this time, the clarity of the speckles in the obtained speckle structured light image is lower than that of the images captured in the mode of using the Realsense speckle structured light depth camera in combination with the ids camera.
[0065] In the second step, in order to improve the consistency and accuracy of the information in the subsequent processing, it is necessary to ensure that the processing of each area (living skin area and non-living skin area) is based on a unified rectangular size. The method for determining the rectangular size is as follows: 1). Manually or using image processing software, outline the living skin area and the dummy model area in the speckle structured light image. During the outlining process, try to avoid outlining the speckles that do not belong to the target area, and at the same time ensure that the rectangular frame can cover the target area to the maximum extent. Since the clothing area and the environment area are relatively large in the captured pictures and are not the main factors restricting the size of the rectangle, the outlining mainly focuses on the living skin area and the dummy model area.
[0066] 2). Compare the widths and lengths of the living skin area and the dummy model area, and select the smaller width as the width of the final rectangle and the smaller length as the length of the final rectangle. This can ensure that the final rectangular frame will not exceed the boundary of the target area, thereby avoiding outlining the speckles that do not belong to this area. After determining the final rectangular size, apply this rectangular frame to the living skin area, the dummy model area, the clothing area, and the environment area. During the application process, record the rectangular coordinate information of each area for subsequent discrete cosine transform (DCT) of each area.
[0067] Step 3: Perform continuous sliding windows on each of the selected regions. Due to clarity limitations, after converting the image from a color image to a grayscale image, if the original method is used to process individual spots, it is impossible to distinguish the living area from the non-living skin area at this time. Therefore, in this step, we approach from the perspective of block division. The advantage of block division is that it includes multiple scattered spots at the same time and can capture the gradient changes between the spots, thus amplifying the differences. In block processing, a fixed block method and a continuous sliding window method can be used. Although their effects are similar and both can well distinguish the living area from the non-living skin area, the continuous sliding window method has higher flexibility. It can better adapt to the needs of different subjects and can capture the local features of the data more carefully, enhancing the reliability of the method.
[0068] As shown in Figure 3 respectively, manually draw rectangles of equal length and width for four regions (living skin area, dummy model area, clothing area, ambient light area), and select a rectangle with 1 / 4 of the size of the rectangle as the basic sliding window block. As shown in Figure 4 each region contains multiple spots. Since the diameter of each spot is about 5 pixel points, the sliding window is translated 5 pixel points to the right each time in the same row, and the sliding window is translated 5 pixel points downward each time in the same column.
[0069] Step 4: Calculate for each detection region located by each continuous sliding window. Take the region located by each sliding window as the detection region in turn, that is, the processing region. First, convert the region corresponding to the sliding window into a grayscale image, and then use the dct2() function to calculate the DCT coefficients of this region. The DCT coefficients corresponding to the detection region are as shown in Figure 5 .
[0070] Step 5: Then calculate the energy of each DCT coefficient, and then sort the DCT coefficients in ascending order according to the energy value using the sort function. Normalize the energy values in each detection region after sorting, and find the threshold corresponding to the first 95% of the energy after normalization. Select the part with an energy ratio greater than the threshold as the low-frequency signal, and the rest as the high-frequency signal to obtain the signal distribution map corresponding to each selected region. As shown in Figure 6 , blue represents the low-frequency component, red represents the high-frequency component, and from left to right are the living skin area, dummy model area, clothing area, and ambient light area respectively. As can be seen from Figure 6 , the energy ratio between the energy value of the low-frequency component and the energy value of the high-frequency component corresponding to the living skin area is greater than the energy ratio corresponding to the non-living skin area. Therefore, based on the energy ratio between the energy value of the low-frequency component and the energy value of the high-frequency component corresponding to different regions in the image, the living skin area and the non-living skin area can be identified. It can be imagined that the non-living skin area includes one or more of the clothing area, environment area, and dummy model area.
[0071] In addition, the living skin area in the scattered structured light image can be directly screened out only based on the energy values corresponding to the low-frequency components.
[0072] Specifically, the step of determining the living skin area of the object to be detected according to the frequency components corresponding to the discrete cosine transform coefficients of each detection area includes: Determine the detection area where the energy ratio of the low-frequency component is greater than the preset energy threshold as the living skin area.
[0073] When the energy values of the low-frequency components and the high-frequency components in each detection area are determined, the normalized mean maps corresponding to the energy values of the low-frequency components and the high-frequency components in the entire speckle structured light image can be obtained. As shown in Figure 7 The convex area where the maximum value is located contains the living skin area. Since the energy ratio of the low-frequency components corresponding to the living skin is above 0.945, and the interval length of the energy values of the low-frequency components is between 0.005 and 0.007. Then the threshold can be set as the maximum value of the low-frequency component minus 0.007 to screen out the living skin area. That is, the detection area where the energy value of the low-frequency component is less than the maximum value of the low-frequency energy minus 0.007 is determined as the living skin area.
[0074] In specific implementation, if affected by ambient light or other interferences, the energy value of the low-frequency component fluctuates violently, and the maximum value of this low-frequency component will be slightly reduced by 0.002 - 0.004 to ensure the effective function of the threshold. Then, using this threshold, the detection areas containing the living skin are screened out. As shown in Figure 8 It can be seen that after screening by the energy threshold of the low-frequency component, the living skin area of the entire image is screened out ( Figure 8 the green area in).
[0075] Furthermore, in order to more accurately screen out the living skin area, after the step of determining the detection area where the energy ratio of the low-frequency component is greater than the preset energy threshold as the living skin area, the following steps are further included: Within the range of each screened living skin area, calculate the difference between each living skin area and the detection areas in the adjacent row or adjacent column respectively to obtain the overlap degree of the covered area between the living skin area and the adjacent detection areas; determine the adjacent detection areas with the overlap degree of the covered area greater than the preset overlap degree threshold as the living skin area, and obtain the updated living skin area of the object to be detected.
[0076] As shown in Figure 8As shown, it can be seen that after the threshold screening based on the energy values corresponding to the low-frequency components, most of the living skin areas in the image are detected, but the accuracy cannot meet the requirements. Therefore, after the living skin areas are preliminarily screened out, the screened living skin areas are used as the target areas, and the overlap degree of the coverage area between the target areas and the adjacent detection areas is calculated. The higher the overlap degree, the closer it should be to the living skin area, and the visualization result of the overlap degree is as expected. As Figure 9 shown, it can be seen that the overlap degree first increases monotonically as a whole and then decreases monotonically as a whole. Using this property, the differences between each row corresponding to the detection area and the previous row, and the differences between each column and the previous column can be calculated to obtain the row / column boundaries that conform to this rule, and the overlap degrees of the areas outside the boundaries are all set to 0. Then, according to the general rule of the face width, that is, it is considered that the width of half of the face will not exceed 10 cm, centered on the maximum value, the overlap degrees of the areas exceeding 10 cm on the left and right are set to 0. Finally, the threshold is set to (the maximum overlap degree / 6), and the positions of the pixel points with the overlap degree not less than this threshold are retained as the final living area and visualized, as Figure 10 and Figure 11 shown, where Figure 10 displays the located living skin area by color, Figure 11 displays the located living skin area by a positioning frame.
[0077] In the method of this embodiment, first, a speckle structured light image containing the skin of the object to be detected is obtained. The obtained speckle structured light image is divided into multiple detection areas by using the continuous sliding window method as a whole. Each detection area is converted into a grayscale image, and then the DCT coefficients are calculated for each converted grayscale image. According to the calculated DCT coefficients, the frequency components corresponding to the DCT coefficients are calculated respectively, and whether there is a living skin area is judged according to the frequency components.
[0078] The method disclosed in this embodiment uses the frequency components obtained from the DCT coefficients for comparison, and verifies that there are significant differences in the frequency domain characteristics of the spots corresponding to the living skin area and the non-living skin area. The living skin detection can be realized by using this method. The method provided in this embodiment also significantly reduces the high standard for the high definition of the spots, and the required processing time is only one-half or more of the EOG method, effectively enhancing the reliability and usability of the speckle structured light living skin detection.
[0079] Based on the disclosure of the above living skin detection method, this application also provides a living detection method, including: Step H1, judging whether there is a living skin area in the speckle structured light image of the skin of the object to be detected.
[0080] Step H2: If a living skin area is included, determine that the object to be detected is a living body; otherwise, determine that the object to be detected is a non-living body.
[0081] The living body detection method provided in this embodiment is implemented based on the living skin detection method. First, use the living skin detection method disclosed in the above embodiment to determine whether the obtained speckle structured light image contains living skin. If it does, it means that the object to be detected is a living body. If no living skin is detected, the object to be detected is a non-living body, such as a dummy model.
[0082] Since the living body detection method provided in this embodiment is implemented based on the above-disclosed living skin detection method, and since the above living skin detection method not only significantly reduces the requirement for high clarity of the speckles but also greatly speeds up the processing speed, the living body detection method disclosed in this embodiment can also achieve the above detection effect.
[0083] This application provides a living skin detection system, as Figure 12 shown. The living skin detection system specifically includes: An image acquisition module 1201, configured to acquire a speckle structured light image including the skin of the object to be detected; its function is as shown in step S1.
[0084] A detection area division module 1202, configured to divide the speckle structured light image into multiple consecutive detection areas; its function is as shown in step S2.
[0085] An energy calculation module 1203, configured to calculate the frequency components corresponding to the discrete cosine transform coefficients of each detection area respectively; its function is as shown in step S3.
[0086] A detection result output module 1204, which determines the living skin area of the object to be detected according to the frequency components corresponding to the discrete cosine transform coefficients of each detection area, and its function is as shown in step S4.
[0087] Based on the disclosure of the above living skin detection method, this application also discloses a living skin detection device, which includes: a processor and a storage medium communicatively connected to the processor. The storage medium is adapted to store multiple instructions; the processor is adapted to call the instructions in the storage medium to execute the steps of implementing the living skin detection method described in any one of the above.
[0088] Based on the disclosure of the above-mentioned live skin detection method, the present application also discloses a computer-readable storage medium. Among them, the computer-readable storage medium stores one or more computer-readable programs, and the one or more computer-readable programs can be executed by one or more processors. When the computer-readable program is executed by the processor, the described live skin detection method is implemented, or the described live detection method is implemented.
[0089] It can be conceived that in order to achieve more accurate live skin detection, the live skin detection method disclosed in this embodiment can also be combined with the method of identifying live skin using depth information to achieve more accurate live skin detection. That is to say, the detection method of depth information can be used to determine whether it is a live photo first, and then the live skin detection provided by the present invention can be used to determine whether it is a live body.
[0090] The present invention provides a live skin detection method, a live detection method, a system, a device and a storage medium. A speckle structured light image including the skin of the object to be detected is obtained; the speckle structured light image is divided into multiple continuous detection regions as a whole; the frequency components corresponding to the discrete cosine transform coefficients of each detection region are calculated respectively; according to the frequency components corresponding to the discrete cosine transform coefficients of each detection region, the live skin region of the object to be detected is determined. The method of the present invention is based on the difference in the frequency domain sharpness characteristics of laser speckles on the skin and non-skin surfaces, and proposes a method for effectively distinguishing live skin and non-live skin using the frequency components corresponding to the discrete cosine transform coefficients. Since this method converts the image energy information from the spatial domain to the frequency domain, more discriminative frequency features are extracted, improving the accuracy and reliability of the detection. And the DCT transform has the characteristic of energy concentration, which can concentrate the main information in the data on the low-frequency coefficients, reducing the data dimension and improving the calculation efficiency.
[0091] Those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention, which follow the general principles of the present invention and include the common general knowledge or conventional technical means in the technical field not disclosed in this application. The specification and embodiments are only regarded as exemplary, and the true scope and spirit of the present invention are pointed out by the following claims.
[0092] In the description of this specification, the descriptions referring to terms such as "one embodiment", "some embodiments", "example", "specific example", or "some examples" mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of this application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or N embodiments or examples. In addition, without contradiction, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.
[0093] It can be understood that the above embodiments are exemplary and should not be construed as limiting this application. Those of ordinary skill in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of this application.
Claims
1. A living skin detection method, characterized in that: include: Acquire a speckle structured light image containing the skin of the object to be detected; Dividing the speckle structured light image into a plurality of continuous detection areas; Calculate the frequency components corresponding to the discrete cosine transform coefficients of each detection area respectively; The living skin area of the object to be detected is determined according to the frequency components corresponding to the discrete cosine transform coefficients of each detection area.
2. The living skin detection method according to claim 1, characterized in that: The step of dividing the speckle structured light image into a plurality of continuous detection areas comprises: A rectangular frame of a preset size is used as a sliding window basic block, and the sliding window basic block is slid according to the preset sliding size to slide and divide the speckle structured light image into a plurality of continuous detection areas.
3. The living skin detection method according to claim 1, characterized in that: The step of respectively calculating the frequency components corresponding to the discrete cosine transform coefficients of each detection area comprises: Convert each detection area into a grayscale image; Calculate the discrete cosine transform coefficients corresponding to each grayscale image respectively; Calculate the signal energy value of the discrete cosine transform coefficient corresponding to each detection area respectively; The discrete cosine transform coefficients are sorted according to the signal energy values corresponding to each detection area, and the sorted signal energy values are normalized; After energy normalization, the frequency components whose energy proportion in each detection area is greater than the preset energy threshold are regarded as low-frequency components, and the frequency components greater than or equal to the preset energy threshold are regarded as high-frequency components.
4. The living skin detection method according to claim 1, characterized in that: Frequency components include low-frequency components and high-frequency components; The step of determining the living skin area of the object to be detected according to the frequency components corresponding to the discrete cosine transform coefficients of each detection area includes: Calculate the energy ratio between the energy value corresponding to the low-frequency component and the energy value corresponding to the high-frequency component in each detection area respectively; The living skin area of the object to be detected is determined according to the energy value of the low-frequency component corresponding to each detection area and / or the calculated energy ratio corresponding to each detection area.
5. The living skin detection method according to claim 3, characterized in that: The step of determining the living skin area of the object to be detected according to the frequency components corresponding to the discrete cosine transform coefficients of each detection area includes: The detection area where the energy proportion corresponding to the low-frequency component is greater than the preset energy threshold is determined as the living skin area.
6. The living skin detection method according to claim 5, characterized in that: After the step of determining the detection area where the energy proportion corresponding to the low-frequency component is greater than the preset energy threshold as the living skin area, the method further includes: In the range where each screened living skin area is located, the difference between each living skin area and the detection area of the adjacent row or adjacent column is calculated respectively to obtain the overlap degree of the coverage area between the living skin area and the adjacent detection area; Adjacent detection areas whose coverage area overlap is greater than a preset overlap threshold are determined as living skin areas, to obtain an updated living skin area of the object to be detected.
7. A liveness detection method implemented by using the liveness skin detection method according to any one of claims 1 to 6, characterized in that: include: Determine whether the speckle structured light image of the skin of the object to be detected contains a living skin area; If the living skin area is contained, the object to be detected is determined to be a living body; otherwise, the object to be detected is determined to be a non-living body.
8. A living skin detection system, characterized in that: include: An image acquisition module, used to acquire a speckle structured light image containing the skin of the object to be detected; A detection area division module, used for dividing the speckle structured light image into a plurality of continuous detection areas; An energy calculation module, used to calculate the frequency components corresponding to the discrete cosine transform coefficients of each detection area; The detection result output module determines the living skin area of the object to be detected according to the frequency components corresponding to the discrete cosine transform coefficients of each detection area.
9. A living skin detection device, characterized in that: include: It includes a processor and a storage medium communicatively connected to the processor, wherein the storage medium is suitable for storing a plurality of instructions; the processor is suitable for calling the instructions in the storage medium to execute the steps of implementing the living skin detection method according to any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores one or more computer-readable programs, and the one or more computer-readable programs can be executed by one or more processors. When the computer-readable program is executed by the processor, the live skin detection method as described in any one of claims 1 to 6 is implemented, or the live detection method as described in claim 7 is implemented.
Citation Information
Patent Citations
Living body human face detection method and apparatus
CN107798282A
Living body identification method, storage medium and terminal equipment
CN111382646A
Face image authenticity detection method and system, computer equipment and storage medium
CN112528969A
Living body detection model training method and device, electronic equipment and storage medium
CN116704617A
Living body detection method and system, electronic equipment and computer readable storage medium
CN119169705A