Face recognition method and system based on bayer format image
By employing a face recognition method based on Bayer format images, utilizing gamma correction, color interpolation, and image enhancement, the high complexity issue on embedded devices is addressed, achieving efficient face recognition on low-power embedded microprocessors.
Patent Information
- Application Number
- CN202211606431.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-14
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2042-12-14
AI Technical Summary
Existing facial recognition algorithms are too complex to be effectively applied to embedded devices, especially in space-constrained scenarios such as smart security and in-vehicle equipment.
A face recognition method based on Bayer format images is adopted, which reduces computational complexity and improves recognition accuracy through gamma correction, color interpolation, image enhancement and feature extraction.
Achieve efficient face recognition on low-power embedded microprocessors, reducing computational load and hardware resource requirements while improving recognition accuracy.
Smart Images

Figure CN116206346B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image recognition, in particular to a face recognition method and system based on bayer format images. BACKGROUND
[0002] At present, face recognition is widely used in intelligent monitoring, access control, mobile payment and other daily scenarios. In such scenarios, the algorithm used by face recognition often has high complexity, and has high requirements for system computing power and energy consumption.
[0003] Compared with large equipment, devices using embedded microprocessors have unique advantages, can be closer to the data source, and have the characteristics of not attracting attention and being applicable to space-limited scenarios, such as intrusion detection under intelligent security and driver state analysis on vehicle-mounted devices. However, the computing power and energy consumption of such embedded devices are often limited, so the current relatively complex face recognition algorithm cannot be applied to embedded devices. SUMMARY
[0004] The present application provides a face recognition method and system based on bayer format images to solve or partially solve the technical problem that the current face recognition algorithm is too complex and does not match the embedded device.
[0005] To solve the above technical problems, the first aspect of the present application discloses a face recognition method based on bayer format images, the method comprising:
[0006] Collecting a bayer format image using an image sensor; the bayer format image is a single-channel image without image signal processing;
[0007] Performing gamma correction and color interpolation processing on the bayer format image to obtain a to-be-detected image;
[0008] Performing face detection on the to-be-detected image, and cropping a first face image according to the face detection result;
[0009] Performing image enhancement processing on the first face image to obtain a second face image;
[0010] Using a face feature extraction network to extract features from the second face image to obtain a to-be-tested face feature;
[0011] Comparing the to-be-tested face feature with standard face features in a face database one by one to obtain a face recognition result.
[0012] Preferably, the gamma correction and color interpolation processing on the bayer format image to obtain a to-be-detected image specifically comprises:
[0013] gamma-correcting the bayer format image to obtain a bayer format image with adjusted brightness;
[0014] color-interpolating the bayer format image with adjusted brightness to convert the bayer format image with adjusted brightness into a three-channel RGB format image as the to-be-detected image.
[0015] Preferably, the image enhancement processing on the first face image to obtain a second face image specifically includes:
[0016] gray-scale processing the first face image to obtain a first face gray-scale image;
[0017] normalizing the first face gray-scale image to obtain a second face gray-scale image;
[0018] normalizing the first face image according to R, G and B channels respectively to obtain a normalized face image;
[0019] using the second face gray-scale image as a guide image to guide-filter the normalized face image according to R, G and B channels respectively to obtain a guided-filter output image;
[0020] linearly transforming the guided-filter output image according to R, G and B channels respectively to obtain the second face image.
[0021] Preferably, the gray-scale processing on the first face image to obtain a first face gray-scale image specifically includes:
[0022] processing the first face image by using a gray-scale formula I1(x, y) = k1·I 0,R (x, y) + k2·I 0,G (x, y) + k3·I 0,B (x, y) to obtain the first face gray-scale image; wherein I0 is the first face image, I1 is the first face gray-scale image, I 0,R (x, y), I 0,G (x, y), I 0,B (x, y) are values of R, G and B channels of the first face image I0 at pixel position (x, y), respectively, I1(x, y) is a value of the first face gray-scale image I1 at pixel position (x, y), and k1, k2 and k3 are all weights.
[0023] Preferably, the normalizing processing on the first face gray-scale image to obtain a second face gray-scale image specifically includes:
[0024] Dividing each pixel value in the first face gray image by a maximum pixel value in the first face gray image to obtain the second face gray image.
[0025] Preferably, the first face image is normalized channel by channel according to R, G, and B channels to obtain a normalized face image, and the normalization specifically includes:
[0026] The first face image is divided channel by channel according to R, G, and B channels to obtain the normalized face image.
[0027] Preferably, the guided filter output image is linearly transformed channel by channel according to R, G, and B channels, and the linear transformation specifically includes:
[0028] According to the formula linearly transformed channel by channel; wherein I0'(x, y) is a value of a channel image I0' at a pixel position (x, y), the channel image I0' is any channel image in the guided filter output image, I1'(x, y) is a value of a linearly transformed result image I1' at a pixel position (x, y), b and a are respectively a maximum pixel value and a minimum pixel value of the channel image I0', and max and min are respectively a maximum pixel value and a minimum pixel value of the first face gray image.
[0029] Preferably, the face features of the to-be-tested face are compared with standard face features in a face database one by one to obtain a face recognition result, and the comparison specifically includes:
[0030] The to-be-tested face features are compared with the standard face features one by one for similarity measurement, and a maximum similarity is selected for threshold judgment; wherein the standard face features contain face ID information.
[0031] If the maximum similarity is greater than or equal to the threshold value, face ID information contained in the standard face feature corresponding to the maximum similarity is taken as a recognition result of the bayer format image.
[0032] If the maximum similarity is less than the threshold value, it is determined that the bayer format image cannot be recognized.
[0033] In a second aspect of the present application, a face recognition system based on a bayer format image is disclosed, and the system includes:
[0034] An image sensor module is configured to collect a bayer format image; the bayer format image is a single-channel image without image signal processing;
[0035] A preprocessing module is configured to perform gamma correction and color interpolation on the bayer format image to obtain a to-be-detected image.
[0036] A face detection module is configured to perform face detection on the to-be-detected image, and crop a first face image according to the face detection result.
[0037] An image enhancement module is configured to perform image enhancement on the first face image to obtain a second face image.
[0038] A feature extraction module is configured to perform feature extraction on the second face image by using a face feature extraction network to obtain to-be-tested face features.
[0039] A comparison module is configured to compare the to-be-tested face features with standard face features in a face database one by one to obtain a face recognition result.
[0040] In a third aspect, the present application discloses a computer readable storage medium, which stores a computer program, and the program is executed by a processor to implement the steps of the above method.
[0041] In a fourth aspect, the present application discloses an embedded device, which comprises a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the above method when executing the program.
[0042] The present application has the following advantages or benefits:
[0043] The technical solution in the present application has a lower calculation complexity and can be run on a low-power embedded microprocessor, such as an ARM Cortex-M series microprocessor.
[0044] The technical solution in the present application solves the technical problem that the existing face recognition algorithm is too complex to match the embedded device. On the one hand, only two simple image processing algorithms, gamma correction and color interpolation, are used, which greatly reduces the required calculation amount and hardware resources. On the other hand, the face image is enhanced to eliminate the noise in the face image, and the face image can be color corrected, which is beneficial to improve the accuracy of face recognition.
[0045] The above description is only a summary of the technical solution of the present application. In order to more clearly understand the technical means of the present application, the content of the specification can be implemented, and in order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific embodiments of the present application are described below. BRIEF DESCRIPTION OF DRAWINGS
[0046] Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments with reference made to the accompanying drawings. The drawings are for purposes of illustration only and are not intended to be limiting in
[0047] In the drawings:
[0048] Figure 1 A flow chart of a face recognition method based on a bayer format image according to an embodiment of the present application is shown;
[0049] Figure 2 A process chart of an image enhancement process according to an embodiment of the present application is shown;
[0050] Figure 3 A schematic diagram of a face recognition system based on a bayer format image according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0051] Exemplary embodiments of the present application will be described herein below with reference to the accompanying drawings. Although exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided so that this application will be thorough and complete, and will fully convey the scope of the application to those skilled in the art.
[0052] An embodiment of the present application discloses a face recognition method based on a bayer format image. The application scenario of the method is intrusion detection under intelligent security, driver state analysis on a vehicle-mounted device, and the like, and the method is particularly suitable for face recognition in a space-limited scenario. Specifically, the method can recognize a face image in a bayer format image at low cost and high efficiency through image processing and image enhancement methods, and the low computational complexity makes the method more easily deployed on an embedded device, such as an intelligent security device, a vehicle-mounted device, and the like.
[0053] To illustrate and explain the present application, please refer to Figure 1 The method provided by an embodiment of the present application includes the following steps:
[0054] Step 101: A bayer format image is collected by using an image sensor.
[0055] The bayer format image is a single-channel image that has not been processed by an image signal.
[0056] Step 102: Gamma correction and color interpolation processing are performed on the bayer format image to obtain a to-be-detected image.
[0057] In the embodiment, gamma correction is performed on the bayer format image. The purpose of the gamma correction is to adjust the brightness of the image, so that the bayer format image after the brightness adjustment can be obtained;
[0058] The color interpolation processing is to convert the single-channel bayer format image into a three-channel RGB format image, so as to add rich color information to the image, so as to improve the accuracy of subsequent face recognition. In the embodiment, the color interpolation processing is performed on the bayer format image after the brightness adjustment, for example, the color difference value is calculated by using the bilinear interpolation algorithm, but this does not form a limitation. The purpose of the color difference value processing is to convert the bayer format image after the brightness adjustment into a three-channel RGB format image, so as to serve as the to-be-detected image.
[0059] In step 103, face detection is performed on the to-be-detected image, and a first face image is cropped according to the face detection result.
[0060] In the embodiment, face detection is performed on the to-be-detected image, and a face image can be cropped according to the detection result, and the face image is scaled to a first face image with equal length and width. For example, the face image is scaled to 112x112 to obtain the first face image. In actual application, the face detection method can be a lightweight face detection method based on a convolutional neural network, and of course can be other methods.
[0061] In step 104, image enhancement processing is performed on the first face image to obtain a second face image.
[0062] In the embodiment, the purpose of the image enhancement processing is to eliminate the noise existing in the first face image, and the color correction can be performed on the first face image, so as to improve the accuracy of face recognition.
[0063] In the specific implementation process, the specific implementation process of performing the image enhancement processing on the first face image to obtain the second face image is refered to Figure 2 , including the following steps:
[0064] In step 201, grayscale processing is performed on the first face image to obtain a first face grayscale image.
[0065] Specifically, the grayscale formula I1(x, y) = k1·I 0,R (x, y) + k2·I 0,G (x, y) + k3·I 0,B (x, y) is used to process the first face image to obtain the first face grayscale image; wherein I0 is the first face image, I1 is the first face grayscale image, I 0,R (x, y), I 0,G (x, y), and I 0,B(x, y) are respectively the values of the R, G, B three channels of the first face image I0 at the pixel position (x, y), I1(x, y) is the value of the first face gray image I1 at the pixel position (x, y), k1, k2, k3 are all weights, which can be respectively 0.299, 0.587, 0.114, but do not form a limitation.
[0066] The principle of the above formula is that for each pixel point in the first face image, the R, G, B three channels are weighted and summed to obtain the gray value of the pixel point, and the first face gray image is obtained.
[0067] In step 202, the first face gray image is normalized to obtain a second face gray image.
[0068] Specifically, the first face gray image is a single-channel image without the concept of RGB channels, so the first face gray image can be directly normalized to obtain the second face gray image.
[0069] The second face gray image is a single-channel image, and the pixel value is between 0 and 1. By normalizing the pixel value size of the first face gray image to between 0 and 1, subsequent guided filtering processing is facilitated.
[0070] The normalization here is that each pixel value in the first face gray image is divided by the maximum pixel value in the first face gray image to obtain the second face gray image.
[0071] In step 203, the first face image is normalized channel by channel according to the R, G, B three channels to obtain a normalized face image.
[0072] In this embodiment, since the first face image has R, G, B three channels, the R, G, B three channel images of the first face image are normalized respectively.
[0073] When normalizing by channel, the first face image is divided by the maximum pixel value of the first face gray image channel by channel to obtain the normalized face image. It is worth noting that the normalized face image still contains R, G, B three channels, but its pixel value is mapped to between 0 and 1. This embodiment maps the pixel value size of the first face image to between 0 and 1 by normalization, facilitating subsequent guided filtering processing.
[0074] The normalization here is that each pixel value in the R, G, B three channel images is divided by the maximum pixel value in the first face gray image to obtain the normalized face image.
[0075] From the above description, it can be seen that the value of the normalization processing division in the embodiment is the maximum pixel value of the first face gray image, and the maximum pixel value of the first face gray image is taken as a unified reference for normalization.
[0076] Step 204, taking the second face gray image as a guide image, performing guided filtering on the normalized face image according to the R, G and B channels to obtain a guided filtering output image.
[0077] In the embodiment, the guided filtering is performed channel by channel, which is a necessary requirement of the guided filtering method. The guide image and the input image are required to be single-channel images, so the normalized face image needs to be guided filtered according to the R, G and B channels in the embodiment, and finally a guided filtering output image is formed.
[0078] Specifically, the guided filtering includes two inputs, one is the guide image and the other is the input image. The guide image is denoted as I, the input image is denoted as p, and the output image of the guided filtering is denoted as q. The process of the guided filtering is as follows:
[0079] 1) The guide image I and the input image p are respectively subjected to mean filtering with a filter kernel radius of 3, and the formula is as follows:
[0080] mean I =f mean (I,r)
[0081] mean p =f mean (p,r)
[0082] Wherein, f mean represents a mean filtering operation, and r is the filter kernel radius.
[0083] 2) The guide image I is multiplied by the corresponding pixel position of the image itself and subjected to mean filtering with a filter kernel radius of 3; the guide image I is multiplied by the corresponding pixel position of the input image p and subjected to mean filtering with a filter kernel radius of 3, and the formula is as follows:
[0084] corr I =f mean (I.*I,r)
[0085] corr Ip =f mean (I.*p,r)
[0086] Wherein, f mean represents a mean filtering operation, r is the filter kernel radius, and.* represents multiplication of the corresponding pixel positions.
[0087] 3) Calculate the variance matrix of the guide image I and the self-image, and calculate the covariance matrix of the guide image I and the input image p, which is expressed as follows:
[0088] var I =corr I ―mean I .*mean I
[0089] cov Ip =corr I ―mean Ip .*mean p
[0090] Wherein,. * indicates multiplication of corresponding pixel positions.
[0091] 4) Calculate the correction coefficient a and the bias term b, which is expressed as follows:
[0092] a=f mean (cov Ip . / (var I +∈),r)
[0093] b=f mean (mean p ―a.*mean I ,r)
[0094] Wherein, f mean represents the mean filtering operation,. / represents division of corresponding pixel positions, and ∈ is a regularization parameter, which can be 0.0004 or can be fine-tuned according to actual application.
[0095] 5) Apply the correction coefficient a and the bias term b to the guide image I to obtain the output image q, which is expressed as follows:
[0096] q=a.*I+b
[0097] Wherein,. * indicates multiplication of corresponding pixel positions.
[0098] Step 205, linearly transform the guide filter output image according to R, G and B channels, and merge to obtain a second face image.
[0099] Specifically, the guide filter output image can be divided into R, G and B channel images. Since the maximum and minimum pixel values of each channel are different, linear transformation is needed for each channel to form a second face image. The linear transformation in this embodiment is opposite to the normalization processing in the foregoing embodiment. The normalization processing maps the image pixel value to a decimal between 0 and 1, and the main purpose of the linear transformation is to map the image pixel to an integer.
[0100] Further, the guided filter output image is linearly transformed channel by channel according to R, G, B three channels, specifically including:
[0101] According to the formula linearly transformed channel by channel; wherein I0'(x, y) is the value of the channel image I0' at the pixel position (x, y), the channel image I0' is any channel image in the guided filter output image, for example, the R channel image, the G channel image, the B channel image, I1'(x, y) is the value of the linearly transformed result image I1' at the pixel position (x, y), b, a are the maximum and minimum values of the pixels of the channel image I0' respectively, max, min are the maximum and minimum values of the pixels of the first face gray image.
[0102] Through the above formula, linear transformation can be performed channel by channel, and finally the second face image is formed.
[0103] Step 105, using a face feature extraction network to extract features from the second face image to obtain a to-be-tested face feature.
[0104] In this embodiment, the pre-trained convolutional neural network is used as the face feature extraction network to extract features from the second face image. Specifically, the network input is the face image, and the network output is the corresponding to-be-tested face feature.
[0105] Step 106, comparing the to-be-tested face feature with the standard face features in the face database one by one to obtain a face recognition result.
[0106] In this embodiment, the to-be-tested face feature and the standard face features in the face database are compared one by one for similarity measurement, and the maximum similarity is selected for threshold judgment. The similarity measurement is cosine similarity measurement. The face features in the face database are extracted by using the pre-trained convolutional neural network as the face feature extraction network. The standard face features contain face ID information.
[0107] If the maximum similarity is greater than or equal to the threshold, it is considered that the recognition is successful, and the face ID information contained in the standard face feature corresponding to the maximum similarity is taken as the recognition result of the bayer format image; if the maximum similarity is less than the threshold, it is determined that the bayer format image cannot be recognized.
[0108] Compared with the existing face recognition method, the face recognition method based on the bayer format image proposed in the present application has lower computational complexity and can run on a low-power embedded microprocessor, such as an ARM Cortex-M series microprocessor.
[0109] Specifically, the existing face recognition method is mostly a face recognition method based on an RGB image. From image acquisition to generation of an RGB image, a complex series of ISP (image signal processing) algorithms are needed, and a certain amount of calculation and hardware resources are needed during the running of the algorithms. In the technical solution in the present application, on the one hand, only two simple image processing algorithms, gamma correction and color interpolation, are used, which greatly reduces the required calculation amount and hardware resources. On the other hand, face image enhancement can eliminate the noise in the face image and can perform color correction on the face image, which is beneficial to improve the accuracy of face recognition.
[0110] Based on the same inventive concept as in the foregoing embodiments, the embodiments of the present application also disclose a face recognition system based on a bayer format image. The system can be deployed in intelligent security devices, vehicle-mounted devices and other embedded devices. Figure 3 The system comprises:
[0111] An image sensor module 301 is configured to acquire a bayer format image; the bayer format image is a single-channel image without image signal processing;
[0112] A preprocessing module 302 is configured to perform gamma correction and color interpolation processing on the bayer format image to obtain a to-be-detected image;
[0113] A face detection module 303 is configured to perform face detection on the to-be-detected image and crop a first face image according to the face detection result;
[0114] An image enhancement module 304 is configured to perform image enhancement processing on the first face image to obtain a second face image;
[0115] A feature extraction module 305 is configured to perform feature extraction on the second face image using a face feature extraction network to obtain to-be-tested face features;
[0116] A comparison module 306 is configured to compare the to-be-tested face features with standard face features in a face database one by one to obtain a face recognition result.
[0117] Based on the same inventive concept as in the foregoing embodiments, the embodiments of the present application also disclose a computer readable storage medium having a computer program stored thereon, and the program is executed by a processor to implement the steps of any of the foregoing methods.
[0118] Based on the same inventive concept as the foregoing embodiments, the embodiments of the present application also disclose an embedded device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method according to any one of the preceding embodiments when executing the program. Specifically, the embedded device of the present embodiment is a smart security device, a vehicle-mounted device, etc.
[0119] By one or more embodiments of the present application, the present application has the following beneficial effects or advantages:
[0120] The technical solution in the present application has a lower calculation complexity and can be run on a low-power embedded microprocessor, such as an ARM Cortex-M series microprocessor.
[0121] The technical solution in the present application solves the technical problem that the existing face recognition algorithm is too complex to match the embedded device. On the one hand, only two simple image processing algorithms, gamma correction and color interpolation, are used, which greatly reduces the required calculation amount and hardware resources. On the other hand, the face image is enhanced to eliminate the noise in the face image, and the face image is color corrected, which is beneficial to improve the accuracy of face recognition.
[0122] The algorithms and displays provided herein are not inherently related to any particular computer, virtual system, or other apparatus. Various general purpose systems can be used with these teachings, based on the description as provided herein. In addition, the present application is not described with reference to any particular programming language. It will be appreciated that a variety of programming languages can be used to implement the teachings of the application as described herein, and any references below to specific languages are provided for disclosure of enablement of the best mode of the application.
[0123] In the specification provided herein, a large number of specific details are described. However, it can be understood that the embodiments of the present application can be practiced without these specific details. In some examples, well-known methods, structures and techniques are not shown in detail in order not to obscure the understanding of the present specification.
[0124] Similarly, it is to be understood that the embodiments of the present application can be altered, combined, or modified and constitute modifications and variations of the example embodiments set forth herein that are within the scope of the present application. It is intended that the application(s) encompass each of the alternative of such alterations, combinations, and modifications that have been discussed above, and among others: (a) as set out in the following claims (if any); and (b) those adapted to the same use, the same effect, or the same equivalent purposes, in any such described embodiments of this specification to which any claim herein is addressed. Accordingly, this application is not limited to that precisely as shown and described.
[0125] It will be understood by those skilled in the art that modules in the apparatus of the embodiments can be adapted to change and be placed in one or more apparatuses other than the embodiments. The modules or units or components in the embodiments can be combined into one module or unit or component, and furthermore can be divided into multiple sub-modules or sub-units or sub-components. Except that at least some of such features and / or processes or units are mutually exclusive, any combination of all the features disclosed in the specification (including the accompanying claims, abstract and drawings), and all the processes or units of any method or apparatus disclosed thus can be adopted. Unless explicitly stated otherwise, each feature disclosed in the specification (including the accompanying claims, abstract and drawings) can be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0126] Furthermore, those skilled in the art will appreciate that different embodiments of the application have different features and that the features of one embodiment can be combined with features of another embodiment. For example, in the following claims, any of the claims can be used to enable a single claim to be amended as included in or excluded from a dependent claim.
[0127] Various component embodiments of the present application can be implemented in hardware, or as software modules running in one or more processors, or in combinations thereof. As will be appreciated by those skilled in the art, microprocessors or digital signal processors (DSPs) can be used in practice to implement some or all of the functionality of some or all of the components of the gateway, proxy server, system according to embodiments of the present application. The present application can also be implemented as a program of instructions for performing part or all of the methods described herein, e.g., a computer program and a computer program product. Such program of the present application can be stored on a computer readable medium, or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, or provided on a carrier signal, or in any other form.
[0128] It should be noted that the above-mentioned embodiments illustrate rather than limit the application, and that one skilled in the art will be able to design many alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word 'comprising' does not exclude the presence of elements or steps other than those listed in a claim. The word 'a' or 'an' preceding an element does not exclude the presence of a plurality of such elements. The application can be implemented by means of both hardware and software, and any combination thereof. In a unit claim, several devices can be listed with a conjunction like 'or', but it is to be understood that each of these devices can be implemented by its own hardware item. The use of the words 'first','second', and 'third', etc. do not imply any ordering. These words are to be interpreted as names.
Claims
1. A face recognition method based on Bayer format images, characterized in that, The method includes: Bayer format images are acquired using an image sensor; the Bayer format images are single-channel images without image signal processing. The Bayer format image is subjected to gamma correction and color interpolation to obtain the image to be detected; Face detection is performed on the image to be detected, and a first face image is cropped out based on the face detection results; The image enhancement process for the first face image to obtain the second face image specifically includes: converting the first face image to grayscale to obtain a first face grayscale image; normalizing the first face grayscale image to obtain a second face grayscale image; normalizing the first face image channel by channel according to the R, G, and B channels to obtain a normalized face image; using the second face grayscale image as a guide image, performing guided filtering on the normalized face image channel by channel according to the R, G, and B channels to obtain a guided filtering output image; and performing linear transformation on the guided filtering output image channel by channel according to the R, G, and B channels to obtain the second face image. The face feature extraction network is used to extract features from the second face image to obtain the face features to be tested; The facial features to be tested are compared one by one with the standard facial features in the facial database to obtain the facial recognition result.
2. The method as described in claim 1, characterized in that, The process of performing gamma correction and color interpolation on the Bayer format image to obtain the image to be detected specifically includes: Gamma correction is performed on the Bayer format image to obtain a Bayer format image with adjusted brightness; Color interpolation is performed on the Bayer format image after brightness adjustment to convert it into a three-channel RGB format image, which is then used as the image to be detected.
3. The method as described in claim 1, characterized in that, The step of performing grayscale processing on the first face image to obtain a first face grayscale image specifically includes: Using grayscale formula The first face image is processed to obtain a grayscale image of the first face; wherein, The first face image, The first image is a grayscale image of the face. The first face image The R, G, and B channels at pixel positions The value at that location, The first grayscale image of the face At pixel position The value at that location, k1, k2, k3 All are weights.
4. The method as described in claim 1, characterized in that, The step of normalizing the first grayscale image of the face to obtain the second grayscale image of the face specifically includes: The second face grayscale image is obtained by dividing each pixel value in the first face grayscale image by the maximum pixel value in the first face grayscale image.
5. The method as described in claim 1, characterized in that, The step of normalizing the first face image channel by channel according to the R, G, and B channels to obtain a normalized face image specifically includes: The first face image is processed by dividing each pixel value of the first face grayscale image by the maximum pixel value of the first face grayscale image according to the three channels R, G, and B, to obtain the normalized face image.
6. The method as described in claim 1, characterized in that, The process of linearly transforming the guided filter output image channel by channel according to the R, G, and B channels specifically includes: According to the formula The channel undergoes a linear transformation; where, For channel images At pixel position Value at, channel image This refers to any channel image in the output image of the guided filter. Image of the result of linear transformation At pixel position The value at that location, Channel images The maximum and minimum pixel values, These are the maximum and minimum pixel values of the first face grayscale image, respectively.
7. The method as described in claim 1, characterized in that, The step of comparing the facial features to be verified with standard facial features in the facial database one by one to obtain the facial recognition result specifically includes: The similarity between the face feature to be tested and the standard face feature is measured one by one, and the maximum similarity is selected for threshold judgment; wherein, the standard face feature includes face ID information; If the maximum similarity is greater than or equal to the threshold, the face ID information contained in the standard face features corresponding to the maximum similarity is used as the recognition result of the Bayer format image; If the maximum similarity is less than the threshold, it is determined that the Bayer format image cannot be recognized.
8. A face recognition system based on Bayer format images, characterized in that, The system includes: An image sensor module is used to acquire Bayer format images; the Bayer format images are single-channel images that have not undergone image signal processing. The preprocessing module is used to perform gamma correction and color interpolation on the Bayer format image to obtain the image to be detected; The face detection module is used to perform face detection on the image to be detected and to crop out a first face image based on the face detection results; The image enhancement module is used to perform image enhancement processing on the first face image to obtain a second face image. Specifically, it is used to: convert the first face image to grayscale to obtain a first face grayscale image; normalize the first face grayscale image to obtain a second face grayscale image; normalize the first face image channel by channel according to the R, G, and B channels to obtain a normalized face image; use the second face grayscale image as a guide image, and perform guided filtering on the normalized face image channel by channel according to the R, G, and B channels to obtain a guided filter output image; and perform linear transformation on the guided filter output image channel by channel according to the R, G, and B channels to obtain the second face image. The feature extraction module is used to extract features from the second face image using a face feature extraction network to obtain the face features to be examined. The comparison module is used to compare the facial features to be verified with the standard facial features in the facial database one by one to obtain the facial recognition result.
9. A computer-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 according to any one of claims 1-7.
10. An embedded device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the method according to any one of claims 1-7.
Citation Information
Patent Citations
Electronic equipment and image recognition method thereof, system on chip and medium
CN113627328A
Face detection method and device suitable for weak-quality images, medium, and equipment
CN113822927A