Face recognition image processing method and device and computer equipment
By adjusting the shooting parameters and color depth processing of the image acquisition device, a face recognition image that contains only one face image and has low resource occupancy is generated, which solves the problem of low efficiency in traditional face recognition methods and achieves a more efficient face Identify.
Patent Information
- Application Number
- CN202411512218.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-28
- Publication Date
- 2025-02-07
AI Technical Summary
In traditional face recognition methods, the face recognition images collected by the image acquisition device occupy more computer resources, resulting in low face recognition efficiency.
By responding to the user's face recognition request, the standard pupil distance and the shooting parameters of the image acquisition device are determined, and the control device takes the face under these parameters, obtains the initial grid map, and adjusts its color depth to generate an updated grid map. The updated raster image contains only one face image, and the pupil distance is the same as the standard pupil distance, as the final face recognition image.
By reducing the computer resources occupied by the raster map, the transmission efficiency of updating the raster map is improved, and the success rate and efficiency of face recognition are improved.
Smart Images

Figure CN119399812A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a face recognition image processing method, apparatus, computer equipment, computer-readable storage medium and computer program product. Background Art
[0002] With the increasing application of artificial intelligence in various industries, face recognition has become a standard feature of the client. Compared with the traditional username and password login, face recognition eliminates the need to enter the user name and password. However, the face recognition speed of the client is related to many factors, which depends not only on the face comparison algorithm on the back end, but also on the efficiency and quality of the face image capture on the front end.
[0003] In the traditional method, after the face recognition image is collected by the image acquisition device, it is directly sent to the background for face recognition. However, the image acquisition parameters used by the general image acquisition device for image acquisition are relatively high. Correspondingly, it means that the collected face recognition image occupies more computer resources. Directly sending the face recognition image to the background for face recognition has the problem of low efficiency. Summary of the invention
[0004] Based on this, it is necessary to provide a face recognition image processing method, device, computer equipment, computer-readable storage medium and computer program product that can improve face recognition efficiency in response to the above technical problems.
[0005] In a first aspect, the present application provides a face recognition image processing method, comprising:
[0006] In response to a face recognition request triggered by a user based on an image acquisition device, determining a standard pupil distance and shooting parameters used by the image acquisition device;
[0007] Controlling the image acquisition device to shoot the user's face under the shooting parameters to obtain an initial grid image;
[0008] Adjusting the color depth of the initial raster image to obtain an updated raster image;
[0009] In a case where the updated grid image contains only one face image and the pupil distance of the face image is the same as the standard pupil distance, the updated grid image is used as the face recognition image corresponding to the face recognition request.
[0010] In one embodiment, determining the shooting parameters used by the image acquisition device includes:
[0011] Acquire standard shooting parameters and a plurality of candidate shooting parameters supported by the image acquisition device;
[0012] Based on the matching of the standard shooting parameters with the candidate shooting parameters, a target shooting parameter is determined from the candidate shooting parameters.
[0013] In one embodiment, controlling the image acquisition device to capture the user's face under the capture parameters to obtain an initial grid image includes:
[0014] Controlling the image acquisition device to shoot the user's face under the shooting parameters to obtain a shot image;
[0015] The format of the captured image is converted to obtain an initial grid image corresponding to the captured image.
[0016] In one embodiment, the grid image includes a plurality of pixel points; each of the pixel points corresponds to a pixel value;
[0017] The step of adjusting the color depth of the initial raster image to obtain an updated raster image includes:
[0018] For each of the pixel points, the pixel value corresponding to the pixel point is separated to obtain multiple color channel values corresponding to the pixel value;
[0019] Scaling each of the color channel values, combining the scaled values of the color channel values, and obtaining an updated pixel value corresponding to the pixel point;
[0020] Based on each of the updated pixel values, an updated grid map is determined.
[0021] In one embodiment, the method further comprises:
[0022] Extracting facial features from the updated grid image to obtain facial feature information;
[0023] Based on the facial feature information, determining the number of faces in the updated grid image and the completeness of the faces;
[0024] When the number of faces is greater than one or the completeness does not satisfy the completeness condition, the process returns to the step of controlling the image acquisition device to shoot the user's face under the shooting parameters to obtain an initial grid image, until the number of faces is equal to one and the completeness satisfies the completeness condition, and it is determined that the updated grid image contains only one face image.
[0025] In one embodiment, the facial feature information includes coordinate information of two pupils; the method further includes:
[0026] Based on each of the coordinate information, determining the pupil distance between the two pupils;
[0027] When the pupil distance is not equal to the standard pupil distance, the process returns to the step of controlling the image acquisition device to shoot the user's face under the shooting parameters to obtain an initial grid image until the pupil distance of the face image is the same as the standard pupil distance.
[0028] In a second aspect, the present application also provides a face recognition image processing device, comprising:
[0029] A request response module, configured to respond to a face recognition request triggered by an image acquisition device by a user, and determine a standard pupil distance and shooting parameters used by the image acquisition device;
[0030] A shooting control module, used for controlling the image acquisition device to shoot the user's face under the shooting parameters to obtain an initial grid image;
[0031] A color depth adjustment module, used for adjusting the color depth of the initial raster image to obtain an updated raster image;
[0032] The face recognition image determination module is used to use the updated grid image as the face recognition image corresponding to the face recognition request when the updated grid image contains only one face image and the pupil distance of the face image is the same as the standard pupil distance.
[0033] In a third aspect, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the above method are implemented.
[0034] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0035] In a fifth aspect, the present application further provides a computer program product, wherein the computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0036] The above-mentioned face recognition image processing method, device, computer equipment, computer-readable storage medium and computer program product, on the one hand, in response to a face recognition request triggered by a user based on an image acquisition device, determine the standard pupil distance and the shooting parameters used by the image acquisition device, can determine the shooting situation of the image acquisition device, control the image acquisition device to shoot the user's face under the shooting parameters, obtain an initial raster image, adjust the color depth of the initial raster image, and obtain an updated raster image to reduce the computer resources occupied by the raster image, thereby improving the efficiency of subsequent transmission of the updated raster image. On the other hand, when the updated raster image contains only a face image and the pupil distance of the face image is the same as the standard pupil distance, the updated raster image is used as the face recognition image corresponding to the face recognition request, which can improve the face recognition success rate of the updated raster image, thereby improving the efficiency of face recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0038] Figure 1 A diagram showing an application environment of a face recognition image processing method in one embodiment;
[0039] Figure 2 A schematic diagram of a process flow of a face recognition image processing method in one embodiment;
[0040] Figure 3 A schematic diagram of a process flow of face recognition image processing steps in one embodiment;
[0041] Figure 4 A schematic diagram of a flow chart of a face recognition image processing method in another embodiment;
[0042] Figure 5 is a structural block diagram of a face recognition image processing device in one embodiment;
[0043] Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0045] The face recognition image processing method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the controller 102 can be a control chip, or a controller including a control chip. The controller 102 can be set separately, communicate with the image acquisition device 104 through a network, or be integrated on the image acquisition device 104. The image acquisition device 104 can be, but is not limited to, a device with an image data acquisition function, such as a camera, a video camera, a scanner, or a laser radar, or various desktop computers, laptops, smart phones, tablet computers, Internet of Things devices, and portable wearable devices integrated with image acquisition devices. Specifically, in the process of performing face recognition image processing, the controller 102 responds to the face recognition request triggered by the user based on the image acquisition device 104, determines the standard pupil distance, and the shooting parameters used by the image acquisition device 104; controls the image acquisition device 104 to shoot the user's face under the shooting parameters to obtain an initial raster image; adjusts the color depth of the initial raster image to obtain an updated raster image; when the updated raster image contains only one face image, and the pupil distance of the face image is the same as the standard pupil distance, the updated raster image is used as the face recognition image corresponding to the face recognition request.
[0046] In an exemplary embodiment, Figure 2 As shown, a face recognition image processing method is provided, and the method is applied to Figure 1 The controller 102 in FIG. 1 is taken as an example to illustrate the method, which includes the following steps S202 to S208. Among them:
[0047] Step S202, in response to a face recognition request triggered by the user based on the image acquisition device, determining a standard pupil distance and shooting parameters used by the image acquisition device.
[0048] Among them, the image acquisition device can be, but is not limited to, a device with an image data acquisition function, such as a camera, a video camera, a scanner, or a laser radar, or various desktop computers, laptops, smart phones, tablet computers, Internet of Things devices, and portable wearable devices integrated with image acquisition devices. Face recognition request refers to a process of identity recognition or verification using face recognition technology. In this process, the system obtains the user's face image through a camera or an image acquisition device, and then uses a face recognition algorithm to analyze and compare the image to confirm the user's identity or perform related operations. Pupil distance refers to the distance between the centers of the pupils of the two eyes, or the distance between the centers of the pupils when the two eyes are looking straight ahead and the lines of sight are parallel. Pupil distance can be used to reflect the size of the face in the face image, and then reflect the distance between the face and the image acquisition device. Standard pupil distance refers to the pupil distance under specific standard conditions. Shooting parameters refer to the parameters used by the image acquisition device when capturing and shooting images. For example, the shooting parameters may include focus mode, pixel size, sensor type, and photo size. In this embodiment, the shooting parameters mainly refer to the photo size when the image acquisition device is capturing and shooting. Exemplarily, the controller may also set the focus mode of the image acquisition device to "auto focus" to increase the imaging speed.
[0049] Specifically, when the user has a need for face recognition, a face recognition request can be initiated based on the image acquisition device. On this basis, the controller can first determine the standard pupil distance and the shooting parameters used by the image acquisition device to determine the shooting situation of the image acquisition device. In a specific embodiment, the image acquisition device may support multiple candidate shooting parameters. Therefore, the controller needs to obtain the standard shooting parameters and multiple candidate shooting parameters supported by the image acquisition device, match the standard shooting parameters with each candidate shooting parameter, and determine the target shooting parameters from each candidate shooting parameter. In another specific embodiment, the current shooting parameters currently being used by the image acquisition device can also be directly used.
[0050] Step S204, controlling the image acquisition device to shoot the user's face under the shooting parameters to obtain an initial grid image.
[0051] Among them, the raster image is based on a grid data model composed of a set of rows and columns, using a set of squares (or pixels) to describe the image. Each square (pixel) is assigned a specific position and color (or grayscale) value. The initial raster image refers to the original raster image without further processing or modification.
[0052] Specifically, after determining the shooting parameters used by the image acquisition device, the image acquisition device can be controlled to shoot the user's face under the shooting parameters to obtain an initial raster image for subsequent color depth adjustment. In a specific embodiment, the controller can control the image acquisition device to shoot the user's face under the shooting parameters to obtain a captured image, perform format conversion on the captured image, and obtain an initial raster image corresponding to the captured image. In another specific embodiment, after the captured image is format converted to obtain the initial raster image corresponding to the captured image, a color correction operation can also be performed on the initial raster image.
[0053] Step S206, adjusting the color depth of the initial raster image to obtain an updated raster image.
[0054] In the field of computer graphics, color depth refers to the number of bits used to store the color of 1 pixel in a bitmap or video frame buffer, also known as bits per pixel (bpp), which is used to describe the number of colors that can be represented by each pixel in the image. The updated raster image refers to the raster image obtained after processing the initial raster image.
[0055] Specifically, since the color depth of the image captured by the image acquisition device is generally high, such a high color is not required for most face recognition services, and a raster image with a higher color depth occupies more computer resources and is slower to transmit. Therefore, the color depth of the initial raster image can be adjusted to obtain an updated raster image. In a specific embodiment, the controller can separate the pixel value corresponding to each pixel in the raster image to obtain multiple color channel values corresponding to the pixel value, scale each color channel value, merge the scaled values of each color channel value, obtain the updated pixel value corresponding to the pixel, and determine the updated raster image based on each updated pixel value. In another specific embodiment, a color depth adjustment model can also be established in advance, and the initial raster image can be used as the input of the color depth adjustment model, and the output is the updated raster image.
[0056] Step S208: When the updated grid image contains only one face image and the pupil distance of the face image is the same as the standard pupil distance, the updated grid image is used as the face recognition image corresponding to the face recognition request.
[0057] The facial image refers to an image that depicts or captures human facial features, including all physical features of the face. The facial recognition image refers to an image that is subsequently used for facial recognition operations.
[0058] Specifically, the face recognition process generally only recognizes a single face, and if the face is too far or too far away from the image acquisition device, the success rate of face recognition will be reduced. Since the larger the pupil distance in the face image, the closer the face is to the image acquisition device, when it is determined that the updated grid image contains only one face image and the pupil distance of the face image is the same as the standard pupil distance, the updated grid image can be used as the face recognition image corresponding to the face recognition request, thereby ensuring the success rate of face recognition.
[0059] In the above-mentioned face recognition image processing method, on the one hand, in response to the face recognition request triggered by the user based on the image acquisition device, the standard pupil distance and the shooting parameters used by the image acquisition device are determined, the shooting situation of the image acquisition device can be determined, and the image acquisition device is controlled to shoot the user's face under the shooting parameters to obtain an initial raster image, and the color depth of the initial raster image is adjusted to obtain an updated raster image, so as to reduce the computer resources occupied by the raster image, thereby improving the efficiency of subsequent transmission of the updated raster image. On the other hand, when the updated raster image only contains a face image and the pupil distance of the face image is the same as the standard pupil distance, the updated raster image is used as the face recognition image corresponding to the face recognition request, which can improve the face recognition success rate of the updated raster image, thereby improving the efficiency of face recognition.
[0060] In an exemplary embodiment, determining the shooting parameters used by the image acquisition device includes: acquiring standard shooting parameters and multiple candidate shooting parameters supported by the image acquisition device; and determining target shooting parameters from the candidate shooting parameters based on matching the standard shooting parameters with the candidate shooting parameters.
[0061] Among them, the standard shooting parameters refer to the shooting parameters under standard conditions. In this embodiment, the shooting parameters may include the photo size. The standard shooting parameters are the photo size required by the selected face recognition service. The candidate shooting parameters are the shooting parameters waiting to be selected. The target shooting parameters are the shooting parameters selected as the shooting parameters used by the image acquisition device during shooting.
[0062] Specifically, the image acquisition device supports the use of multiple candidate shooting parameters, that is, there are multiple corresponding photo sizes, and the photo sizes are large and small. Photo sizes that are too large or too small will reduce the success rate of subsequent face recognition. Therefore, standard shooting parameters and multiple candidate shooting parameters supported by the image acquisition device can be obtained, and the target shooting parameters can be determined from the candidate shooting parameters based on the matching of the standard shooting parameters with the candidate shooting parameters.
[0063] In this embodiment, when the image acquisition device supports the use of multiple candidate shooting parameters, the target shooting parameters to be finally used are selected based on the standard shooting parameters, which can ensure the standardization of the size of the captured image, thereby improving the success rate of subsequent face recognition.
[0064] In an exemplary embodiment, controlling an image acquisition device to capture a user's face under shooting parameters to obtain an initial raster image includes: controlling an image acquisition device to capture a user's face under shooting parameters to obtain a captured image; and converting the captured image into a format to obtain an initial raster image corresponding to the captured image.
[0065] The captured image is an image obtained by capturing the user's face under shooting parameters by an image acquisition device. For example, the captured image may be an original photo.
[0066] Specifically, the image acquisition device shoots the user's face under shooting parameters to obtain the original picture. Since the format of the original picture cannot be used for subsequent image processing operations, the original picture needs to be converted into a raster image to obtain an initial raster image.
[0067] In this embodiment, the format of the captured image captured by the image acquisition device under the shooting parameters is converted, which can ensure that the subsequent color depth adjustment is performed normally.
[0068] In an exemplary embodiment, a raster image includes a plurality of pixels; each pixel corresponds to a pixel value; the color depth of the initial raster image is adjusted to obtain an updated raster image, including: for each pixel, separating the pixel value corresponding to the pixel to obtain a plurality of color channel values corresponding to the pixel value; scaling each color channel value, merging the scaled values of each color channel value to obtain an updated pixel value corresponding to the pixel; and determining an updated raster image based on each updated pixel value.
[0069] Among them, the pixel is the smallest unit that constitutes the image, representing an image unit with a fixed position and a specific color or brightness value. The pixel value of a pixel is the specific value assigned to each pixel during the image digitization process. These values represent the color or brightness information of each pixel in the image, and represent the color or brightness of the image at the pixel position. The color channel is an independent channel or component used to represent color information in the image. In the common RGB color space, the image consists of three color channels: red (R), green (G), and blue (B). The color channel value is the value corresponding to each color channel.
[0070] Specifically, the raster image contains multiple pixels, and each pixel corresponds to a pixel value. Therefore, for each pixel, the pixel value corresponding to the pixel can be separated to obtain multiple color channel values corresponding to the pixel value, and each color channel value is scaled to obtain the scaled value of each color channel value. These scaled values are merged to obtain the updated pixel value corresponding to the pixel. Finally, based on the updated pixel values, the updated raster image can be determined.
[0071] In this embodiment, by separating, scaling, and merging the pixel values of each pixel in the raster image, the color depth in the raster image can be reduced, and an updated raster image that occupies less computer resources can be obtained, thereby increasing the image transmission rate and further increasing the face recognition speed.
[0072] In an exemplary embodiment, the face recognition image processing method also includes: extracting face features from the updated raster image to obtain face feature information; based on the face feature information, determining the number of faces in the updated raster image and the completeness of the faces; when the number of faces is greater than one or the completeness does not meet the completeness condition, returning to the step of controlling the image acquisition device to shoot the user's face under the shooting parameters to obtain the initial raster image, until the number of faces is equal to one and the completeness meets the completeness condition, and determining that the updated raster image contains only one face image.
[0073] The facial feature information refers to data related to a person's facial features captured and analyzed by face recognition technology. The completeness of the face refers to the completeness of each part of the face in the updated grid map. It can be understood that the completeness condition can be that the completeness of the face is 100%.
[0074] Specifically, since the face recognition image can only contain one complete face image, otherwise it may affect the success rate of face recognition. Therefore, the controller can extract face features from the updated grid map to obtain face feature information, and determine the number of faces in the updated grid map and the completeness of the faces based on the face feature information. If the number of faces is greater than one or the completeness does not meet the complete condition, it is considered that the updated grid map does not meet the requirements of the face recognition image. Therefore, it is necessary to return to the step of controlling the image acquisition device to shoot the user's face under the shooting parameters to obtain the initial grid map, re-shoot the user's face, adjust the color depth, obtain the updated grid map, repeat the face feature extraction, the number of faces, and the face integrity judgment until the number of faces is equal to one and the completeness meets the complete condition, and determine that the updated grid map contains only one complete face image.
[0075] In this embodiment, facial features are extracted from the updated grid image, and the number of faces and the completeness of faces are determined based on the obtained facial feature information, thereby ensuring that the final updated grid image contains only one complete face image, thereby improving the success rate of face recognition.
[0076] In an exemplary embodiment, the facial feature information includes coordinate information of each of the two pupils; the facial recognition image processing method also includes: determining the pupil distance between the two pupils based on the coordinate information; when the pupil distance is not equal to the standard pupil distance, returning to the step of controlling the image acquisition device to shoot the user's face under the shooting parameters to obtain an initial grid image, until the pupil distance of the facial image is the same as the standard pupil distance.
[0077] The pupil coordinate information refers to the coordinate information of the center of the pupil in the updated grid map.
[0078] Specifically, by performing numerical calculations based on the coordinate information of each of the two pupils, the pupil distance between the two pupils can be determined, and the pupil distance is compared with the standard pupil distance. If the pupil distance is not equal to the standard pupil distance, it is considered that the distance between the user's face and the image acquisition device is too large or too small. Therefore, it is necessary to return to the step of controlling the image acquisition device to shoot the user's face under the shooting parameters to obtain an initial grid image, re-shoot the user's face, adjust the color depth, and obtain an updated grid image. Repeat the facial feature extraction, face number, and face integrity judgment until the number of faces is equal to one and the integrity meets the completeness condition, and then perform pupil distance comparison until the pupil distance is equal to the standard pupil distance.
[0079] In this embodiment, by judging and adjusting the pupil distance, it is ensured that the final updated grid image contains only one complete face image and the distance between the user's face and the image acquisition device meets the conditions, so as to improve the success rate of face recognition.
[0080] In a specific embodiment, a face recognition image processing method is also provided, including:
[0081] Step S301, determining shooting parameters.
[0082] During the face recognition process, the controller needs to call the image acquisition device and preview it. During the preview process, take a photo. Using the default parameters of the image acquisition device to take a photo not only results in an unsatisfactory imaging speed, but also an unsatisfactory photo size. The methods that can be adopted are (1) setting autofocus. Setting the autofocus mode can enable faster imaging. (2) Setting the photo size. Currently, the image acquisition devices on the market have higher and higher pixels, and the photos taken are also getting larger. It takes a long time to transmit them to the background, but face recognition does not require such large photos. Since different face recognition methods have different requirements for photo size, in this link, all photo sizes supported by the image acquisition device are first obtained, and then matched with the photo size required by the selected face recognition service, and a photo size that meets the requirements and is closest is selected, and this photo size is set as the shooting parameter used by the image acquisition device. It can be understood that in this embodiment, the shooting parameter is used to illustrate the photo size.
[0083] Step S302: color depth adjustment.
[0084] The format of the original photo obtained after taking the photo is a Bitmap byte stream in ARGB_8888 format, and each pixel occupies 4 bytes. For most face recognition services, such high colors are not required. Therefore, after converting the original photo to Bitmap (raster image), it is further processed and converted to RGB_565 format. Each pixel only occupies 2 bytes. The size of the entire photo remains unchanged, but the number of bytes occupied is reduced to half of the original size.
[0085] Step S303: valid face detection and pupil distance detection.
[0086] When the user is taking a face photo, the image automatically captured by the image acquisition device may not contain a valid face. Even if it contains a face, the face may be too large or too small, resulting in low image quality and unsuccessful recognition after being transmitted to the platform. In this link, the methods used are face detection and pupil distance detection. Whether it is an Android system or an iOS system, the mainstream versions on the market have the ability to detect local face detection and pupil distance detection. Therefore, using the Bitmap generated in step S302, face detection is first performed. If the image does not contain a face or contains multiple faces, the user can be told to aim the camera at his or her face through text prompts, and the image acquisition device is controlled again to shoot the user's face under the shooting parameters to obtain an initial grid map. After the face is detected, the pupil distance is detected to determine the size of the face in the image. Too large or too small will reduce the recognition success rate. The most suitable pupil distance needs to be obtained based on the technical parameters or experience of the specific face recognition service provider. If the pupil distance is too large or too small, the user is prompted to move farther or closer to the camera through text.
[0087] Step S304: image compression.
[0088] After the above steps, the image quality is effectively improved and the size is effectively reduced. Then it will be transmitted to the background for face recognition. Before that, the Bitmap can be compressed into jpeg format to further reduce the image size and shorten the network transmission time.
[0089] In a specific embodiment, Figure 4 As shown, a face recognition image processing method is also provided, comprising the following steps:
[0090] Step S401, in response to a face recognition request triggered by an image acquisition device, determining a standard pupil distance;
[0091] Step S402, obtaining standard shooting parameters and a plurality of candidate shooting parameters supported by the image acquisition device;
[0092] Step S403, determining a shooting parameter from among the candidate shooting parameters based on matching the standard shooting parameter with the candidate shooting parameters;
[0093] Step S404, controlling the image acquisition device to shoot the user's face under the shooting parameters to obtain a shot image;
[0094] Step S405, converting the format of the captured image to obtain an initial grid image corresponding to the captured image;
[0095] The raster image contains multiple pixels; each pixel corresponds to a pixel value;
[0096] Step S406, for each pixel point, separating the pixel value corresponding to the pixel point to obtain multiple color channel values corresponding to the pixel value;
[0097] Step S407, scaling each color channel value, combining the scaled values of each color channel value, and obtaining an updated pixel value corresponding to the pixel point;
[0098] Step S408, determining an updated grid image based on each updated pixel value, performing facial feature extraction on the updated grid image, and obtaining facial feature information;
[0099] Step S409, determining the number of faces in the updated grid image and the completeness of the faces based on the facial feature information;
[0100] The facial feature information includes the coordinate information of the two pupils.
[0101] Step S410, determining whether the number of faces is greater than one or whether the completeness does not meet the completeness condition;
[0102] If yes, return to step S404;
[0103] If not, executing step S411, determining the pupil distance between the two pupils based on the coordinate information;
[0104] Step S412, determining whether the pupil distance is not equal to the standard pupil distance;
[0105] If yes, return to step S404;
[0106] If not, execute step S413 to update the raster image as the face recognition image corresponding to the face recognition request.
[0107] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0108] Based on the same inventive concept, the embodiment of the present application also provides a face recognition image processing device for implementing the face recognition image processing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the one or more face recognition image processing device embodiments provided below can refer to the limitations of the face recognition image processing method above, and will not be repeated here.
[0109] In an exemplary embodiment, Figure 5 As shown, a face recognition image processing device 500 is provided, comprising: a request response module 502, a shooting control module 504, a color depth adjustment module 506 and a face recognition image determination module 508, wherein:
[0110] A request response module 502, configured to respond to a face recognition request triggered by an image acquisition device by a user, and determine a standard pupil distance and shooting parameters used by the image acquisition device;
[0111] The shooting control module 504 is used to control the image acquisition device to shoot the user's face under the shooting parameters to obtain an initial grid image;
[0112] A color depth adjustment module 506 is used to adjust the color depth of the initial raster image to obtain an updated raster image;
[0113] The face recognition image determination module 508 is configured to use the updated grid image as the face recognition image corresponding to the face recognition request when the updated grid image contains only one face image and the pupil distance of the face image is the same as the standard pupil distance.
[0114] In an exemplary embodiment, the request response module 502 is specifically used to: obtain standard shooting parameters and multiple candidate shooting parameters supported by the image acquisition device;
[0115] Based on matching the standard shooting parameters with the candidate shooting parameters, the target shooting parameters are determined from the candidate shooting parameters.
[0116] In an exemplary embodiment, the shooting control module 504 is specifically used to: control the image acquisition device to shoot the user's face under the shooting parameters to obtain the shot image;
[0117] The format of the captured image is converted to obtain an initial raster image corresponding to the captured image.
[0118] In an exemplary embodiment, the raster image includes a plurality of pixels; each pixel corresponds to a pixel value. In the case of this embodiment, the color depth adjustment module 506 is specifically used to: for each pixel, separate the pixel value corresponding to the pixel to obtain a plurality of color channel values corresponding to the pixel value;
[0119] Scale each color channel value, merge the scaled values of each color channel value, and obtain the updated pixel value corresponding to the pixel point;
[0120] Based on the updated pixel values, an updated grid map is determined.
[0121] In an exemplary embodiment, the face recognition image processing device 500 further includes a face image determination module, which is specifically used to: extract face features from the updated grid image to obtain face feature information;
[0122] Based on the facial feature information, determine the number of faces in the updated grid image and the completeness of the faces;
[0123] When the number of faces is greater than one or the completeness does not meet the complete condition, return to the step of controlling the image acquisition device to shoot the user's face under the shooting parameters to obtain the initial raster image, until the number of faces is equal to one and the completeness meets the complete condition, and determine that the updated raster image contains only one face image.
[0124] In an exemplary embodiment, the facial feature information includes the coordinate information of the two pupils. In this embodiment, the facial recognition image processing device 500 further includes a pupil distance determination module, which is specifically used to: determine the pupil distance between the two pupils based on the coordinate information;
[0125] When the pupil distance is not equal to the standard pupil distance, the process returns to the step of controlling the image acquisition device to shoot the user's face under the shooting parameters to obtain an initial grid image until the pupil distance of the face image is the same as the standard pupil distance.
[0126] Each module in the above-mentioned face recognition image processing device can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0127] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 6As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a method for processing face recognition images is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0128] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0129] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps of the above method when executing the computer program.
[0130] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0131] In one embodiment, a computer program product is provided, comprising a computer program, which implements the steps of the above method when executed by a processor.
[0132] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0133] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0134] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0135] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A face recognition image processing method, characterized in that: The method comprises: In response to a face recognition request triggered by a user based on an image acquisition device, determining a standard pupil distance and shooting parameters used by the image acquisition device; Controlling the image acquisition device to shoot the user's face under the shooting parameters to obtain an initial grid image; Adjusting the color depth of the initial raster image to obtain an updated raster image; In a case where the updated grid image contains only one face image and the pupil distance of the face image is the same as the standard pupil distance, the updated grid image is used as the face recognition image corresponding to the face recognition request.
2. The method according to claim 1, characterized in that Determining the shooting parameters used by the image acquisition device includes: Acquire standard shooting parameters and a plurality of candidate shooting parameters supported by the image acquisition device; Based on the matching of the standard shooting parameters with the candidate shooting parameters, a target shooting parameter is determined from the candidate shooting parameters.
3. The method according to claim 1, characterized in that The controlling the image acquisition device to shoot the face of the user under the shooting parameters to obtain an initial grid image includes: Controlling the image acquisition device to shoot the user's face under the shooting parameters to obtain a shot image; The format of the captured image is converted to obtain an initial grid image corresponding to the captured image.
4. The method according to claim 1, characterized in that: The grid image includes a plurality of pixel points; each of the pixel points corresponds to a pixel value; The step of adjusting the color depth of the initial raster image to obtain an updated raster image includes: For each of the pixel points, the pixel value corresponding to the pixel point is separated to obtain multiple color channel values corresponding to the pixel value; Scaling each of the color channel values, combining the scaled values of the color channel values, and obtaining an updated pixel value corresponding to the pixel point; Based on each of the updated pixel values, an updated grid map is determined.
5. The method according to claim 1, characterized in that: The method further comprises: Extracting facial features from the updated grid image to obtain facial feature information; Based on the facial feature information, determining the number of faces in the updated grid image and the completeness of the faces; When the number of faces is greater than one or the completeness does not satisfy the completeness condition, the process returns to the step of controlling the image acquisition device to shoot the user's face under the shooting parameters to obtain an initial grid image, until the number of faces is equal to one and the completeness satisfies the completeness condition, and it is determined that the updated grid image contains only one face image.
6. The method according to claim 5, characterized in that The facial feature information includes coordinate information of the two pupils; the method further includes: Based on each of the coordinate information, determining the pupil distance between the two pupils; When the pupil distance is not equal to the standard pupil distance, the process returns to the step of controlling the image acquisition device to shoot the user's face under the shooting parameters to obtain an initial grid image until the pupil distance of the face image is the same as the standard pupil distance.
7. A face recognition image processing device, characterized in that: The device comprises: A request response module, configured to respond to a face recognition request triggered by an image acquisition device by a user, and determine a standard pupil distance and shooting parameters used by the image acquisition device; A shooting control module, used to control the image acquisition device to shoot the user's face under the shooting parameters to obtain an initial grid image; A color depth adjustment module, used for adjusting the color depth of the initial raster image to obtain an updated raster image; The face recognition image determination module is used to use the updated grid image as the face recognition image corresponding to the face recognition request when the updated grid image contains only one face image and the pupil distance of the face image is the same as the standard pupil distance.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.