A face orientation recognition method and device
By using thermal imaging and grayscale gradient data processing, the problems of low facial capture and positioning accuracy and slow response speed in existing technologies have been solved, achieving fast and accurate facial orientation recognition, which is suitable for split-screen display and projection technology.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BOE TECHNOLOGY GROUP CO LTD
- Filing Date
- 2022-07-22
- Publication Date
- 2026-04-24
AI Technical Summary
Existing technologies suffer from low recognition accuracy and slow response speed when capturing and locating faces, especially in split-screen display applications where it is difficult to achieve fast and accurate facial recognition and location.
By performing thermal imaging on the user's face to obtain a grayscale image of the face, and processing the grayscale gradient data, the orientation of the user's face is determined. The grayscale gradient data is used to characterize the three-dimensional structure of the face, so as to achieve fast and accurate facial orientation recognition.
It enables fast and accurate face tracking and orientation recognition in split-screen displays or projection technologies, reducing data processing volume, avoiding additional labeling costs, and improving recognition accuracy.
Smart Images

Figure CN115240276B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to a method and apparatus for facial orientation recognition. Background Technology
[0002] With the rapid development of computer science and sensor technology, motion capture technology has been increasingly widely applied in game design, motion analysis, dance capture, virtual reality, and other technologies. Existing video and optical motion capture are the main methods for analyzing human motion characteristics. Optical motion capture, in particular, is widely used and can be divided into active and passive types. The main difference lies in the fact that active capture uses active light-emitting devices such as LEDs, while passive capture mainly uses small balls coated with special materials that appear exceptionally bright under camera capture. Both active and passive motion capture require complex equipment, necessitating marking on various parts of the human body. Furthermore, various imaging devices are expensive, and the detection and recognition algorithms are complex, computationally intensive, and the detection results are not always accurate. For example, LED infrared positioning suffers from low accuracy and incomplete feedback data; passive imaging methods, due to the need for disposable object capture point materials, cannot achieve widespread commercial adoption; and active imaging cameras capture information, but suffer from complex algorithms, high bandwidth requirements, and difficulty in achieving fast display. However, in high-definition, high-speed display applications such as screen splitting (independent display of different screen areas), it is required to achieve fast and accurate recognition when capturing the user's face, so as to display and render the corresponding content in different display / projection areas to achieve a naked-eye 3D display effect.
[0003] Therefore, existing technologies suffer from low recognition accuracy and slow response speed when performing facial capture and positioning. Summary of the Invention
[0004] In view of the above problems, the present invention proposes a facial orientation recognition method and device, which requires less data processing when performing facial recognition and positioning, can achieve rapid positioning and recognition, and has good recognition accuracy.
[0005] In a first aspect, this application provides the following technical solution through an embodiment:
[0006] A facial orientation recognition method includes:
[0007] A thermal imaging process is performed on the user's face to obtain a grayscale image of the face; based on the grayscale data of each calculation region in the grayscale image of the face, grayscale gradient data of the face grayscale image is obtained; wherein, the grayscale gradient data is used to characterize the grayscale difference between adjacent calculation regions; a target facial orientation that matches the grayscale gradient data is determined from preset facial orientation data; wherein, the facial orientation data includes the correspondence between different facial orientations of the user's face and the grayscale gradient data.
[0008] Optionally, obtaining the grayscale gradient data of the facial grayscale image based on the grayscale data of each computational region in the facial grayscale image includes:
[0009] Based on the grayscale data of each calculation region in the facial grayscale image, a facial contour is determined in the facial grayscale image; based on the grayscale data of each calculation region within the facial contour, the grayscale gradient data is obtained.
[0010] Optionally, determining the facial contour in the facial grayscale image based on the grayscale data of each calculated region in the facial grayscale image includes:
[0011] The facial contour is determined in the facial grayscale image based on the magnitude between the grayscale data of each calculated region in the facial grayscale image and the pre-acquired contour grayscale reference value.
[0012] Optionally, the step of obtaining the contour grayscale reference value includes:
[0013] The user's face is subjected to digital imaging and thermal imaging to obtain a digital image of the face and a grayscale image to be located; a first reference contour of the user's face is identified in the digital image of the face; a second reference contour is determined in the grayscale image to be located based on the pixel coordinates of the first reference contour; and a contour grayscale reference value is determined based on the grayscale data of each calculated region in the second reference contour.
[0014] Optionally, determining the contour grayscale reference value based on the grayscale data of each calculated region in the second reference contour includes:
[0015] The mean value of the grayscale data of all calculated regions corresponding to the second reference contour is determined as the grayscale reference value of the contour.
[0016] Optionally, the grayscale gradient data includes horizontal gradient values and vertical gradient values; obtaining the grayscale gradient data based on the grayscale data of each calculation region within the facial contour includes:
[0017] For each calculation region, a horizontal gradient value is obtained based on the grayscale data of the calculation region and the grayscale data of a first adjacent region; the first adjacent region is a region located in the same row as the calculation region and adjacent to it. For each calculation region, a vertical gradient value is obtained based on the grayscale data of the calculation region and the grayscale data of a second adjacent region; the second adjacent region is a region located in the same column as the calculation region and adjacent to it.
[0018] Optionally, each computational region corresponds to a pixel coordinate.
[0019] Secondly, based on the same inventive concept, this application provides the following technical solution through an embodiment:
[0020] A facial orientation recognition device, comprising:
[0021] An image acquisition module is used to perform thermal imaging on a user's face to obtain a grayscale image of the face; a gradient data acquisition module is used to obtain grayscale gradient data of the face grayscale image based on the grayscale data of each calculation region in the face grayscale image; wherein, the grayscale gradient data is used to characterize the grayscale difference between adjacent calculation regions; a face orientation determination module is used to determine a target face orientation that matches the grayscale gradient data from preset face orientation data; wherein, the face orientation data includes the correspondence between different face orientations of the user's face and the grayscale gradient data.
[0022] Thirdly, based on the same inventive concept, this application provides the following technical solution through an embodiment:
[0023] An electronic device includes a processor and a memory coupled to the processor, the memory storing instructions that, when executed by the processor, cause the electronic device to perform the steps of any of the methods described in the first aspect above.
[0024] Fourthly, based on the same inventive concept, this application provides the following technical solution through an embodiment:
[0025] A readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in any of the first aspects above.
[0026] This invention provides a facial orientation recognition method and apparatus. It obtains a grayscale image of the user's face through thermal imaging, and then processes the grayscale data of each calculation region of the grayscale image to obtain grayscale gradient data. This grayscale gradient data represents the magnitude of the grayscale difference between adjacent calculation regions. Different angles of thermal radiation from different facial orientations result in different grayscale gradient data. Therefore, grayscale gradient data can effectively represent the three-dimensional structural features and orientation information of the user's face. Finally, the target facial orientation can be determined from preset facial orientation data using the grayscale gradient data. In this embodiment, the entire processing uses infrared imaging to capture the user's face and processes the readout data to form grayscale gradient data to characterize the user's facial features. Compared to existing infrared positioning and passive imaging methods, this method requires no additional marking, requires less data processing, and has higher accuracy. It can be well applied in split-screen displays or projection technologies for rapid facial tracking and facial orientation recognition.
[0027] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description
[0028] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings:
[0029] Figure 1 A flowchart of a facial orientation recognition method according to an embodiment of the present invention is shown;
[0030] Figure 2 A grayscale image of a face is shown in an embodiment of the present invention;
[0031] Figure 3 A schematic diagram of the calculation area of a facial grayscale image in an embodiment of the present invention is shown;
[0032] Figure 4 A flowchart illustrating the acquisition of facial contours in an embodiment of the present invention is shown;
[0033] Figure 5 A schematic diagram of a first reference contour determined based on a digital image is shown in an embodiment of the present invention;
[0034] Figure 6A schematic diagram of a facial orientation recognition device according to an embodiment of the present invention is shown. Detailed Implementation
[0035] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[0036] The implementation of glasses-free 3D requires capturing the user's face and quickly and accurately identifying their facial orientation to determine the screen area the user is interested in. Then, screen segmentation technology is used to focus rendering on that area, achieving the glasses-free 3D effect. However, some current face tracking technologies require additional labeling, resulting in high costs and poor user experience; others either have poor tracking accuracy or require large data processing volumes, making accurate and rapid identification and tracking difficult. To address this, this invention provides a facial orientation recognition method that can accurately and quickly capture and identify the user's facial orientation.
[0037] Please see Figure 1 The diagram shows a flowchart of a facial orientation recognition method according to an embodiment of the present invention. The facial orientation recognition method includes the following steps:
[0038] Step S10: Perform thermal imaging on the user's face to obtain a grayscale image of the face;
[0039] Step S20: Based on the grayscale data of each calculation region in the facial grayscale image, obtain the grayscale gradient data of the facial grayscale image; wherein, the grayscale gradient data is used to characterize the grayscale difference between adjacent calculation regions;
[0040] Step S30: Determine the target facial orientation that matches the grayscale gradient data from the preset facial orientation data; wherein the facial orientation data includes the correspondence between different facial orientations of the user's face and the grayscale gradient data.
[0041] This invention, through steps S10-S30, performs thermal imaging on the user's face to obtain a grayscale image. Then, it processes the grayscale data of each calculation region of the facial grayscale image to obtain grayscale gradient data. This grayscale gradient data represents the magnitude of the grayscale difference between adjacent calculation regions. Different angles of thermal radiation from different facial orientations will also result in different grayscale gradient data. Therefore, using grayscale gradient data can effectively represent the three-dimensional structural features and orientation information of the user's face. Finally, the target facial orientation can be determined from preset facial orientation data using the grayscale gradient data. In this embodiment, the entire processing uses infrared imaging to capture the user's face and processes the readout data during the process to form grayscale gradient data to characterize the user's facial features. Compared to existing infrared positioning and passive imaging methods, this method requires no additional marking, has less data processing volume, and higher accuracy. It can be well applied in split-screen displays or projection technologies for rapid facial tracking and facial orientation recognition. The specific implementation of each step is further described in detail below.
[0042] Step S10: Perform thermal imaging on the user's face to obtain a grayscale image of the face.
[0043] In step S10, when performing thermal imaging on the user's face, an infrared camera can be used for thermal imaging capture. It is understood that during thermal imaging, the user's face cannot be precisely captured; the obtained grayscale image of the face includes not only the user's face but also the background. Therefore, in subsequent processing, facial contours can be identified from the grayscale image, such as... Figure 2 As shown; then, the image data within the facial contour is processed to reduce the amount of data processing and improve the processing speed.
[0044] A grayscale image of the face can be output by a thermal imaging device. The resulting grayscale image of the face can include multiple computational regions, such as... Figure 3As shown, the computational regions include G(1,1), G(1,2), ..., G(1,n), G(2,1), ..., G(m,n). The size of each computational region can be determined by the computational precision. For more precise calculations, the computational region can be smaller, and vice versa. At its smallest, the region corresponding to a single pixel position can be considered a computational region, meaning one computational region corresponds to one pixel coordinate. The grayscale data of each computational region can be the grayscale value or grayscale value of that pixel. This implementation method ensures high computational precision. In other implementations, multiple pixels are divided into computational regions. The grayscale data of each computational region can be the average of the grayscale values or grayscale values of these multiple pixels. For example, four pixels arranged in a 2×2 grid can be used as one computational region, nine pixels arranged in a 3×3 grid can be used as one computational region, and so on. Multiple computational regions can also be obtained using the above division method. This implementation method can reduce the amount of data processing and improve the response speed of subsequent recognition.
[0045] Step S20: Based on the grayscale data of each calculation region in the facial grayscale image, obtain the grayscale gradient data of the facial grayscale image; wherein, the grayscale gradient data is used to characterize the grayscale difference between adjacent calculation regions.
[0046] In step S20, the grayscale data of each calculation region in the facial grayscale image can be processed to obtain grayscale step data. However, to improve processing efficiency and reduce data processing volume, the facial contour can be determined first in the facial grayscale image, and then only the image within the facial contour can be processed. That is, step S20 may include the following processing procedure:
[0047] First, facial contours are determined in the facial grayscale image based on the grayscale data of each computational region in the facial grayscale image; then, grayscale gradient data are obtained based on the grayscale data of each computational region within the facial contours.
[0048] In some implementations, facial contours can be determined based on grayscale images. For example, the grayscale image can be binarized, and the boundary between black and white areas in the binarized image can be used to define the facial contour. Alternatively, the difference in grayscale data between each computational region and its adjacent regions in the grayscale image can be calculated. Since there are generally significant thermal radiation variations at the boundary between the user's face and the image background, the grayscale data at these boundaries will also change. Based on this, when the difference in grayscale data between two adjacent computational regions exceeds a preset grayscale threshold, the boundary between these two adjacent computational regions can be considered as the contour boundary. Regions with larger grayscale values can be considered as areas within the facial contour, and regions with smaller grayscale values can be considered as areas outside the facial contour. When acquiring grayscale step data, only the areas within the facial contour can be processed. This method of facial contour determination does not require additional hardware costs; it only requires thermal imaging equipment.
[0049] In other implementations, a grayscale reference value for the facial contour can be found; then, based on the relationship between the grayscale data of each calculated region in the facial grayscale image and the contour grayscale reference value, the facial contour is determined in the facial grayscale image, such as... Figure 4 As shown. Specifically, by comparing the grayscale data of each calculated region in the facial grayscale image with the contour grayscale reference value, it can be determined whether the calculated region belongs to the area containing the facial contour; among them, the region where the grayscale data is the same as or close to the contour grayscale reference value is determined to be the area containing the facial contour. For example, when the difference between a calculated region and the contour grayscale reference value is 0, or less than a preset difference threshold, then the calculated region can be considered to be the area containing the facial contour. Determining the facial contour through the contour grayscale reference value can achieve facial localization more quickly and is more conducive to capturing and locating the face during rapid movement.
[0050] In this embodiment, the following method is provided to determine the contour grayscale reference value:
[0051] First, digital imaging and thermal imaging are performed on the user's face to obtain a digital facial image and a grayscale image to be located. Understandably, digital imaging of the user's face can be performed simultaneously during the initial execution of step S10; in subsequent applications, if the background and user remain unchanged, the contour grayscale reference value does not need to be changed, and digital imaging is no longer required. In this case, the resulting grayscale image to be located can be the facial grayscale image obtained during the initial execution of step S10, or it can be the image used alone to determine the contour grayscale reference value.
[0052] Then, the first reference contour of the user's face is identified in the digital facial image, such as... Figure 5As shown. The first reference contour can be automatically recognized and output by the digital camera, and the coordinates of each pixel of the first reference contour can be read. Of course, in some implementations, the obtained facial digital image can also be processed by edge recognition or contour recognition to determine the first reference contour; common edge recognition algorithms or contour recognition algorithms can be used to implement this, which will not be elaborated here. Because digital imaging can obtain more detailed data and digital images have less noise data, a more accurate facial contour can be obtained, ensuring that subsequent facial positioning is more accurate and reliable.
[0053] Next, based on the pixel coordinates of the first reference contour, a second reference contour is determined in the grayscale image to be located. Specifically, the pixel coordinates of the first reference contour can be mapped to the corresponding pixel coordinates in the grayscale image to be located; that is, each pixel coordinate in the first reference contour can find a corresponding pixel coordinate in the grayscale image to be located. The pixel coordinates of the first reference contour and the pixel coordinates of the second reference contour can be in a one-to-one correspondence, a one-to-many correspondence, or a many-to-one correspondence, without restriction.
[0054] For example, when the resolution of the digital facial image is less than that of the grayscale image to be located, the pixel coordinates of the first reference contour and the pixel coordinates of the second reference contour can have a one-to-many relationship; when the resolution of the digital facial image is greater than that of the grayscale image to be located, the pixel coordinates of the first reference contour and the pixel coordinates of the second reference contour can have a many-to-one relationship; when the resolution of the digital facial image and the grayscale image to be located are the same, the pixel coordinates of the first reference contour and the pixel coordinates of the second reference contour can have a one-to-one correspondence.
[0055] Finally, based on the grayscale data of each computational region in the second reference contour, a contour grayscale reference value is determined. Specifically, the average grayscale data of all computational regions corresponding to the second reference contour can be used as the contour grayscale reference value. For example, Where K is the outline grayscale reference value, G ( i,j ) Let N be the grayscale data of pixel (i,j), and N be the total number of pixels corresponding to the second reference contour. The contour grayscale reference value K is obtained by calculating the average grayscale data of the second reference contour. In fast-moving scenarios, the facial contour can be quickly located by comparing K with the grayscale data of each calculation region of the facial grayscale image, resulting in a fast response time. If the user and background remain unchanged, the contour grayscale reference value can be reused multiple times after the initial calculation until changes occur, effectively reducing the amount of digital image data processing and transmission, and improving processing efficiency.
[0056] The process of obtaining grayscale gradient data based on the grayscale data of each computational region within the facial contour can be as follows:
[0057] The grayscale gradient data of a computational region can represent the magnitude of the grayscale difference with its neighboring regions. In this embodiment, the grayscale gradient data can be divided into horizontal gradient values and vertical gradient values; the horizontal gradient value is used to represent the grayscale changes between different computational regions in a row of computational regions; the vertical gradient value is used to represent the grayscale changes between different computational regions in a column of computational regions. This allows the grayscale gradient data to more accurately represent the three-dimensional structural features of the user's face, achieving more accurate recognition. Specifically, for each computational region, a horizontal gradient value is obtained based on the grayscale data of the computational region and the grayscale data of the first adjacent region; the first adjacent region is the region located in the same row and adjacent to the computational region. For each computational region, a vertical gradient value is obtained based on the grayscale data of the computational region and the grayscale data of the second adjacent region; the second adjacent region is the region located in the same column and adjacent to the computational region.
[0058] It should be noted that the size of the first and second adjacent regions can be a single computational region or multiple computational regions. When there are multiple computational regions, the average grayscale data of these multiple computational regions can be obtained, and this average can be used as the grayscale data of the adjacent regions. This implementation method can reduce the influence of noise data, improve smoothness, and improve the accuracy of facial orientation representation.
[0059] In some implementations, it is assumed that the grayscale image within the facial contour in the facial grayscale image is represented as G(X,Y), and its size is m×n, such as... Figure 3 As shown. Using G x G y This represents the grayscale data of the calculated region in the x-th row and y-th column of the image. In this embodiment, we take one calculated region corresponding to one pixel coordinate as an example for explanation. This represents the gradient of G(X,Y) along the y-direction, also known as the longitudinal gradient value. Based on this, the longitudinal gradient value for each computational region can be obtained. Similarly, it is possible to... This represents the gradient of G(X,Y) along the x-direction, also known as the lateral gradient value. Based on this, the lateral gradient value of each computational region can be obtained.
[0060] Furthermore, regarding the longitudinal gradient value In this embodiment, the longitudinal gradient value can also be approximated using a difference method, thereby reducing computational and data transmission volumes and achieving a fast response. The difference method can be forward difference, backward difference, or central difference; the method is not limited. Here, Δy = G i+1,j -G i,jThe vertical gradient value is approximated by Δy, where Δy is the vertical gradient value at position G(i,j). Similarly, the horizontal gradient value along the x-direction can also be approximated by difference to improve processing efficiency. The gray values of each computational region can be represented as follows:
[0061] G x =|G i+1,j -G i,j |
[0062] Where i = 1, 2, 3, ..., m-1; j = 1, 2, 3, ..., n;
[0063] G y =|G i,j+1 -G i,j |
[0064] Where i = 1, 2, 3, ..., m; j = 1, 2, 3, ..., n-1.
[0065] It should be noted that gradient value processing can be omitted for the calculation regions at the edges, or the gray-level gradient data at these edge locations can be set to 0 so as not to affect the overall expression of the facial gray-level image.
[0066] After obtaining the grayscale gradient data, it can be stored in a table format in a preset register, which can be read and retrieved when step S30 is executed. The storage locations of each calculation area are shown in the table below:
[0067] Table 1. Gray-level gradient data for each calculation region.
[0068]
[0069]
[0070] Step S30: Determine the target facial orientation that matches the grayscale gradient data from the preset facial orientation data; wherein the facial orientation data includes the correspondence between different facial orientations of the user's face and the grayscale gradient data.
[0071] In step S30, the facial orientation data can be pre-calibrated data. For example, for each facial orientation of the user, the corresponding grayscale gradient data is calculated through steps S10-S20 above; multiple sets of grayscale gradient data can also be calibrated for each facial orientation, and then noise data is removed and averaging is performed to obtain the final usable facial orientation data; finally, all calibrated facial orientation data can be obtained. When higher accuracy is required for recognition, facial orientations can be calibrated in a more refined manner. Furthermore, after calibration, data fitting processing can be used to obtain more and more continuous facial orientation data.
[0072] During the matching process, commonly used similarity algorithms can be employed to match grayscale gradient data with facial orientation data to find the same or most similar target facial orientation. Alternatively, a multi-dimensional spatial algorithm can be used to index the target facial orientation in the facial orientation data that best matches the grayscale gradient data. Specific algorithm implementations can refer to existing methods and will not be elaborated upon here.
[0073] Once the target facial orientation is obtained, it can be mapped to the corresponding target display / projection area on the display / projection device. This allows for differentiated rendering of the target display / projection area, achieving glasses-free 3D. Alternatively, some implementations calculate the target display / projection area on the display / projection device based on the relative angle and position of the target facial orientation relative to a reference object (such as the display / projection device). The process of mapping the target facial orientation to the user-focused target display / projection area on the display / projection device can be implemented using existing technologies.
[0074] In summary, this embodiment uses thermal imaging to form a grayscale image of the face. Further, grayscale gradient data representing the three-dimensional features of the face is constructed from the grayscale data of this image, thus representing facial features with a small amount of data and achieving facial orientation recognition. Furthermore, based on this, the relative positional changes of the facial grayscale image can be used to establish the facial orientation and the display / projection information of the display / projection device, enabling the localization of specific areas on the smart screen. Simultaneously, this embodiment also incorporates a digital camera to locate the facial contour, achieving accurate facial contour recognition. Moreover, the digital image does not participate in subsequent gradient calculations, reducing the computational load and thus enabling rapid response during the localization process.
[0075] Please see Figure 6 Based on the same inventive concept, another embodiment of the present invention also provides a facial orientation recognition device 300, the facial orientation recognition device 300 comprising:
[0076] The image acquisition module 301 is used to perform thermal imaging on the user's face to obtain a grayscale image of the face.
[0077] The gradient data acquisition module 302 is used to obtain grayscale gradient data of the facial grayscale image based on the grayscale data of each calculation region in the facial grayscale image; wherein, the grayscale gradient data is used to characterize the grayscale difference between adjacent calculation regions;
[0078] The facial orientation determination module 303 is used to determine a target facial orientation that matches the grayscale gradient data from preset facial orientation data; wherein the facial orientation data includes the correspondence between different facial orientations of the user's face and the grayscale gradient data.
[0079] As an optional implementation, the gradient data acquisition module 302 is specifically used for:
[0080] Based on the grayscale data of each calculation region in the facial grayscale image, a facial contour is determined in the facial grayscale image; based on the grayscale data of each calculation region within the facial contour, the grayscale gradient data is obtained.
[0081] As an optional implementation, the gradient data acquisition module 302 is specifically used for:
[0082] The facial contour is determined in the facial grayscale image based on the magnitude between the grayscale data of each calculated region in the facial grayscale image and the pre-acquired contour grayscale reference value.
[0083] As an optional implementation, a contour grayscale reference value acquisition module is also included, used for:
[0084] The user's face is subjected to digital imaging and thermal imaging to obtain a digital image of the face and a grayscale image to be located; a first reference contour of the user's face is identified in the digital image of the face; a second reference contour is determined in the grayscale image to be located based on the pixel coordinates of the first reference contour; and a contour grayscale reference value is determined based on the grayscale data of each calculated region in the second reference contour.
[0085] As an optional implementation, the contour grayscale reference value acquisition module is specifically used for:
[0086] The mean value of the grayscale data of all calculated regions corresponding to the second reference contour is determined as the grayscale reference value of the contour.
[0087] As an optional implementation, the grayscale gradient data includes horizontal gradient values and vertical gradient values; the gradient data acquisition module 302 is further specifically used for:
[0088] For each calculation region, a horizontal gradient value is obtained based on the grayscale data of the calculation region and the grayscale data of a first adjacent region; the first adjacent region is a region located in the same row as the calculation region and adjacent to it. For each calculation region, a vertical gradient value is obtained based on the grayscale data of the calculation region and the grayscale data of a second adjacent region; the second adjacent region is a region located in the same column as the calculation region and adjacent to it.
[0089] As an optional implementation, one calculation region corresponds to one pixel coordinate.
[0090] It should be noted that the face orientation recognition device 300 provided in this embodiment of the invention has the same specific implementation and technical effects as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in the device embodiment can be referred to the corresponding content in the aforementioned method embodiment.
[0091] Based on the same inventive concept, another embodiment of the present invention provides an electronic device, including a processor and a memory, wherein the memory is coupled to the processor and stores instructions. When the instructions are executed by the processor, the electronic device performs the steps of any of the methods described in the foregoing embodiments. It should be noted that in the electronic device provided by the embodiments of the present invention, the specific implementation of each step and the resulting technical effects are the same as in the foregoing method embodiments when the instructions are executed by the processor. For the sake of brevity, any parts not mentioned in this embodiment can be referred to the corresponding content in the foregoing method embodiments.
[0092] Based on the same inventive concept, another embodiment of the present invention provides a readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of any of the methods described in the foregoing method embodiments. It should be noted that, in the readable storage medium provided in this embodiment, when the program is executed by a processor, the specific implementation of each step and the resulting technical effects are the same as in the foregoing method embodiments. For the sake of brevity, any parts not mentioned in this embodiment can be referred to the corresponding content in the foregoing method embodiments.
[0093] The term "and / or" as used herein is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects are in an "or" relationship; the word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of multiple such elements. This invention can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims listing several means, several of these means can be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names.
[0094] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0095] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0096] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0097] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0098] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the invention.
[0099] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A method for facial orientation recognition, characterized in that, include: Perform thermal imaging on the user's face to obtain a grayscale image of the face; Based on the grayscale data of each computational region in the facial grayscale image, grayscale gradient data of the facial grayscale image is obtained; wherein, the grayscale gradient data is used to characterize the grayscale difference between adjacent computational regions; From preset facial orientation data, a target facial orientation that matches the grayscale gradient data is determined; wherein, the facial orientation data includes the correspondence between different facial orientations of the user's face and the grayscale gradient data; The step of obtaining grayscale gradient data of the facial grayscale image based on the grayscale data of each calculation region in the facial grayscale image includes: determining a facial contour in the facial grayscale image based on the grayscale data of each calculation region in the facial grayscale image; and obtaining the grayscale gradient data based on the grayscale data of each calculation region within the facial contour. Determining a facial contour in the facial grayscale image based on the grayscale data of each calculated region in the facial grayscale image includes: determining the facial contour in the facial grayscale image based on the magnitude between the grayscale data of each calculated region in the facial grayscale image and a pre-acquired contour grayscale reference value; the step of acquiring the contour grayscale reference value includes: performing digital imaging and thermal imaging on the user's face respectively to obtain a facial digital image and a grayscale image to be located; identifying a first reference contour of the user's face in the facial digital image; determining a second reference contour in the grayscale image to be located based on the pixel coordinates of the first reference contour; and determining a contour grayscale reference value based on the grayscale data of each calculated region in the second reference contour.
2. The method according to claim 1, characterized in that, The step of determining the contour grayscale reference value based on the grayscale data of each calculated region in the second reference contour includes: The mean value of the grayscale data of all calculated regions corresponding to the second reference contour is determined as the grayscale reference value of the contour.
3. The method according to claim 1, characterized in that, The grayscale gradient data includes horizontal gradient values and vertical gradient values; obtaining the grayscale gradient data based on the grayscale data of each calculation region within the facial contour includes: For each computational region, a horizontal gradient value is obtained based on the grayscale data of the computational region and the grayscale data of a first adjacent region; the first adjacent region is a region located in the same row as the computational region and adjacent to it. For each calculation region, a vertical gradient value is obtained based on the grayscale data of the calculation region and the grayscale data of the second adjacent region; the second adjacent region is the region located in the same column as the calculation region and adjacent to it.
4. The method according to claim 1, characterized in that, The calculation area corresponds to a pixel coordinate.
5. A facial orientation recognition device, characterized in that, include: The image acquisition module is used to perform thermal imaging of the user's face to obtain a grayscale image of the face. The gradient data acquisition module is used to obtain grayscale gradient data of the facial grayscale image based on the grayscale data of each calculation region in the facial grayscale image; wherein, the grayscale gradient data is used to characterize the grayscale difference between adjacent calculation regions; A facial orientation determination module is used to determine a target facial orientation that matches the grayscale gradient data from preset facial orientation data; wherein, the facial orientation data includes the correspondence between different facial orientations of the user's face and the grayscale gradient data; The step of obtaining grayscale gradient data of the facial grayscale image based on the grayscale data of each calculation region in the facial grayscale image includes: determining a facial contour in the facial grayscale image based on the grayscale data of each calculation region in the facial grayscale image; and obtaining the grayscale gradient data based on the grayscale data of each calculation region within the facial contour. Determining a facial contour in the facial grayscale image based on the grayscale data of each calculated region in the facial grayscale image includes: determining the facial contour in the facial grayscale image based on the magnitude between the grayscale data of each calculated region in the facial grayscale image and a pre-acquired contour grayscale reference value; the step of acquiring the contour grayscale reference value includes: performing digital imaging and thermal imaging on the user's face respectively to obtain a facial digital image and a grayscale image to be located; identifying a first reference contour of the user's face in the facial digital image; determining a second reference contour in the grayscale image to be located based on the pixel coordinates of the first reference contour; and determining a contour grayscale reference value based on the grayscale data of each calculated region in the second reference contour.
6. An electronic device, characterized in that, The device includes a processor and a memory, the memory being coupled to the processor, the memory storing instructions that, when executed by the processor, cause the electronic device to perform the steps of the method according to any one of claims 1-4.
7. A readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the steps of the method described in any one of claims 1-4.
Citation Information
Patent Citations
Face direction estimation apparatus and program thereof
JP2018022416A