Face capture method, device, electronic device and storage medium
By performing noise elimination, texture enhancement and feature extraction on face capture images, the optimal capture timing is determined, which solves the problem of low success rate of face recognition in the existing technology and improves the clarity and accuracy of face capture.
Patent Information
- Application Number
- CN202111003043.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-30
- Publication Date
- 2024-09-06
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing face capture methods are affected by on-site factors at different process nodes, resulting in a reduced success rate of face recognition, making it difficult to accurately determine the capture timing.
By obtaining face capture images at different time points, noise pixel elimination, texture enhancement and feature extraction are performed, the correlation value and mean square error of the image features and the preset standard features are calculated, and the optimal capture time is determined for face capture.
It improves the clarity and recognition accuracy of face capture images, ensures the accuracy of capture timing, and enhances the reliability of the interview process.
Smart Images

Figure CN113705459B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a face capture method, device, electronic equipment and computer-readable storage medium. Background Art
[0002] With the development of paperless and online business and AI technology, more and more businesses are completed by customers through online human-machine signing. When signing online, in order to ensure that the interaction object is the customer himself, the customer needs to be captured and identified regularly to confirm the customer's identity and ensure the normal progress of the face-to-face signing process.
[0003] Most of the existing face capture methods in the face-to-face interview process are based on business process capture. For example, in each process, the user's face is captured at the beginning of the speech broadcast, the front end of the speech broadcast, the back end of the speech broadcast, the end of the speech broadcast, the beginning of the customer's answer, the middle of the customer's answer, and the end of the customer's answer. However, in reality, there will be different on-site influencing factors at different process nodes, such as when the speech is broadcasting, the customer communicates with the business personnel, and the customer is accustomed to answering close to the microphone; these on-site factors will affect the effect of capturing the face, thereby reducing the recognition success rate of the captured face. Therefore, how to accurately determine the timing of face capture has become an urgent problem to be solved. Summary of the invention
[0004] The present invention provides a face capturing method, a device and a computer-readable storage medium, the main purpose of which is to solve the problem that the face image captured during face capturing is unclear.
[0005] To achieve the above object, the present invention provides a face capture method, comprising:
[0006] Acquire captured face images at different time points, and remove noise pixels from the captured face images corresponding to each time point to obtain denoised images;
[0007] Performing texture enhancement processing on each of the denoised images to obtain an enhanced image;
[0008] Extracting image features of each of the enhanced images;
[0009] Calculating the correlation values between the image features and the preset standard features respectively, and collecting the face capture images corresponding to the image features whose correlation values are greater than the preset threshold as the images to be screened;
[0010] The mean square error of the correlation value corresponding to each of the to-be-screened images is calculated, and the time point corresponding to the image with the smallest mean square error is determined as the face capture timing, and the face capture is performed on the current framing screen at the face capture timing.
[0011] Optionally, the removing noise pixels from the captured face image corresponding to each time point to obtain a denoised image includes:
[0012] Selecting one of the captured face images one by one from the captured face images, and evenly cutting the selected captured face images to obtain a plurality of image blocks;
[0013] Performing pixel convolution on the multiple image blocks respectively to obtain multiple convolved image blocks;
[0014] Performing Gaussian smoothing processing on the multiple convolution image blocks respectively to obtain multiple smoothed image blocks;
[0015] The multiple smoothed image blocks are spliced together to obtain a denoised image of the selected captured face image.
[0016] Optionally, performing texture enhancement processing on each of the denoised images to obtain an enhanced image includes:
[0017] Selecting one of the denoised images one by one from the denoised images, and sequentially performing region selection in the selected denoised images using an n×n image window to obtain a plurality of image regions, wherein n is a positive integer;
[0018] Calculate the binary symbol of the central pixel of each image area by using a preset algorithm according to the central pixel of each image area and the neighboring pixels of the central pixel;
[0019] The central pixel is enhanced according to the binary code element to obtain an enhanced image.
[0020] Optionally, extracting the image features of each enhanced image includes:
[0021] Selecting one of the enhanced images one by one as the target image;
[0022] Generating a global feature of the target image according to pixel gradients in the target image;
[0023] Using a preset sliding window to select regions in the target image one by one to obtain a pixel window;
[0024] Generating local features of the target image according to pixel values in each of the pixel windows;
[0025] The global features and the local features are aggregated into the image features.
[0026] Optionally, generating the global features of the target image according to pixel gradients in the target image includes:
[0027] Counting the pixel value of each pixel in the target image;
[0028] The maximum pixel value and the minimum pixel value among the pixel values are used as parameters of a preset mapping function, and the pixel value of each pixel point in the target image is mapped into a preset range by using the preset function;
[0029] The pixel gradient of each row of pixels in the mapped target image is calculated, the pixel gradient of each row of pixels is converted into a row vector, and the row vectors are spliced into the global features of the target image.
[0030] Optionally, generating the local features of the target image according to the pixel values in each of the pixel windows includes:
[0031] Select one pixel point from the pixel window one by one as the target pixel point;
[0032] Determine whether the pixel value of the target pixel is an extreme value within the pixel window;
[0033] When the pixel value of the target pixel point is not an extreme value in the pixel window, returning to the step of selecting one of the pixel points in the pixel window as the target pixel point one by one;
[0034] When the pixel value of the target pixel point is an extreme value within the pixel window, determining the target pixel point as a key point;
[0035] The pixel values of all key points in all pixel windows are vectorized, and the obtained vectors are aggregated as local features of the target image.
[0036] Optionally, respectively calculating the correlation values between the image features and preset standard features includes:
[0037] The correlation values between the image features and the preset standard features are calculated using the following correlation value algorithm:
[0038]
[0039] Among them, L k is the correlation value between the image feature corresponding to the k-th face capture image and the preset standard feature, a k is the image feature corresponding to the k-th face capture image, and b is the preset standard feature.
[0040] In order to solve the above problem, the present invention further provides a face capture device, the device comprising:
[0041] An image denoising module is used to obtain captured face images at different time points, and to remove noise pixels from the captured face images corresponding to each time point to obtain a denoised image.
[0042] An image enhancement module, used for performing texture enhancement processing on each of the denoised images to obtain an enhanced image;
[0043] A feature extraction module, used to extract image features of each enhanced image;
[0044] An image screening module, used to calculate the correlation values between the image features and the preset standard features respectively, and collect the face capture images corresponding to the image features whose correlation values are greater than the preset threshold as the images to be screened;
[0045] The capture timing calculation module is used to calculate the mean square error of the correlation value corresponding to each image to be screened, determine the time point corresponding to the image with the smallest mean square error as the face capture timing, and capture the face of the current framing image at the face capture timing.
[0046] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:
[0047] at least one processor; and,
[0048] a memory communicatively connected to the at least one processor; wherein,
[0049] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the above-mentioned face capture method.
[0050] In order to solve the above problem, the present invention also provides a computer-readable storage medium, in which at least one computer program is stored. The at least one computer program is executed by a processor in an electronic device to implement the above-mentioned face capture method.
[0051] The embodiment of the present invention can perform denoising, enhancement and feature extraction on the captured images, and determine which time points are better for face capture based on the extracted features, and then determine the time points corresponding to the images with better capture effects as the capture timing, and capture the face of the current framing screen at the face capture timing, thereby avoiding the analysis of the face at each capture, and improving the accuracy of the captured face. Therefore, the face capture method, device, electronic device and computer-readable storage medium proposed by the present invention can improve the clarity of the captured face image. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1A schematic diagram of a process flow of a face capture method provided by an embodiment of the present invention;
[0053] Figure 2 A schematic diagram of uniform cutting provided by an embodiment of the present invention;
[0054] Figure 3 A schematic diagram of a process for generating local features provided by an embodiment of the present invention;
[0055] Figure 4 A functional module diagram of a face capture device provided by an embodiment of the present invention;
[0056] Figure 5 A schematic diagram of the structure of an electronic device for implementing the face capturing method provided by one embodiment of the present invention.
[0057] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0058] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0059] The embodiment of the present application provides a face capture method. The execution subject of the face capture method includes but is not limited to at least one of the electronic devices such as a server, a terminal, etc. that can be configured to execute the method provided by the embodiment of the present application. In other words, the face capture method can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc. The server can be an independent server, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms.
[0060] Reference Figure 1 , which is a flow chart of a face capturing method provided by an embodiment of the present invention.
[0061] In this embodiment, the face capture method includes:
[0062] S1. Acquire captured face images at different time points, and eliminate noise pixels from the captured face images corresponding to each time point to obtain denoised images.
[0063] In the embodiment of the present invention, the face captured images at different time points may be images obtained by capturing the face of the user at different time points within any preset time period.
[0064] For example, when a user is handling a business, facial verification is required. During the business process, images of the user's face are captured at the beginning of the business, when the user is speaking, and when the business ends.
[0065] In detail, computer statements with data capture functions (such as Java statements, Python statements, etc.) can be used to capture pre-stored facial capture images from a pre-built storage area, and the storage area includes but is not limited to a database, a blockchain node, and a network cache.
[0066] In an embodiment of the present invention, since the captured image may contain image noise texture caused by factors such as ambient light and image background, in order to more accurately confirm the capture timing based on the face capture image, noise elimination can be performed on each face capture image to improve the clarity of the face capture image, thereby improving the accuracy of the face capture timing obtained in subsequent analysis.
[0067] In the embodiment of the present invention, the step of removing noise pixels from the captured face image corresponding to each time point to obtain a denoised image includes:
[0068] Selecting one of the captured face images one by one from the captured face images, and evenly cutting the selected captured face images to obtain a plurality of image blocks;
[0069] Performing pixel convolution on the multiple image blocks respectively to obtain multiple convolved image blocks;
[0070] Performing Gaussian smoothing processing on the multiple convolution image blocks respectively to obtain multiple smoothed image blocks;
[0071] The multiple smoothed image blocks are spliced together to obtain a denoised image of the selected captured face image.
[0072] In detail, see Figure 2 As shown, the following figure is a schematic diagram of uniformly cutting the selected face capture image provided by an embodiment of the present invention.
[0073] Figure 2 In the embodiment, there is a selected face capture image of a size of 9X9, and the selected face capture image is divided into 9 3X3 image blocks according to equal length and equal width.
[0074] In the embodiment of the present invention, the selected captured face image is evenly cut into a plurality of image blocks, which is beneficial to reducing the number of pixels in each image block, thereby improving the efficiency of eliminating noise pixels from the selected captured face image.
[0075] Specifically, an embodiment of the present invention uses a Gabor filter to perform pixel convolution on the multiple image blocks. The Gabor filter performs convolution calculation on the multiple image blocks according to a preset number of directions and a scale number, and only allows pixels that meet the preset standards to pass, while pixels that do not meet the filter are suppressed. Therefore, when the preset pixels are set to face pixels, the Gabor filter performs convolution calculation on the multiple image blocks according to the preset number of directions and a scale number, and the pixels of the face in the image blocks can be retained, while the non-face pixels in the image background are removed, so as to highlight the face part in the selected face capture image, which is beneficial to improve the accuracy of the final analysis.
[0076] In an embodiment of the present invention, a Gaussian kernel function is used to perform Gaussian smoothing on the multiple convolution image blocks to obtain multiple smoothed image blocks. The Gaussian kernel function is also called a radial basis function, which is a commonly used smoothing kernel function. The rotational symmetry of the Gaussian kernel function can be used to smoothly map finite-dimensional data (i.e., pixel values) to a high-dimensional space to achieve Gaussian smoothing of the multiple convolution image blocks.
[0077] The embodiment of the present invention performs noise pixel filtering on the selected captured face image, thereby suppressing the noise pixels in the selected captured face image, which is beneficial to improving the accuracy of the final analysis.
[0078] S2. Perform texture enhancement processing on each of the denoised images to obtain an enhanced image.
[0079] In the embodiment of the present invention, the step of performing texture enhancement processing on each of the denoised images to obtain an enhanced image includes:
[0080] Selecting one of the denoised images one by one from the denoised images, and sequentially performing region selection in the selected denoised images using an n×n image window to obtain a plurality of image regions, wherein n is a positive integer;
[0081] Calculate the binary symbol of the central pixel of each image area by using a preset algorithm according to the central pixel of each image area and the neighboring pixels of the central pixel;
[0082] The central pixel is enhanced according to the binary code element to obtain an enhanced image.
[0083] Optionally, the calculating the binary symbol of the central pixel of each image region by using a preset algorithm according to the central pixel of each image region and the neighborhood pixels of the central pixel comprises:
[0084] The binary symbol of the central pixel of the image area is calculated using the following algorithm:
[0085]
[0086] Wherein, P0 is the center pixel of the image area, P e is the mean value of the neighborhood pixels of the central pixel, n is the number of the neighborhood pixels, s(P0-P e ) is a quantization operation.
[0087] The embodiment of the present invention performs detail enhancement processing on the selected denoised image, filters the noise pixels in the selected denoised image, and deepens the local texture of the image details, thereby highlighting the detail features in the image, which is beneficial to improving the accuracy of image analysis.
[0088] S3. Extracting image features of each enhanced image.
[0089] In the embodiment of the present invention, the image features include global features and local features. Extracting the global features and local features from the target image respectively is beneficial to improving the accuracy of obtaining the timing of face capture by subsequent analysis using the image features.
[0090] In the embodiment of the present invention, the step of extracting the image features of each enhanced image includes:
[0091] Selecting one of the enhanced images one by one as the target image;
[0092] Generating a global feature of the target image according to pixel gradients in the target image;
[0093] Using a preset sliding window to select regions in the target image one by one to obtain a pixel window;
[0094] Generating local features of the target image according to pixel values in each of the pixel windows;
[0095] The global features and the local features are aggregated into the image features.
[0096] In one embodiment of the present invention, HOG (Histogram of Oriented Gradient), DPM (Deformable Part Model), LBP (Local Binary Patterns) and the like may be used to extract the global features of the target image, or a pre-trained artificial intelligence model with a specific image feature extraction function may be used to extract the global features of the target image, and the artificial intelligence model includes but is not limited to a VGG-net model and a U-net model.
[0097] In another embodiment of the present invention, generating the global features of the target image according to the pixel gradients in the target image includes:
[0098] Counting the pixel value of each pixel in the target image;
[0099] The maximum pixel value and the minimum pixel value among the pixel values are used as parameters of a preset mapping function, and the pixel value of each pixel point in the target image is mapped into a preset range by using the preset function;
[0100] The pixel gradient of each row of pixels in the mapped target image is calculated, the pixel gradient of each row of pixels is converted into a row vector, and the row vectors are spliced into the global features of the target image.
[0101] Exemplarily, the preset mapping function may be:
[0102]
[0103] Among them, Y i is the pixel value of the i-th pixel in the target image after being mapped to the preset range, x i is the pixel value of the i-th pixel in the target image, max(X) is the maximum pixel value in the target image, and min(X) is the minimum pixel value in the target image.
[0104] Furthermore, a preset gradient algorithm may be used to calculate the pixel gradient of each row of pixels in the mapped target image, and the gradient algorithm includes but is not limited to a two-dimensional discrete derivative algorithm, a Soble operator, and the like.
[0105] In the embodiment of the present application, the pixel gradient of each row of pixels can be converted into a row vector and spliced into the global feature of the target image.
[0106] For example, the selected target image includes three rows of pixels, the pixel gradients of the first row of pixels are a, b, c, the pixel gradients of the second row of pixels are d, e, f, and the pixel gradients of the third row of pixels are g, h, i. The pixel gradients of each row of pixels can be used as row vectors and spliced into the following global features:
[0107]
[0108] Further, Figure 3 As shown, generating the local features of the target image according to the pixel values in each of the pixel windows includes:
[0109] S31, selecting one pixel point from the pixel window one by one as the target pixel point;
[0110] S32, determining whether the pixel value of the target pixel is an extreme value within the pixel window;
[0111] When the pixel value of the target pixel is not an extreme value in the pixel window, return to S31;
[0112] When the pixel value of the target pixel point is an extreme value within the pixel window, executing S33, determining the target pixel point as a key point;
[0113] S34, vectorizing the pixel values of all key points in all pixel windows, and aggregating the obtained vectors as local features of the target image.
[0114] In an embodiment of the present application, the sliding window may be a pre-constructed selection box with a certain area, which may be used to select pixels in the target image, for example, a square selection box constructed with a height of 10 pixels and a width of 10 pixels.
[0115] In detail, the extreme value includes a maximum value and a minimum value. When the pixel value of the target pixel point is a maximum value or a minimum value in the pixel window, the target pixel point is determined to be a key point of the pixel window.
[0116] Specifically, the step of vectorizing the pixel values of all key points in the pixel window is consistent with the step of calculating the pixel gradients of each row of pixels in the mapped target image and converting the pixel gradients of each row of pixels into row vectors, and will not be repeated here.
[0117] S4. Calculate the correlation values between the image features and the preset standard features respectively, and collect the face capture images corresponding to the image features whose correlation values are greater than the preset threshold as the images to be screened.
[0118] In an embodiment of the present invention, the preset standard features are features corresponding to pre-acquired facial images that meet requirements such as clarity and straightness, and the correlation values are used to identify the degree of conformity between the image features corresponding to each captured facial image and the preset standard features. The larger the correlation value, the larger the facial capture image corresponding to the correlation value.
[0119] In the embodiment of the present invention, respectively calculating the correlation values between the image features and the preset standard features includes:
[0120] The correlation values between the image features and the preset standard features are calculated using the following correlation value algorithm:
[0121]
[0122] Among them, L k is the correlation value between the image feature corresponding to the k-th face capture image and the preset standard feature, a k is the image feature corresponding to the k-th face capture image, and b is the preset standard feature.
[0123] In an embodiment of the present invention, a face capture image corresponding to an image feature whose correlation value is greater than a preset threshold value can be selected as a screening image to remove images that do not meet the preset standard face features, thereby improving the accuracy of subsequent calculations to obtain face capture timing.
[0124] S5, calculating the mean square error of the correlation value corresponding to each of the to-be-screened images, determining the time point corresponding to the image with the smallest mean square error as a face capture opportunity, and capturing a face on the current framing screen at the face capture opportunity.
[0125] In the embodiment of the present invention, the step of calculating the mean square error of the correlation value corresponding to each image to be screened includes:
[0126] The mean square error algorithm is used to calculate the mean square error σ(α n ):
[0127]
[0128] D(α n )=(α n -E(α n )) 2
[0129]
[0130] Among them, σ(α n ) is the mean square error of the correlation values corresponding to the nth image in the image to be screened, α nis the correlation value corresponding to the nth image in the image to be screened, E(α n ) is the mean of the correlation values corresponding to all images in the image to be screened, D(α n ) is the variance of the correlation value corresponding to the nth image in the images to be screened, and N is the number of images to be screened.
[0131] In the embodiment of the present invention, the time point corresponding to the image with the smallest mean square error can be determined as the face capture timing.
[0132] In the embodiment of the present invention, the face capture time is a relative time point. For example, when a user handles a service that requires face verification, the face capture timing is when the service starts, when the user speaks, or when the service ends.
[0133] In one of the actual application scenarios of the present invention, since there is a certain potential unified relationship between the behaviors of most users, for example, when most users perform face verification services, they tend to concentrate their attention for a certain period of time at the beginning of the service and will look at the capture camera. The clarity of the captured face image may be higher at this time. Therefore, the embodiment of the present invention can analyze the face capture images at different time points in history to find out at which moments the effect of face capture is better during face verification, and then determine the timing of face capture, and when other users perform face capture services in the future, the face capture of the current framing screen is performed according to the face capture timing.
[0134] The embodiment of the present invention can perform denoising, enhancement and feature extraction on the captured image, and determine which time points are better for face capture based on the extracted features, and then determine the time point corresponding to the image with better capture effect as the capture opportunity, and in subsequent captures, capture the face according to the capture opportunity, and capture the face of the current framing screen at the face capture opportunity, thereby improving the accuracy of the captured face. Therefore, the face capture method proposed by the present invention can improve the clarity of the captured face image.
[0135] like Figure 4 , which is a functional module diagram of a face capture device provided by an embodiment of the present invention.
[0136] The face capture device 100 of the present invention can be installed in an electronic device. According to the functions to be implemented, the face capture device 100 can include an image denoising module 101, an image enhancement module 102, a feature extraction module 103, an image screening module 104 and a capture timing calculation module 105. The module of the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, which are stored in the memory of the electronic device.
[0137] In this embodiment, the functions of each module / unit are as follows:
[0138] The image denoising module 101 is used to obtain captured face images at different time points, and to remove noise pixels from the captured face images corresponding to each time point to obtain denoised images;
[0139] The image enhancement module 102 is used to perform texture enhancement processing on each of the denoised images to obtain an enhanced image;
[0140] The feature extraction module 103 is used to extract the image features of each enhanced image;
[0141] The image screening module 104 is used to calculate the correlation values between the image features and the preset standard features respectively, and collect the face capture images corresponding to the image features whose correlation values are greater than the preset threshold as the images to be screened;
[0142] The capture timing calculation module 105 is used to calculate the mean square error of the correlation value corresponding to each of the images to be screened, determine the time point corresponding to the image with the smallest mean square error as the face capture timing, and capture the face of the current framing image at the face capture timing.
[0143] In detail, each module described in the face capture device 100 in the embodiment of the present invention is used in the same manner as described above. Figures 1 to 3 The face capture method described in the present invention has the same technical means and can produce the same technical effects, so I will not go into details here.
[0144] like Figure 5 FIG. 1 is a schematic diagram of the structure of an electronic device for implementing a face capturing method provided by an embodiment of the present invention.
[0145] The electronic device 1 may include a processor 10, a memory 11, a communication bus 12, and a communication interface 13, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as a face capture program.
[0146] In some embodiments, the processor 10 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The processor 10 is the control core (ControlUnit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and executes or executes programs or modules stored in the memory 11 (for example, executing a face capture program, etc.), and calls data stored in the memory 11 to execute various functions of the electronic device and process data.
[0147] The memory 11 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (for example, an SD or DX memory, etc.), a magnetic memory, a disk, an optical disk, etc. In some embodiments, the memory 11 may be an internal storage unit of an electronic device, such as a mobile hard disk of the electronic device. In other embodiments, the memory 11 may also be an external storage device of an electronic device, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device. Further, the memory 11 may also include both an internal storage unit of the electronic device and an external storage device. The memory 11 can be used not only to store application software and various types of data installed in the electronic device, such as the code of the face capture program, but also to temporarily store data that has been output or is to be output.
[0148] The communication bus 12 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to realize connection and communication between the memory 11 and at least one processor 10, etc.
[0149] The communication interface 13 is used for communication between the above-mentioned electronic device and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a display (Display), an input unit (such as a keyboard (Keyboard)), and optionally, the user interface may also be a standard wired interface, a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, etc. Among them, the display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface.
[0150] Figure 5 Only an electronic device with components is shown, and those skilled in the art will understand that Figure 5 The structure shown does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.
[0151] For example, although not shown, the electronic device may also include a power source (such as a battery) for supplying power to each component. Preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The electronic device may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
[0152] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.
[0153] The face capture program stored in the memory 11 of the electronic device 1 is a combination of multiple instructions. When running in the processor 10, it can achieve:
[0154] Acquire captured face images at different time points, and remove noise pixels from the captured face images corresponding to each time point to obtain denoised images;
[0155] Performing texture enhancement processing on each of the denoised images to obtain an enhanced image;
[0156] Extracting image features of each of the enhanced images;
[0157] Calculating the correlation values between the image features and the preset standard features respectively, and collecting the face capture images corresponding to the image features whose correlation values are greater than the preset threshold as the images to be screened;
[0158] Calculate the mean square error of the correlation value corresponding to each image to be screened, and determine that the time point corresponding to the image with the smallest mean square error is the time for capturing the face;
[0159] At the face capturing opportunity, the face of the current framing image is captured.
[0160] Specifically, the specific implementation method of the processor 10 for the above instructions can refer to the description of the relevant steps in the corresponding embodiment of the accompanying drawings, which will not be repeated here.
[0161] Furthermore, if the module / unit integrated in the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).
[0162] The present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of an electronic device, the computer program can implement:
[0163] Acquire captured face images at different time points, and remove noise pixels from the captured face images corresponding to each time point to obtain denoised images;
[0164] Performing texture enhancement processing on each of the denoised images to obtain an enhanced image;
[0165] Extracting image features of each of the enhanced images;
[0166] Calculating the correlation values between the image features and the preset standard features respectively, and collecting the face capture images corresponding to the image features whose correlation values are greater than the preset threshold as the images to be screened;
[0167] Calculate the mean square error of the correlation value corresponding to each image to be screened, and determine that the time point corresponding to the image with the smallest mean square error is the time for capturing the face;
[0168] At the face capturing opportunity, the face of the current framing image is captured.
[0169] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
[0170] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0171] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0172] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0173] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.
[0174] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0175] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0176] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claim can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.
[0177] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.
Claims
1. A face capture method, characterized in that: The method comprises: Acquire captured face images at different time points, and remove noise pixels from the captured face images corresponding to each time point to obtain denoised images; Performing texture enhancement processing on each of the denoised images to obtain an enhanced image; Extracting image features of each of the enhanced images; Calculating the correlation values between the image features and the preset standard features respectively, and collecting the face capture images corresponding to the image features whose correlation values are greater than the preset threshold as the images to be screened; The mean square error of the correlation values corresponding to each of the to-be-screened images is calculated, and the time point corresponding to the to-be-screened image with the smallest mean square error is determined as the face capture timing, and the face capture is performed on the current framing screen at the face capture timing.
2. The face capture method according to claim 1, characterized in that: The step of removing noise pixels from the captured face images corresponding to each time point to obtain a denoised image includes: Selecting one of the captured face images one by one from the captured face images, and evenly cutting the selected captured face images to obtain a plurality of image blocks; Performing pixel convolution on the multiple image blocks respectively to obtain multiple convolved image blocks; Performing Gaussian smoothing processing on the multiple convolution image blocks respectively to obtain multiple smoothed image blocks; The multiple smoothed image blocks are spliced together to obtain a denoised image of the selected captured face image.
3. The face capture method according to claim 1, characterized in that: The step of performing texture enhancement processing on each of the denoised images to obtain an enhanced image includes: Selecting one of the denoised images one by one from the denoised images, and sequentially performing region selection in the selected denoised images using an n×n image window to obtain a plurality of image regions, wherein n is a positive integer; Calculate the binary symbol of the central pixel of each image area by using a preset algorithm according to the central pixel of each image area and the neighboring pixels of the central pixel; The central pixel is enhanced according to the binary code element to obtain an enhanced image.
4. The face capture method according to claim 1, characterized in that: The extracting the image features of each enhanced image comprises: Selecting one of the enhanced images one by one as the target image; Generating a global feature of the target image according to pixel gradients in the target image; Using a preset sliding window to select regions in the target image one by one to obtain a pixel window; Generating local features of the target image according to pixel values in each of the pixel windows; The global features and the local features are aggregated into the image features.
5. The face capture method according to claim 4, characterized in that: Generating the global features of the target image according to the pixel gradients in the target image includes: Counting the pixel value of each pixel in the target image; The maximum pixel value and the minimum pixel value among the pixel values are used as parameters of a preset mapping function, and the pixel value of each pixel point in the target image is mapped into a preset range by using the preset function; The pixel gradient of each row of pixels in the mapped target image is calculated, the pixel gradient of each row of pixels is converted into a row vector, and the row vectors are spliced into the global features of the target image.
6. The face capture method according to claim 4, characterized in that: Generating the local features of the target image according to the pixel values in each of the pixel windows comprises: Select one pixel point from the pixel window one by one as the target pixel point; Determine whether the pixel value of the target pixel is an extreme value within the pixel window; When the pixel value of the target pixel point is not an extreme value in the pixel window, returning to the step of selecting one of the pixel points in the pixel window as the target pixel point one by one; When the pixel value of the target pixel point is an extreme value within the pixel window, determining the target pixel point as a key point; The pixel values of all key points in all pixel windows are vectorized, and the obtained vectors are aggregated as local features of the target image.
7. The face capture method according to any one of claims 1 to 6, characterized in that: The respectively calculating the correlation values between the image features and the preset standard features comprises: The correlation values between the image features and the preset standard features are calculated using the following correlation value algorithm: Among them, L k is the correlation value between the image feature corresponding to the k-th face capture image and the preset standard feature, a k is the image feature corresponding to the k-th face capture image, and b is the preset standard feature.
8. A face capture device, characterized in that: The device comprises: An image denoising module is used to obtain captured face images at different time points, and to remove noise pixels from the captured face images corresponding to each time point to obtain a denoised image. An image enhancement module, used for performing texture enhancement processing on each of the denoised images to obtain an enhanced image; A feature extraction module, used to extract image features of each enhanced image; An image screening module, used to respectively calculate the correlation values between the image features and the preset standard features, and collect the face capture images corresponding to the image features whose correlation values are greater than a preset threshold as the images to be screened; The capture timing calculation module is used to calculate the mean square error of the correlation value corresponding to each image to be screened, determine the time point corresponding to the image with the smallest mean square error as the face capture timing, and capture the face of the current framing image at the face capture timing.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the face capture method as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the face capture method according to any one of claims 1 to 7 is implemented.
