A face recognition method, device, electronic device and storage medium
By mapping 3D face data to 2D images and using the ORB algorithm to extract feature points, it solves the problem of complex feature extraction of 3D face data and the vulnerability of 2D images to external factors, achieving efficient and accurate face recognition.
Patent Information
- Application Number
- CN202011608791.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-30
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2040-12-30
AI Technical Summary
In the existing technology, the process of extracting features directly from three-dimensional face data is complicated, resulting in low face recognition efficiency, and two-dimensional images are easily affected by external factors such as lighting, makeup, and masks, resulting in low recognition accuracy.
By mapping three-dimensional face data to two-dimensional images, using the ORB algorithm to extract feature points, and combining the FAST and BRIEF algorithms for feature description, the feature extraction process is simplified, the recognition efficiency is improved, and the influence of external factors is reduced through coordinate adjustment of point cloud signals. .
It improves the efficiency and accuracy of face recognition, avoids the impact of external factors on recognition, and saves storage space and recognition time.
Smart Images

Figure CN112699795B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a face recognition method, device, electronic device and storage medium. Background Art
[0002] With the advancement of science and technology, face recognition technology has been applied to many fields. Three-dimensional face data carries the inherent information of the face itself, so face recognition based on three-dimensional face data can effectively avoid the influence of external factors and improve recognition accuracy.
[0003] In the related art, the implicit function corresponding to the three-dimensional face data is solved by the Poisson equation, a control matrix is calculated, and the features of the three-dimensional face data are determined based on the control matrix.
[0004] However, the calculation process of directly determining the corresponding features from three-dimensional face data is complicated, resulting in low recognition efficiency. Summary of the invention
[0005] The present disclosure provides a face recognition method, device, electronic device and storage medium to improve face recognition efficiency.
[0006] In a first aspect, an embodiment of the present disclosure provides a face recognition method, the method comprising:
[0007] For any pixel point included in the initial two-dimensional image, determine the target color value corresponding to the pixel point according to the coordinates of the point cloud signal in the three-dimensional data to be processed corresponding to the pixel point, wherein the size of the initial two-dimensional image is determined according to the three-dimensional data to be processed;
[0008] Adjusting the color value of each pixel in the initial two-dimensional image to a corresponding target color value to obtain a target two-dimensional image;
[0009] Face recognition is performed based on the features of the target two-dimensional image.
[0010] In the above scheme, the feature extraction process of three-dimensional data is relatively complicated and the amount of calculation is large; the feature extraction process of the two-dimensional image obtained by directly collecting the face is simple, but external factors such as lighting, makeup, and masks will affect the imaging of the two-dimensional image, resulting in a low accuracy rate of recognition based on the two-dimensional image. By combining three-dimensional face collection with two-dimensional feature extraction, that is, collecting the face to obtain three-dimensional data, the three-dimensional data contains the inherent information of the face itself and is less affected by external factors such as lighting, makeup, and masks; determining the target color value presented after the point cloud signal in the three-dimensional data to be processed is mapped to the corresponding pixel points of the initial two-dimensional image, and adjusting the color values of these pixels in the initial two-dimensional image to the corresponding target color values, the target two-dimensional image mapped by the three-dimensional data to be processed is obtained, thereby conveniently and quickly extracting facial features from the target two-dimensional image, which not only avoids the influence of external factors on face recognition, but also improves recognition efficiency.
[0011] In some optional implementations, performing face recognition based on the features of the target two-dimensional image includes:
[0012] The features of the target two-dimensional image are obtained by using an ORB (Oriented Fast and Rotated Brief) algorithm, and face recognition is performed based on the features of the target two-dimensional image.
[0013] The above scheme can efficiently and accurately extract the feature points of the above target two-dimensional image through the FAST (Features from Accelerated Segments Test) algorithm in the ORB algorithm, thereby improving the efficiency of the face recognition process; the BRIEF (Binary Robust Independent Elementary Features) algorithm in the ORB algorithm can be used to describe the features through binary vectors. When performing face recognition, it is only necessary to judge whether the features of the target two-dimensional image are consistent with the preset features (the features of the two-dimensional image corresponding to the preset three-dimensional data) based on the Hamming distance. If they are consistent, the match is successful, otherwise the match fails. That is, the ORB algorithm saves recognition time and improves the efficiency of three-dimensional face recognition; in addition, only a small amount of storage space is needed to store the binary feature description, saving data storage space.
[0014] In some optional implementations, the size of the initial two-dimensional image is determined by:
[0015] Determining a target aspect ratio according to a horizontal coordinate range and a vertical coordinate range of a point cloud signal in the three-dimensional data to be processed;
[0016] The length and width of the initial two-dimensional image are determined based on the target aspect ratio.
[0017] The above scheme can determine the rectangle formed by mapping the point cloud signals in the three-dimensional data to be processed on the plane formed by the X-axis and the Y-axis based on the horizontal coordinate range of the point cloud signals in the three-dimensional data to be processed (i.e., the maximum span of all the point cloud signals in the three-dimensional data to be processed in the X-axis direction) and the vertical coordinate range (i.e., the maximum span of all the point cloud signals in the three-dimensional data to be processed in the Y-axis direction); by using the aspect ratio of the rectangle as the aspect ratio of the above-mentioned initial two-dimensional image, it can be ensured that the rectangle formed by the initial two-dimensional image can be obtained by enlarging or reducing the above-mentioned rectangle, thereby realizing the subsequent correspondence between the point cloud signals in the three-dimensional data to be processed and the pixels of the two-dimensional image, and mapping the three-dimensional data to be processed to the two-dimensional image.
[0018] In some optional implementations, before determining the target color value corresponding to the pixel point, the method further includes:
[0019] Determine the coordinate range in the horizontal direction corresponding to each pixel point according to the number of pixel points corresponding to the length of the initial two-dimensional image and the coordinate range in the horizontal direction of the point cloud signal in the three-dimensional data to be processed; and determine the coordinate range in the vertical direction corresponding to each pixel point according to the number of pixel points corresponding to the width of the initial two-dimensional image and the coordinate range in the vertical direction of the point cloud signal in the three-dimensional data to be processed;
[0020] For any pixel point, the point cloud signal corresponding to the pixel point is determined according to the coordinate range in the horizontal direction and the coordinate range in the vertical direction corresponding to the pixel point.
[0021] In some optional implementations, for any pixel point, determining a point cloud signal corresponding to the pixel point according to a horizontal coordinate range and a vertical coordinate range corresponding to the pixel point includes:
[0022] For any pixel point, the point cloud signal in the coordinate range in the horizontal direction corresponding to the pixel point and in the coordinate range in the vertical direction corresponding to the pixel point in the three-dimensional data to be processed is used as the point cloud signal corresponding to the pixel point.
[0023] In some optional implementations, determining the target color value corresponding to the pixel point according to the coordinates of the point cloud signal in the to-be-processed three-dimensional data corresponding to the pixel point includes:
[0024] According to the correspondence between the preset coordinates and the preset values representing the colors, the preset values corresponding to the coordinates of each point cloud signal in the vertical direction are determined;
[0025] For any pixel point, the sum of the preset values of all point cloud signals corresponding to the pixel point is taken as the preset value corresponding to the pixel point;
[0026] If the corresponding maximum preset value of all pixels exceeds the color maximum value, the ratio of the color maximum value to the maximum preset value is determined, and the preset value corresponding to each pixel is adjusted based on the ratio to obtain the target color value corresponding to each pixel.
[0027] In some optional implementations, the color value of each pixel in the initial two-dimensional image is the minimum color value, and the larger the coordinate of the point cloud signal in the vertical direction, the larger the corresponding preset value.
[0028] In some optional implementations, before determining the target color value corresponding to the pixel point, the method further includes:
[0029] For any point cloud signal included in the original three-dimensional data, the coordinates of the point cloud signal are adjusted based on the coordinates of adjacent signals to obtain the three-dimensional data to be processed;
[0030] The adjacent signal is a point cloud signal in the original three-dimensional data whose distance from the point cloud signal is less than a preset distance.
[0031] In the above scheme, for the three-dimensional data obtained by collecting human faces, the changes in the point cloud signals are generally relatively gradual. By adjusting the coordinates of the point cloud signals based on the coordinates of the adjacent signals of any point cloud signals (the point cloud signals in the original three-dimensional data whose distance from the above point cloud signals is less than a preset distance), the outlier point cloud signals can be denoised, thereby preventing the outlier point cloud signals from affecting the accuracy of subsequent face recognition.
[0032] In some optional implementations, adjusting the coordinates of the point cloud signal based on the coordinates of adjacent signals to obtain the three-dimensional data to be processed includes:
[0033] Taking the weighted average of the coordinates of the adjacent signals as the target coordinates of the point cloud signal, and replacing the current coordinates of the point cloud signal with the target coordinates;
[0034] The closer the distance between the adjacent signal and the point cloud signal is, the larger the corresponding weight coefficient is.
[0035] In a second aspect, an embodiment of the present disclosure provides a face recognition device, including:
[0036] A color value determination module is used to determine, for any pixel point included in the initial two-dimensional image, a target color value corresponding to the pixel point according to the coordinates of the point cloud signal in the three-dimensional data to be processed corresponding to the pixel point, wherein the size of the initial two-dimensional image is determined by the image acquisition module according to the three-dimensional data to be processed;
[0037] An image acquisition module, used for adjusting the color value of each pixel in the initial two-dimensional image to a corresponding target color value to obtain a target two-dimensional image;
[0038] A recognition module is used to perform face recognition based on the features of the target two-dimensional image.
[0039] In a third aspect, an embodiment of the present disclosure provides an electronic device, including a processor and a memory;
[0040] Wherein, the memory stores program code, and when the program code is executed by the processor, the processor executes the face recognition method as described in any one of the first aspects.
[0041] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the face recognition method as described in any one of the first aspects is implemented.
[0042] In addition, the technical effects brought about by any implementation method in the second to fourth aspects can refer to the technical effects brought about by different implementation methods in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0044] Figure 1 A schematic flow chart of a first face recognition method provided in an embodiment of the present disclosure;
[0045] Figure 2 A schematic flow chart of a method for determining a point cloud signal corresponding to a pixel point provided in an embodiment of the present disclosure;
[0046] Figure 3 A schematic flow chart of a method for obtaining features of a target two-dimensional image provided by an embodiment of the present disclosure;
[0047] Figure 4 A schematic diagram of pixel points of a target two-dimensional image provided by an embodiment of the present disclosure;
[0048] Figure 5 A schematic flow chart of a second face recognition method provided in an embodiment of the present disclosure;
[0049] Figure 6A schematic diagram of the structure of a face recognition device provided by an embodiment of the present disclosure;
[0050] Figure 7 A schematic block diagram of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical solutions and advantages of the present disclosure clearer, the present disclosure will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0052] In the embodiments of the present disclosure, the term "and / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.
[0053] In the description of the present disclosure, it should be noted that, unless otherwise clearly specified and limited, the term "connection" should be understood in a broad sense, for example, it can be directly connected, or indirectly connected through an intermediate medium, or it can be the internal connection of two devices. For ordinary technicians in this field, the specific meanings of the above terms in the present disclosure can be understood according to specific circumstances.
[0054] 3D face data carries inherent information about the face itself, so face recognition based on 3D face data can effectively avoid the influence of external factors and improve recognition accuracy. In related technologies, the implicit function corresponding to the 3D face data is solved by the Poisson equation, and the control matrix is calculated, and the features of the 3D face data are determined based on the control matrix.
[0055] However, the calculation process of directly determining the corresponding features from three-dimensional face data is complicated, resulting in low recognition efficiency.
[0056] In order to improve the efficiency of face recognition, the embodiments of the present disclosure provide a face recognition method, device, electronic device and storage medium. The technical solution of the present disclosure and how the technical solution of the present disclosure solves the above-mentioned technical problems are described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present disclosure will be described below in conjunction with the accompanying drawings.
[0057] Figure 1 A schematic flow chart of a first face recognition method provided in an embodiment of the present disclosure, such as Figure 1As shown, the method may include:
[0058] Step 101: for any pixel point included in the initial two-dimensional image, determine the target color value corresponding to the pixel point according to the coordinates of the point cloud signal in the three-dimensional data to be processed corresponding to the pixel point.
[0059] The size of the initial two-dimensional image is determined according to the three-dimensional data to be processed.
[0060] As mentioned above, the feature extraction process of three-dimensional data is relatively complex and requires a lot of calculations. The feature extraction process of the two-dimensional image directly obtained by collecting the face is simple, but external factors such as lighting, makeup, and masks will affect the imaging of the two-dimensional image, resulting in a low accuracy rate of recognition based on the two-dimensional image.
[0061] In order to take into account both recognition efficiency and accuracy, this embodiment combines three-dimensional acquisition with two-dimensional feature extraction, that is, three-dimensional data is acquired from the face. The three-dimensional data contains the inherent information of the face itself and is less affected by external factors such as lighting, makeup, and masks. The three-dimensional data is then mapped to a two-dimensional image, so that facial features can be extracted conveniently and quickly, which not only avoids the influence of external factors on face recognition, but also improves recognition efficiency.
[0062] The above-mentioned three-dimensional data to be processed contains point cloud signals, and the coordinates of the point cloud signals are the coordinates (x, y, z) in three-dimensional space. The two-dimensional image contains pixel points, and the coordinates of the pixel points are the coordinates (x, y) in two-dimensional space. In this embodiment, to convert the three-dimensional data to be processed into a target two-dimensional image, first, the size of the two-dimensional image must correspond to the size of the rectangle formed by mapping the point cloud signal in the three-dimensional data to be processed on the plane formed by the X-axis and the Y-axis. Based on this, it is necessary to determine the size of the initial two-dimensional image based on the above-mentioned three-dimensional data to be processed;
[0063] In addition, the point cloud signal does not represent the color value, but uses the coordinate value of the point cloud signal in the vertical direction (perpendicular to the plane formed by the above X-axis and Y-axis, that is, the Z-axis) and the density of the point cloud signal to represent the ups and downs of the collected face. The two-dimensional image uses the color value of the pixel point to represent the ups and downs of the face in the image. Based on this, it is necessary to determine the point cloud signal in the three-dimensional data to be processed corresponding to the above pixel point, and determine the target color value corresponding to each pixel point in the two-dimensional image according to the coordinates of the corresponding point cloud signal.
[0064] This embodiment does not limit the specific implementation method of determining the size of the initial two-dimensional image according to the three-dimensional data to be processed. The size of the initial two-dimensional image can be determined by, but not limited to, the following methods:
[0065] Determining a target aspect ratio according to a horizontal coordinate range and a vertical coordinate range of a point cloud signal in the three-dimensional data to be processed;
[0066] The length and width of the initial two-dimensional image are determined based on the target aspect ratio.
[0067] As described above, in order to make the size of the two-dimensional image correspond to the size of the rectangle formed by mapping the point cloud signal in the three-dimensional data to be processed on the plane formed by the X-axis and the Y-axis, the rectangle formed by the initial two-dimensional image can be obtained only by enlarging or reducing the above rectangle, so that the point cloud signal in the three-dimensional data to be processed can be corresponded to the pixel points of the two-dimensional image, thereby mapping the three-dimensional data to be processed to the two-dimensional image.
[0068] In this embodiment, according to the coordinate range of the point cloud signal in the horizontal direction (i.e., the maximum span of all the point cloud signals in the three-dimensional data to be processed in the X-axis direction) and the coordinate range in the vertical direction (i.e., the maximum span of all the point cloud signals in the three-dimensional data to be processed in the Y-axis direction), the rectangle formed by mapping the point cloud signal in the three-dimensional data to be processed on the plane formed by the X-axis and the Y-axis can be determined; by taking the aspect ratio of the rectangle as the aspect ratio of the above-mentioned initial two-dimensional image, it can be ensured that the rectangle formed by the initial two-dimensional image can be obtained by enlarging or reducing the above-mentioned rectangle, thereby realizing the subsequent correspondence between the point cloud signal in the three-dimensional data to be processed and the pixel points of the two-dimensional image, and mapping the three-dimensional data to be processed to the two-dimensional image.
[0069] This embodiment takes the case where the three-dimensional data to be processed contains 100 point cloud signals (which may be more or less in actual applications) as an example:
[0070] The above 100 point cloud signals are recorded as point cloud signal 1, point cloud signal 2, point cloud signal 3, ... point cloud signal 100. The coordinates of point cloud signal 1 are (x1, y1, z1), the coordinates of point cloud signal 2 are (x2, y2, z2), the coordinates of point cloud signal 3 are (x3, y3, z3), ..., the coordinates of point cloud signal 100 are (x 100 ,y 100 ,z 100 ).
[0071] The coordinate values of the above 100 point cloud signals in the X-axis direction (horizontal direction) are sorted as follows: x1<x 35 <x 11 <……<x 64 ;
[0072] The coordinate values of the above 100 point cloud signals in the Y-axis direction (vertical direction) are sorted as follows: 93 <y2<y 61 <……<y 38 .
[0073] The horizontal coordinate range of the 100 point cloud signals in the above three-dimensional data to be processed is x1~x 64 ; The vertical coordinate range of the 100 point cloud signals in the above three-dimensional data to be processed is y 93 ~y 38 .
[0074] The size of the rectangle formed by mapping the point cloud signal in the three-dimensional data to be processed on the plane formed by the X-axis and the Y-axis is: 64 -x1)*(y 38 -y 93 ), the aspect ratio is (x 64 -x1) / (y 38 -y 93 ), and the length and width of the initial two-dimensional image are determined based on this aspect ratio.
[0075] The above is only an exemplary description of determining the length and width of the initial two-dimensional image. This embodiment does not specifically limit parameters such as the number of point cloud signals contained in the three-dimensional data to be processed and the order of coordinate values.
[0076] This embodiment can be used but is not limited to Figure 2 The point cloud signal corresponding to the above pixel point is determined in the manner shown:
[0077] Step 201: Determine the horizontal coordinate range corresponding to each pixel point based on the number of pixel points corresponding to the length of the initial two-dimensional image and the horizontal coordinate range of the point cloud signal in the three-dimensional data to be processed; and determine the vertical coordinate range corresponding to each pixel point based on the number of pixel points corresponding to the width of the initial two-dimensional image and the vertical coordinate range of the point cloud signal in the three-dimensional data to be processed.
[0078] As mentioned above, the size of the above-mentioned initial two-dimensional image is determined according to the three-dimensional data to be processed. The rectangle formed by the initial two-dimensional image can be obtained only by enlarging or reducing the rectangle formed by mapping the point cloud signal in the processed three-dimensional data on the plane formed by the X-axis and the Y-axis. Therefore, each pixel point of the initial two-dimensional image corresponds to a certain area of the rectangle formed by the point cloud signal in the three-dimensional data to be processed, and the point cloud signal of the area corresponding to each pixel point is the point cloud signal corresponding to the pixel point. Based on this, it is necessary to first determine the area in the rectangle formed by the point cloud signal in the three-dimensional data to be processed corresponding to each pixel point. Let's take the 100 point cloud signals contained in the three-dimensional data to be processed as an example:
[0079] The horizontal coordinate range of the 100 point cloud signals in the above three-dimensional data to be processed is x1~x 64; The vertical coordinate range of the 100 point cloud signals in the above three-dimensional data to be processed is y 93 ~y 38 .
[0080] The size of the initial two-dimensional image is 200*100, that is, the number of pixels corresponding to the length of the initial two-dimensional image is 200, and the number of pixels corresponding to the width is 100.
[0081] The horizontal span of the area corresponding to each pixel is x0=(x 64 -x1) / 200, the horizontal coordinate ranges of the pixels in each column of the initial two-dimensional image are: x1~[x1+(x 64 -x1) / 200], [x1+(x 64 -x1) / 200]~[x1+2*(x 64 -x1) / 200], [x1+2*(x 64 -x1) / 200]~[x1+3*(x 64 -x1) / 200], ... [x 64 -(x 64 -x1) / 200]~x 64 .
[0082] The vertical span of the point cloud signal corresponding to each pixel is y0=(y 38 -y 93 ) / 100, the vertical coordinate ranges of the pixels in each row of the initial two-dimensional image are: 38 ~[y 38 +(y 38 -y 93 ) / 100], [y 38 +(y 38 -y 93 ) / 100]~[y 38 +2*(y 38 -y 93 ) / 100], [y 38 +2*(y 38 -y 93 ) / 100]~[y 38 +3*(y 38 -y 93 ) / 100], ... [y 93 -(y 38 -y 93 ) / 100]~y 93 .
[0083] The above is only an example for describing how to determine the coordinate ranges in the horizontal and vertical directions corresponding to each pixel point, and the present embodiment is not limited thereto.
[0084] Step 202: For any pixel point, determine the point cloud signal corresponding to the pixel point according to the horizontal coordinate range and the vertical coordinate range corresponding to the pixel point.
[0085] In this embodiment, after determining the coordinate ranges in the horizontal and vertical directions corresponding to each pixel point, the rectangular area formed by mapping the point cloud signal in the three-dimensional data to be processed corresponding to each pixel point on the plane formed by the X-axis and the Y-axis is determined, and the point cloud signal in this area is the point cloud signal corresponding to the pixel point.
[0086] Exemplarily, for any pixel point, the point cloud signal in the coordinate range in the horizontal direction corresponding to the pixel point and the coordinate range in the vertical direction corresponding to the pixel point in the three-dimensional data to be processed is used as the point cloud signal corresponding to the pixel point. For example:
[0087] The horizontal coordinate range of a pixel point is x1~[x1+(x 64 -x1) / 200], the corresponding vertical coordinate range is y 38 ~[y 38 +(y 38 -y 93 ) / 100], the coordinate value of the three-dimensional data to be processed in the X-axis direction (horizontal direction) is not less than x1 and not greater than [x1+(x 64 -x1) / 200], the coordinate value in the Y-axis direction (vertical direction) is not less than y 38 and not greater than [y 38 +(y 38 -y 93 ) / 100] as the point cloud signal corresponding to the pixel.
[0088] The above is merely an example of determining the point cloud signal corresponding to a pixel point, and the present embodiment is not limited thereto.
[0089] As mentioned above, in a three-dimensional image, the vertical coordinate value (Z-axis coordinate value) of the point cloud signal and the density of the point cloud signal are used to characterize the ups and downs of the collected face. In a two-dimensional image, the ups and downs of the face in the image are characterized by the color value of the pixel point. After determining the point cloud signal corresponding to each pixel point, it is also necessary to determine the target color value corresponding to each pixel point in the two-dimensional image based on the coordinates of the point cloud signal corresponding to each pixel point.
[0090] In some optional embodiments, the color value of each pixel in the initial two-dimensional image is the minimum color value, and a large color value of a pixel represents that the pixel is a high point; in a three-dimensional image, the vertical coordinate value (Z-axis coordinate value) of the point cloud signal is large, and the density of the point cloud signal is large, which represents that this area is a high point. Therefore, the larger the vertical coordinate of the point cloud signal, the larger the corresponding preset value. The above-mentioned determination of the target color value corresponding to each pixel in the two-dimensional image based on the coordinates of the point cloud signal corresponding to each pixel can be achieved by, but not limited to, the following methods:
[0091] According to the correspondence between the preset coordinates and the preset values representing the colors, the preset values corresponding to the coordinates of each point cloud signal in the vertical direction are determined;
[0092] For any pixel point, the sum of the preset values of all point cloud signals corresponding to the pixel point is taken as the preset value corresponding to the pixel point;
[0093] If the corresponding maximum preset value of all pixels exceeds the color maximum value, the ratio of the color maximum value to the maximum preset value is determined, and the preset value corresponding to each pixel is adjusted based on the ratio to obtain the target color value corresponding to each pixel.
[0094] In this embodiment, by the correspondence between preset coordinates and preset values representing colors, by determining the preset values corresponding to the coordinates of each point cloud signal in the vertical direction in the correspondence, the preset values corresponding to each point cloud signal can be obtained conveniently and accurately. A pixel may not have a corresponding point cloud signal, but may correspond to one or more point cloud signals. If a pixel does not have a corresponding point cloud signal, the pixel does not have a corresponding target color value; if a pixel corresponds to only one point cloud signal, the preset value corresponding to the point cloud signal is used as the preset value corresponding to the pixel; if a pixel corresponds to multiple point cloud signals, the sum of the preset values corresponding to the multiple point cloud signals is used as the preset value corresponding to the pixel.
[0095] When a pixel corresponds to a large number of point cloud signals (the density of the point cloud signal is large); or when a pixel corresponds to a small number of point cloud signals, but the vertical coordinate value of the point cloud signal (Z-axis coordinate value) is large, the preset value corresponding to the pixel may exceed the color maximum value (255), and the preset values of all pixels need to be uniformly adjusted and normalized to the range of 0 to 255 to obtain a color value that meets the color requirements. Based on this, this embodiment compares the maximum preset value of all pixels with the color maximum value (255). If the maximum preset value exceeds the color maximum value, the preset value corresponding to each pixel is adjusted based on the ratio of the color maximum value to 255 to obtain the target color value corresponding to each pixel that meets the color requirements. Taking the maximum preset value of 350 as an example, the preset values corresponding to each pixel are multiplied by (255 / 350) to obtain the corresponding target color value.
[0096] The above scheme, through the correspondence between the preset coordinates and the preset values representing the colors, can conveniently and accurately obtain the preset values corresponding to the coordinates of each point cloud signal in the vertical direction based on the corresponding relationship, and then determine the preset values corresponding to each pixel point; when the number of point cloud signals corresponding to a pixel point is large (the density of the point cloud signal is large); or the number of point cloud signals corresponding to the pixel point is small, but the coordinate value of the point cloud signal in the vertical direction (Z-axis coordinate value) is large, the preset value corresponding to the pixel point may exceed the maximum color value (255), and the preset values of all pixel points need to be uniformly adjusted and normalized to the range of 0 to 255 to obtain the target color value that meets the color requirements.
[0097] In some other embodiments, the color value of each pixel in the initial two-dimensional image is the maximum color value, and a small color value of the pixel represents that the pixel is a high point; in a three-dimensional image, the vertical coordinate value (Z-axis coordinate value) of the point cloud signal is large, and the density of the point cloud signal is large, which represents that this area is a high point. Therefore, the larger the vertical coordinate of the point cloud signal, the smaller the corresponding preset value. The specific implementation method of determining the target color value corresponding to each pixel in the two-dimensional image is similar to the above embodiment and will not be repeated here. In this scenario, the preset value corresponding to the pixel may be less than the minimum color value (0), and the preset values of all pixels need to be uniformly adjusted and normalized to the range of 0 to 255 to obtain the target color value that meets the color requirements. The specific implementation method is also similar to the above embodiment and will not be repeated here.
[0098] Step 102: adjusting the color value of each pixel in the initial two-dimensional image to a corresponding target color value to obtain a target two-dimensional image.
[0099] As mentioned above, the target color value corresponding to the pixel is the color value presented after the corresponding point cloud signal is mapped to the initial two-dimensional image. Based on this, after determining the target color value corresponding to each pixel, the color values of these pixels in the initial two-dimensional image are adjusted to the corresponding target color values, and the target two-dimensional image mapped by the three-dimensional data to be processed is obtained.
[0100] Step 103: Perform face recognition based on the features of the target two-dimensional image.
[0101] As described above, the feature extraction process of the two-dimensional image is relatively simple, and based on the features of the target two-dimensional image, the face of the person to be processed in the three-dimensional data collection can be recognized efficiently and accurately.
[0102] This embodiment does not limit the specific implementation method of performing face recognition based on the features of the target two-dimensional image, for example:
[0103] The features of the target two-dimensional image are obtained by using an ORB algorithm, and face recognition is performed based on the features of the target two-dimensional image.
[0104] See also Figure 3 As shown, in some exemplary embodiments, the features of the above-mentioned target two-dimensional image are obtained by using the ORB algorithm, including the following steps:
[0105] Step 301: Determine the feature points of the above target two-dimensional image by using the FAST algorithm.
[0106] See also Figure 4 As shown, for any pixel point ( Figure 3 Take point p as an example), take the pixel point as the center, and select 16 pixels on a circle with a radius of 3 ( Figure 3 If the grayscale values of 12 consecutive pixels among the 16 pixels are greater than (Ip+h) or less than (Ip-h) at the same time, it means that point p is located in the area where the brightness changes, and point p is taken as a feature point. Among them, Ip is the grayscale value of point p, and h is the preset adjustment amount, which can be set according to the actual application scenario.
[0107] In order to select feature points more efficiently, the grayscale values of the above-mentioned pixels 1, 5, 9, and 13 can be compared with (Ip+h), and the grayscale values of the above-mentioned pixels 1, 5, 9, and 13 can be compared with (Ip-h). If the grayscale values of three or more of the above-mentioned pixels 1, 5, 9, and 13 are simultaneously greater than (Ip+h), or simultaneously less than (Ip-h), continue to compare the grayscale values of the remaining pixels with the above-mentioned (Ip+h) and (Ip-h). If there are 12 consecutive pixels whose grayscale values are simultaneously greater than (Ip+h), or simultaneously less than (Ip-h), point p is taken as a feature point; if there are no 12 consecutive pixels whose grayscale values are simultaneously greater than (Ip+h), or simultaneously less than (Ip-h), it is determined that point p is not a feature point. If the grayscale values of no more than three pixels among the above-mentioned pixels 1, 5, 9, and 13 are simultaneously greater than (Ip+h), or simultaneously less than (Ip-h), it is directly determined that point p is not a feature point.
[0108] This embodiment can efficiently and accurately extract the feature points of the above-mentioned target two-dimensional image through the FAST algorithm, thereby improving the efficiency of the face recognition process.
[0109] Step 302: Determine the direction information corresponding to each feature point of the target two-dimensional image by using the grayscale centroid method.
[0110] Step 303: Based on each feature point of the target two-dimensional image and the corresponding direction information, the feature of the target two-dimensional image is determined using the BRIEF algorithm.
[0111] For any feature point, first use a 2*N matrix S to represent the N pairs of points in the n*n neighborhood of the feature point; use the direction information of the feature point to determine the rotation angle of the feature point, and rotate the matrix S by the rotation angle of the feature point to obtain the rotation matrix S of the feature point θ ;
[0112] For S θ For any point set in the image, if the grayscale value of the previous pixel in the point set is greater than or equal to the grayscale value of the next pixel, the eigenvalue of the point set is 0, otherwise the eigenvalue is 1. In this way, the N-dimensional feature vector of the feature point is obtained, and the N-dimensional feature vector is a binary assignment. The feature vectors of all feature points of the target two-dimensional image are used as the features of the target two-dimensional image.
[0113] The BRIEF algorithm uses binary vectors to describe features. When performing face recognition, it only needs to judge whether the features of the target two-dimensional image are consistent with the preset features (the features of the two-dimensional image corresponding to the preset three-dimensional data) based on the Hamming distance. If they are consistent, the match is successful, otherwise the match fails. The above recognition process algorithm is simple, which saves recognition time and improves the efficiency of three-dimensional face recognition. In addition, only a small amount of storage space is needed to store the binary feature description, saving data storage space.
[0114] In the above scheme, the feature extraction process of three-dimensional data is relatively complicated and the amount of calculation is large. The feature extraction process of the two-dimensional image obtained by directly collecting the face is simple, but external factors such as lighting, makeup, and masks will affect the imaging of the two-dimensional image, resulting in a low accuracy rate of recognition based on the two-dimensional image. By combining three-dimensional acquisition with two-dimensional extraction, that is, the three-dimensional data obtained by collecting the face is three-dimensional data, which contains the inherent information of the face itself and is less affected by external factors such as lighting, makeup, and masks; determining the target color value presented after the point cloud signal in the three-dimensional data to be processed is mapped to the corresponding pixel points of the initial two-dimensional image, and adjusting the color values of these pixels in the initial two-dimensional image to the corresponding target color values, the target two-dimensional image mapped by the three-dimensional data to be processed is obtained, and then the facial features are extracted from the target two-dimensional image conveniently and quickly, which not only avoids the influence of external factors on face recognition, but also improves the recognition efficiency.
[0115] Figure 5 A schematic flow chart of a second face recognition method provided in an embodiment of the present disclosure, such as Figure 5 As shown, the method may include:
[0116] Step 501: for any point cloud signal included in the original three-dimensional data, the coordinates of the point cloud signal are adjusted based on the coordinates of adjacent signals to obtain the three-dimensional data to be processed.
[0117] The adjacent signal is a point cloud signal in the original three-dimensional data whose distance from the point cloud signal is less than a preset distance.
[0118] For the three-dimensional data obtained by collecting human faces, the changes in point cloud signals are generally relatively gentle. When outlier point cloud signals appear (these point cloud signals are far away from the coordinates of the surrounding point cloud signals), the outlier point cloud signals need to be denoised.
[0119] As mentioned above, the change of the point cloud signal is relatively slow, so for any point cloud signal, the coordinates of the point cloud signal can be adjusted by using the coordinates of the adjacent signals to the point cloud signal (the point cloud signal whose distance to the point cloud signal in the original three-dimensional data is less than the preset distance). The preset distance can be set according to the actual application scenario.
[0120] In this embodiment, since the point cloud signals whose distances to the point cloud signal are less than the preset distance are all used as the adjacent signals of the point cloud signal, some of these adjacent signals are closer to the point cloud signal, while others are slightly farther away. Even if the point cloud signal is not an outlier, these slightly farther adjacent signals may not be very close to the coordinates of the point cloud signal. Based on this, the coordinates of the point cloud signal are adjusted based on the coordinates of the adjacent signals to obtain the three-dimensional data to be processed, which can be achieved by but not limited to the following methods:
[0121] Taking the weighted average of the coordinates of the adjacent signals as the target coordinates of the point cloud signal, and replacing the current coordinates of the point cloud signal with the target coordinates;
[0122] The closer the distance between the adjacent signal and the point cloud signal is, the larger the corresponding weight coefficient is.
[0123] For a certain point cloud signal, take the point cloud signal having 10 adjacent signals (respectively recorded as adjacent signal 1, adjacent signal 2, adjacent signal 3, adjacent signal 4, adjacent signal 5, adjacent signal 6, adjacent signal 7, adjacent signal 8, adjacent signal 9 and adjacent signal 10) as an example:
[0124] These 10 adjacent signals are sorted from near to far according to the distance from the point cloud signal, and the sorting results are: adjacent signal 5, adjacent signal 2 and adjacent signal 7 (the distance between adjacent signal 2 and the point cloud signal, and the distance between adjacent signal 7 and the point cloud signal are the same), adjacent signal 8, adjacent signal 1, adjacent signal 3, adjacent signal 9, adjacent signal 10, adjacent signal 4 and adjacent signal 6.
[0125] The weight coefficient of adjacent signal 5 is 2; the weight coefficient of adjacent signal 2 is 1.5, the weight coefficient of adjacent signal 7 is 1.5; the weight coefficient of adjacent signal 8 is 1.1, the weight coefficient of adjacent signal 1 is 0.9, the weight coefficient of adjacent signal 3 is 0.8, the weight coefficient of adjacent signal 9 is 0.7, the weight coefficient of adjacent signal 10 is 0.6, the weight coefficient of adjacent signal 4 is 0.5 and the weight coefficient of adjacent signal 6 is 0.4.
[0126] The coordinates of adjacent signal 1 are labeled (x1, y1, z1), the coordinates of adjacent signal 2 are labeled (x2, y2, z2), the coordinates of adjacent signal 3 are labeled (x3, y3, z3), the coordinates of adjacent signal 4 are labeled (x4, y4, z4), the coordinates of adjacent signal 5 are labeled (x5, y5, z5), the coordinates of adjacent signal 6 are labeled (x6, y6, z6), the coordinates of adjacent signal 7 are labeled (x7, y7, z7), the coordinates of adjacent signal 8 are labeled (x8, y8, z8), the coordinates of adjacent signal 9 are labeled (x9, y9, z9), and the coordinates of adjacent signal 10 are labeled (x10, y10, z10). The target coordinates of the above point cloud signal are labeled (x0, y0, z0), where:
[0127] x0=(2*x1+1.5*x2+1.5*x3+1.1*x4+0.9*x5+0.8*x6+0.7*x7+0.6*x8+0.5*x9+0.4*x10) / 10;
[0128] y0=(2*y1+1.5*y2+1.5*y3+1.1*y4+0.9*y5+0.8*y6+0.7*y7+0.6*y8+0.5*y9+0.4*y10) / 10;
[0129] z0=(2*z1+1.5*z2+1.5*z3+1.1*z4+0.9*z5+0.8*z6+0.7*z7+0.6*z8+0.5*z9+0.4*z10) / 10.
[0130] This embodiment is only an example of a specific implementation method for obtaining the target coordinates of the point cloud signal. This embodiment does not specifically limit the number of adjacent signals, distance sorting, and weight coefficient allocation.
[0131] Step 502: for any pixel point included in the initial two-dimensional image, determine the target color value corresponding to the pixel point according to the coordinates of the point cloud signal in the three-dimensional data to be processed corresponding to the pixel point.
[0132] The size of the initial two-dimensional image is determined according to the three-dimensional data to be processed.
[0133] Step 503: adjusting the color value of each pixel in the initial two-dimensional image to a corresponding target color value to obtain a target two-dimensional image.
[0134] Step 504: Perform face recognition based on the features of the target two-dimensional image.
[0135] The implementation of steps 502-504 may refer to the implementation of steps 101-103 above, and will not be described in detail here.
[0136] In the above scheme, for the three-dimensional data obtained by collecting human faces, the changes in the point cloud signals are generally relatively gradual. By adjusting the coordinates of the point cloud signals based on the coordinates of the adjacent signals of any point cloud signals (the point cloud signals in the original three-dimensional data whose distance from the above point cloud signals is less than a preset distance), the outlier point cloud signals can be denoised, thereby preventing the outlier point cloud signals from affecting the accuracy of subsequent face recognition.
[0137] like Figure 6 As shown, based on the same inventive concept, the embodiment of the present disclosure provides a face recognition device 600, including: a color value determination module 601, an image acquisition module 602 and a recognition module 603. In some embodiments, the face recognition device may also include a noise processing module 604.
[0138] A color value determination module 601 is used to determine, for any pixel point included in the initial two-dimensional image, a target color value corresponding to the pixel point according to the coordinates of the point cloud signal in the three-dimensional data to be processed corresponding to the pixel point, wherein the size of the initial two-dimensional image is determined by the image acquisition module 602 according to the three-dimensional data to be processed;
[0139] An image acquisition module 602 is used to adjust the color value of each pixel in the initial two-dimensional image to a corresponding target color value to obtain a target two-dimensional image;
[0140] The recognition module 603 is used to perform face recognition based on the features of the target two-dimensional image.
[0141] In some optional implementations, the recognition module 603 performs face recognition based on the features of the target two-dimensional image, including:
[0142] The features of the target two-dimensional image are obtained by using an ORB algorithm, and face recognition is performed based on the features of the target two-dimensional image.
[0143] In some optional implementations, the image acquisition module 602 determines the size of the initial two-dimensional image by:
[0144] Determining a target aspect ratio according to a horizontal coordinate range and a vertical coordinate range of a point cloud signal in the three-dimensional data to be processed;
[0145] The length and width of the initial two-dimensional image are determined based on the target aspect ratio.
[0146] In some optional implementations, before determining the target color value corresponding to the pixel point, the color value determination module 601 is further configured to:
[0147] Determine the coordinate range in the horizontal direction corresponding to each pixel point according to the number of pixel points corresponding to the length of the initial two-dimensional image and the coordinate range in the horizontal direction of the point cloud signal in the three-dimensional data to be processed; and determine the coordinate range in the vertical direction corresponding to each pixel point according to the number of pixel points corresponding to the width of the initial two-dimensional image and the coordinate range in the vertical direction of the point cloud signal in the three-dimensional data to be processed;
[0148] For any pixel point, the point cloud signal corresponding to the pixel point is determined according to the coordinate range in the horizontal direction and the coordinate range in the vertical direction corresponding to the pixel point.
[0149] In some optional implementations, the color value determination module 601 determines, for any pixel point, a point cloud signal corresponding to the pixel point according to a horizontal coordinate range and a vertical coordinate range corresponding to the pixel point, including:
[0150] For any pixel point, the point cloud signal in the coordinate range in the horizontal direction corresponding to the pixel point and in the coordinate range in the vertical direction corresponding to the pixel point in the three-dimensional data to be processed is used as the point cloud signal corresponding to the pixel point.
[0151] In some optional implementations, the color value of each pixel in the initial two-dimensional image is the minimum color value, and the larger the coordinate of the point cloud signal in the vertical direction, the larger the corresponding preset value.
[0152] In some optional implementations, the color value determination module 601 determines the target color value corresponding to the pixel point according to the coordinates of the point cloud signal in the to-be-processed three-dimensional data corresponding to the pixel point, including:
[0153] According to the correspondence between the preset coordinates and the preset values representing the colors, the preset values corresponding to the coordinates of each point cloud signal in the vertical direction are determined;
[0154] For any pixel point, the sum of the preset values of all point cloud signals corresponding to the pixel point is taken as the preset value corresponding to the pixel point;
[0155] If the corresponding maximum preset value of all pixels exceeds the color maximum value, the ratio of the color maximum value to the maximum preset value is determined, and the preset value corresponding to each pixel is adjusted based on the ratio to obtain the target color value corresponding to each pixel.
[0156] In some optional implementations, the noise processing module 604 is used to adjust the coordinates of any point cloud signal included in the original three-dimensional data based on the coordinates of adjacent signals before the color value determination module 601 determines the target color value corresponding to the pixel point, so as to obtain the three-dimensional data to be processed;
[0157] The adjacent signal is a point cloud signal in the original three-dimensional data whose distance from the point cloud signal is less than a preset distance.
[0158] In some optional implementations, the noise processing module 604 adjusts the coordinates of the point cloud signal based on the coordinates of the adjacent signals to obtain the three-dimensional data to be processed, including:
[0159] Taking the weighted average of the coordinates of the adjacent signals as the target coordinates of the point cloud signal, and replacing the current coordinates of the point cloud signal with the target coordinates;
[0160] The closer the distance between the adjacent signal and the point cloud signal is, the larger the corresponding weight coefficient is.
[0161] Since the device is the device in the method in the embodiment of the present disclosure, and the principle of solving the problem by the device is similar to that of the method, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0162] like Figure 7 As shown, based on the same inventive concept, an embodiment of the present disclosure provides an electronic device 700, including: a processor 701 and a memory 702;
[0163] The memory 702 is used to store the computer program executed by the processor 701. The memory 702 can be a volatile memory, such as a random-access memory (RAM); the memory 702 can also be a non-volatile memory, such as a read-only memory, a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD), or the memory 702 is any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 702 can be a combination of the above memories.
[0164] The processor 701 may include one or more central processing units (CPU), graphics processing units (GPU) or digital processing units, etc.
[0165] The specific connection medium between the memory 702 and the processor 701 is not limited in the embodiments of the present disclosure. Figure 7In the embodiment, the memory 702 and the processor 701 are connected via a bus 703. The bus 703 is connected to the processor 701 via a bus 703. Figure 7 The connection between other components is shown by bold lines, which is only for schematic illustration and is not intended to be limiting. The bus 703 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0166] The memory stores program codes, and when the program codes are executed by the processor, the processor 701 performs the following process:
[0167] For any pixel point included in the initial two-dimensional image, determine the target color value corresponding to the pixel point according to the coordinates of the point cloud signal in the three-dimensional data to be processed corresponding to the pixel point, wherein the size of the initial two-dimensional image is determined according to the three-dimensional data to be processed;
[0168] Adjusting the color value of each pixel in the initial two-dimensional image to a corresponding target color value to obtain a target two-dimensional image;
[0169] Face recognition is performed based on the features of the target two-dimensional image.
[0170] In some optional implementations, the processor 701 is specifically configured to:
[0171] The features of the target two-dimensional image are obtained by using an ORB algorithm, and face recognition is performed based on the features of the target two-dimensional image.
[0172] In some optional implementations, the processor 701 is specifically configured to:
[0173] Determining a target aspect ratio according to a horizontal coordinate range and a vertical coordinate range of a point cloud signal in the three-dimensional data to be processed;
[0174] The length and width of the initial two-dimensional image are determined based on the target aspect ratio.
[0175] In some optional implementations, before determining the target color value corresponding to the pixel point, the processor 701 is further configured to:
[0176] Determine the coordinate range in the horizontal direction corresponding to each pixel point according to the number of pixel points corresponding to the length of the initial two-dimensional image and the coordinate range in the horizontal direction of the point cloud signal in the three-dimensional data to be processed; and determine the coordinate range in the vertical direction corresponding to each pixel point according to the number of pixel points corresponding to the width of the initial two-dimensional image and the coordinate range in the vertical direction of the point cloud signal in the three-dimensional data to be processed;
[0177] For any pixel point, the point cloud signal corresponding to the pixel point is determined according to the coordinate range in the horizontal direction and the coordinate range in the vertical direction corresponding to the pixel point.
[0178] In some optional implementations, the processor 701 is specifically configured to:
[0179] For any pixel point, the point cloud signal in the coordinate range in the horizontal direction corresponding to the pixel point and in the coordinate range in the vertical direction corresponding to the pixel point in the three-dimensional data to be processed is used as the point cloud signal corresponding to the pixel point.
[0180] In some optional implementations, the color value of each pixel in the initial two-dimensional image is the minimum color value, and the larger the coordinate of the point cloud signal in the vertical direction, the larger the corresponding preset value.
[0181] In some optional implementations, the processor 701 is specifically configured to:
[0182] According to the correspondence between the preset coordinates and the preset values representing the colors, the preset values corresponding to the coordinates of each point cloud signal in the vertical direction are determined;
[0183] For any pixel point, the sum of the preset values of all point cloud signals corresponding to the pixel point is taken as the preset value corresponding to the pixel point;
[0184] If the corresponding maximum preset value of all pixels exceeds the color maximum value, the ratio of the color maximum value to the maximum preset value is determined, and the preset value corresponding to each pixel is adjusted based on the ratio to obtain the target color value corresponding to each pixel.
[0185] In some optional implementations, before determining the target color value corresponding to the pixel point, the processor 701 is further configured to:
[0186] For any point cloud signal included in the original three-dimensional data, the coordinates of the point cloud signal are adjusted based on the coordinates of adjacent signals to obtain the three-dimensional data to be processed;
[0187] The adjacent signal is a point cloud signal in the original three-dimensional data whose distance from the point cloud signal is less than a preset distance.
[0188] In some optional implementations, the processor 701 is specifically configured to:
[0189] Taking the weighted average of the coordinates of the adjacent signals as the target coordinates of the point cloud signal, and replacing the current coordinates of the point cloud signal with the target coordinates;
[0190] The closer the distance between the adjacent signal and the point cloud signal is, the larger the corresponding weight coefficient is.
[0191] Since the electronic device is the electronic device that executes the method in the embodiment of the present disclosure, and the principle of solving the problem by the electronic device is similar to that of the method, the implementation of the electronic device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0192] The embodiment of the present disclosure provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the steps of the above-mentioned face recognition method are implemented. The readable storage medium may be a non-volatile readable storage medium.
[0193] The present disclosure is described above with reference to block diagrams and / or flow charts showing methods, devices (systems) and / or computer program products according to embodiments of the present disclosure. It should be understood that a block of a block diagram and / or flow chart diagram and a combination of blocks of a block diagram and / or flow chart diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer and / or other programmable face recognition device to produce a machine, so that instructions executed by a computer processor and / or other programmable face recognition device create methods for implementing the functions / actions specified in the block diagram and / or flow chart block.
[0194] Accordingly, the present disclosure may also be implemented in hardware and / or software (including firmware, resident software, microcode, etc.). Further, the present disclosure may take the form of a computer program product on a computer-usable or computer-readable storage medium, having a computer-usable or computer-readable program code implemented in the medium, for use by or in conjunction with an instruction execution system. In the context of the present disclosure, a computer-usable or computer-readable medium may be any medium that may contain, store, communicate, transmit, or convey a program for use by or in conjunction with an instruction execution system, device, or apparatus.
[0195] Although the preferred embodiments of the present disclosure have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present disclosure.
[0196] Obviously, those skilled in the art can make various changes and modifications to the present disclosure without departing from the spirit and scope of the present disclosure. Thus, if these modifications and variations of the present disclosure fall within the scope of the claims of the present disclosure and their equivalents, the present disclosure is also intended to include these modifications and variations.
Claims
1. A face recognition method, characterized in that: The method comprises: For any pixel point included in the initial two-dimensional image, determine the target color value corresponding to the pixel point according to the coordinates of the point cloud signal in the three-dimensional data to be processed corresponding to the pixel point, wherein the size of the initial two-dimensional image is determined according to the three-dimensional data to be processed, and determine the target color value corresponding to the pixel point according to the coordinates of the point cloud signal in the three-dimensional data to be processed corresponding to the pixel point, including: determining the preset value corresponding to the coordinate of each point cloud signal in the vertical direction according to the correspondence between the preset coordinates and the preset value representing the color; for any pixel point, take the sum of the preset values of all the point cloud signals corresponding to the pixel point as the preset value corresponding to the pixel point; if the corresponding maximum preset value among all the pixel points exceeds the color maximum value, determine the ratio of the color maximum value to the maximum preset value, and adjust the preset value corresponding to each pixel point based on the ratio to obtain the target color value corresponding to each pixel point; Adjusting the color value of each pixel in the initial two-dimensional image to a corresponding target color value to obtain a target two-dimensional image; Face recognition is performed based on the features of the target two-dimensional image.
2. The method according to claim 1, characterized in that The performing face recognition based on the features of the target two-dimensional image includes: The features of the target two-dimensional image are obtained by using an ORB algorithm, and face recognition is performed based on the features of the target two-dimensional image.
3. The method according to claim 1, characterized in that The size of the initial two-dimensional image is determined by: Determining a target aspect ratio according to a horizontal coordinate range and a vertical coordinate range of a point cloud signal in the three-dimensional data to be processed; The length and width of the initial two-dimensional image are determined based on the target aspect ratio.
4. The method according to claim 1, characterized in that Before determining the target color value corresponding to the pixel point, the method further includes: Determine the coordinate range in the horizontal direction corresponding to each pixel point according to the number of pixel points corresponding to the length of the initial two-dimensional image and the coordinate range in the horizontal direction of the point cloud signal in the three-dimensional data to be processed; and determine the coordinate range in the vertical direction corresponding to each pixel point according to the number of pixel points corresponding to the width of the initial two-dimensional image and the coordinate range in the vertical direction of the point cloud signal in the three-dimensional data to be processed; For any pixel point, the point cloud signal corresponding to the pixel point is determined according to the coordinate range in the horizontal direction and the coordinate range in the vertical direction corresponding to the pixel point.
5. The method according to claim 4, characterized in that For any pixel point, determining a point cloud signal corresponding to the pixel point according to a horizontal coordinate range and a vertical coordinate range corresponding to the pixel point includes: For any pixel point, the point cloud signal in the coordinate range in the horizontal direction corresponding to the pixel point and in the coordinate range in the vertical direction corresponding to the pixel point in the three-dimensional data to be processed is used as the point cloud signal corresponding to the pixel point.
6. The method according to claim 1, characterized in that The color value of each pixel point in the initial two-dimensional image is the minimum color value. The larger the coordinate of the point cloud signal in the vertical direction, the larger the corresponding preset value.
7. The method according to any one of claims 1 to 6, characterized in that: Before determining the target color value corresponding to the pixel point, the method further includes: For any point cloud signal included in the original three-dimensional data, the coordinates of the point cloud signal are adjusted based on the coordinates of adjacent signals to obtain the three-dimensional data to be processed; The adjacent signal is a point cloud signal in the original three-dimensional data whose distance from the point cloud signal is less than a preset distance.
8. The method according to claim 7, characterized in that Adjusting the coordinates of the point cloud signal based on the coordinates of the adjacent signals to obtain the three-dimensional data to be processed includes: Taking the weighted average of the coordinates of the adjacent signals as the target coordinates of the point cloud signal, and replacing the current coordinates of the point cloud signal with the target coordinates; The closer the distance between the adjacent signal and the point cloud signal is, the larger the corresponding weight coefficient is.
9. A face recognition device, characterized in that: The device includes: A color value determination module is used to determine, for any pixel point included in the initial two-dimensional image, a target color value corresponding to the pixel point according to the coordinates of the point cloud signal in the three-dimensional data to be processed corresponding to the pixel point, wherein the size of the initial two-dimensional image is determined by the image acquisition module according to the three-dimensional data to be processed, and the target color value corresponding to the pixel point according to the coordinates of the point cloud signal in the three-dimensional data to be processed corresponding to the pixel point includes: determining the preset value corresponding to the coordinate of each point cloud signal in the vertical direction according to the correspondence between the preset coordinates and the preset value representing the color; for any pixel point, taking the sum of the preset values of all the point cloud signals corresponding to the pixel point as the preset value corresponding to the pixel point; if the corresponding maximum preset value among all the pixels exceeds the color maximum value, determining the ratio of the color maximum value to the maximum preset value, and adjusting the preset value corresponding to each pixel point based on the ratio to obtain the target color value corresponding to each pixel point; An image acquisition module, used for adjusting the color value of each pixel in the initial two-dimensional image to a corresponding target color value to obtain a target two-dimensional image; A recognition module is used to perform face recognition based on the features of the target two-dimensional image.
10. An electronic device, characterized in that: include: Processor and memory; Wherein, the memory stores program code, and when the program code is executed by the processor, the processor executes the face recognition method as described in any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the face recognition method according to any one of claims 1 to 8 is implemented.
