WO2020147257A1 - 一种人脸识别方法和装置 - Google Patents
一种人脸识别方法和装置 Download PDFInfo
- Publication number
- WO2020147257A1 WO2020147257A1 PCT/CN2019/091099 CN2019091099W WO2020147257A1 WO 2020147257 A1 WO2020147257 A1 WO 2020147257A1 CN 2019091099 W CN2019091099 W CN 2019091099W WO 2020147257 A1 WO2020147257 A1 WO 2020147257A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- image
- preset
- feature vector
- vector
- similarity
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V40/00—Recognition of biometric, human-related or animal-related patterns in image or video data
- G06V40/10—Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
- G06V40/16—Human faces, e.g. facial parts, sketches or expressions
- G06V40/168—Feature extraction; Face representation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/22—Matching criteria, e.g. proximity measures
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V40/00—Recognition of biometric, human-related or animal-related patterns in image or video data
- G06V40/10—Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
- G06V40/16—Human faces, e.g. facial parts, sketches or expressions
- G06V40/168—Feature extraction; Face representation
- G06V40/171—Local features and components; Facial parts ; Occluding parts, e.g. glasses; Geometrical relationships
Definitions
- This application relates to the field of artificial intelligence technology, and in particular to a face recognition method and device.
- Face recognition is a kind of biometric recognition technology based on human facial feature information. Use a video camera or camera to collect images or video streams containing human faces, and automatically detect and track human faces in the images, and then perform face recognition on the detected human faces.
- the embodiments of the present application provide a face recognition method and device to solve the problem that the low similarity calculation efficiency in the prior art leads to a slower face recognition speed.
- an embodiment of the present application provides a face recognition method, the method includes: collecting an image of a target user to obtain a first image; extracting a face area from the first image to obtain a second image; In the first preset area in the second image, the first preset area is an eye area; counting the number of pixels in the first preset area whose gray value is less than a first preset threshold; according to The number of pixels in the first preset area whose gray value is less than the first preset threshold determines whether the target user wears sunglasses; if it is determined that the target user does not wear sunglasses, calculate the second The feature vector corresponding to the image; acquiring feature vectors corresponding to multiple preset face images in the target database; normalizing the feature vectors corresponding to the second image, and comparing the multiple preset face images The feature vectors are respectively normalized, and the feature vector of the second image after the normalization process and the feature of each preset face image in the plurality of preset face images after the normalization process are calculated The cosine similarity between the
- an embodiment of the present application provides a face recognition device.
- the device includes: an acquisition unit for acquiring an image of a target user to obtain a first image; an extraction unit for extracting from the first image A human face area to obtain a second image; an intercepting unit for intercepting a first preset area in the second image, where the first preset area is an eye area; a statistical unit for collecting statistics on the first The number of pixels in the preset area whose gray value is less than the first preset threshold; the first determining unit is configured to determine the number of pixels in the first preset area whose gray value is less than the first preset threshold The number determines whether the target user wears sunglasses; the first calculation unit is configured to calculate the feature vector corresponding to the second image if it is determined that the target user does not wear sunglasses; the acquisition unit is configured to acquire more information in the target database Feature vectors corresponding to a preset face image; the second calculation unit is used to normalize the feature vectors corresponding to the second image, and perform the feature vectors corresponding to the
- an embodiment of the present application provides a storage medium that includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the aforementioned face recognition method.
- an embodiment of the present application provides a computer device, including a memory and a processor, the memory is used to store information including program instructions, the processor is used to control the execution of the program instructions, and the program instructions are executed by the processor.
- the steps of the face recognition method described above are realized when loaded and executed.
- the feature vector corresponding to the second image is normalized, the feature vector corresponding to a plurality of preset face images is respectively normalized, and the normalized value is calculated according to matrix multiplication.
- the cosine similarity between the feature vector of the second image and the feature vectors of the multiple preset face images after normalization is determined, and the difference between the second image and the multiple preset face images is determined according to the calculated cosine similarity.
- Similarity because the feature vector is normalized before the cosine similarity is calculated, there is no need to perform the modulus processing every time in the process of calculating the cosine similarity, so that multiple vector multiplication operations are converted into a single
- the matrix multiplication operation realizes parallel calculation, the similarity calculation efficiency is high, and the face recognition speed is faster, which solves the problem that the low similarity calculation efficiency in the prior art leads to the slow face recognition speed.
- FIG. 1 is a flowchart of an optional face recognition method provided by an embodiment of the present application
- Figure 2 is a schematic diagram of an optional face recognition device provided by an embodiment of the present application.
- Fig. 3 is a schematic diagram of an optional computer device provided by an embodiment of the present application.
- Fig. 1 is a flowchart of an optional face recognition method provided by an embodiment of the present application. As shown in Fig. 1, the method includes:
- Step S102 Collect an image of the target user to obtain a first image.
- Step S104 Extract a face area from the first image to obtain a second image.
- Step S106 intercept a first preset area in the second image, where the first preset area is an eye area.
- Step S108 Count the number of pixels in the first preset area whose gray value is less than the first preset threshold.
- Step S110 Determine whether the target user is wearing sunglasses according to the number of pixels in the first preset area whose gray value is less than the first preset threshold.
- Step S112 If it is determined that the target user is not wearing sunglasses, calculate the feature vector corresponding to the second image.
- Step S114 Obtain feature vectors corresponding to multiple preset face images in the target database.
- Step S116 Perform normalization processing on the feature vector corresponding to the second image, perform normalization processing on the feature vectors corresponding to multiple preset face images, respectively, and calculate the normalized feature vector of the second image and The cosine similarity between the feature vectors of each preset face image in the multiple preset face images after normalization processing, and the second image and the multiple preset face images are determined according to the calculated cosine similarity The similarity of each preset face image in.
- Step S118 Judge whether all the calculated similarities are less than a preset similarity threshold.
- Step S120 If all the calculated similarities are less than the preset similarity threshold, output first prompt information, which is used to prompt the target user that the verification fails.
- Step S122 If at least one of the calculated similarities is greater than or equal to the preset similarity threshold, filter out the preset face image corresponding to the largest similarity.
- Step S124 Use the user associated with the preset face image corresponding to the greatest similarity as a candidate user.
- Step S126 Output second prompt information, the second prompt information is used to prompt the target user to pass the verification, and to open the user authority of the candidate user.
- the camera collects the image of the target user, obtains the first image, extracts the face area from the first image, obtains the second image, and counts the number of pixels in the eye area of the second image whose gray value is less than the first preset threshold , Determine whether the target user wears sunglasses according to the number of pixels in the eye area whose gray value is less than the first preset threshold; if it is determined that the target user does not wear sunglasses, then calculate the feature vector corresponding to the second image.
- a number of preset face images are stored in the target database.
- the second prompt information is used to prompt the target user to pass the verification and activate the user authority of the candidate user.
- the feature vector corresponding to the second image is normalized, the feature vector corresponding to a plurality of preset face images is respectively normalized, and the normalized value is calculated according to matrix multiplication.
- the cosine similarity between the feature vector of the second image and the feature vectors of the multiple preset face images after normalization is determined, and the difference between the second image and the multiple preset face images is determined according to the calculated cosine similarity.
- Similarity because the feature vector is normalized before the cosine similarity is calculated, there is no need to perform the modulus processing every time in the process of calculating the cosine similarity, so that multiple vector multiplication operations are converted into a single
- the matrix multiplication operation realizes parallel calculation, the similarity calculation efficiency is high, and the face recognition speed is faster, which solves the problem that the low similarity calculation efficiency in the prior art leads to the slow face recognition speed.
- the second image is compared with multiple preset face images in the target database, which increases the accuracy of the comparison and avoids interference caused by sunglasses .
- perform normalization processing on the feature vector corresponding to the second image perform normalization processing on the feature vectors corresponding to a plurality of preset face images, respectively, and calculate the normalized feature vector of the second image
- the cosine similarity between the feature vector of each preset face image in the multiple preset face images after normalization processing includes: normalizing the feature vector corresponding to the second image, and then performing The vector obtained after transposition is used as the first vector, the first vector is a matrix with 1 row and m columns, and m is the dimension of the feature vector corresponding to the second image; the feature vectors corresponding to the n preset face images are respectively normalized
- the eigenvector obtained after the transformation is used as the second vector.
- the second vector is a matrix with m rows and 1 column.
- n is the number of preset face images; arrange the n second vectors into the first A matrix, where the first matrix is a matrix with m rows and n columns; the first vector and the first matrix are matrix multiplied to obtain a second vector, where the second vector is a matrix with 1 row and n columns, and the second vector
- the k-th element is the cosine similarity between the feature vector corresponding to the second image and the feature vector corresponding to the k-th preset face image, and 1 ⁇ k ⁇ n.
- the normalization process can be performed in a way of normalizing the vector L2 norm.
- the normalization of the L2 norm of a vector is to divide each element in the vector by the L2 norm of the vector.
- the L2 norm is calculated according to the following formula:
- the eigenvectors are normalized before the cosine similarity is calculated.
- the process of calculating the cosine similarity there is no need to perform the modulus processing every time, thus converting multiple vector multiplication operations into a single matrix
- the multiplication operation realizes the parallel calculation, the similarity calculation efficiency is high, and the face recognition speed is faster.
- calculating the feature vector corresponding to the second image includes: performing illumination preprocessing on the second image using a differential Gaussian algorithm, filtering out low-frequency information of the second image, and retaining high-frequency information of the second image to obtain a Gaussian image; Perform image histogram equalization processing on the Gaussian image to obtain an image with uniform gray value; calculate the feature vector corresponding to the image with uniform gray value, and use the calculated feature vector as the feature vector corresponding to the second image.
- the image histogram equalization process is to change the grayscale histogram of the image from a relatively concentrated form in a certain grayscale interval to a uniformly distributed form within the entire grayscale range, thereby increasing the local contrast of the image and making the image The part is clearer.
- the method further includes: performing homomorphic filtering processing on the first preset area; performing smoothing filtering processing on the first preset area after homomorphic filtering processing ; Perform neighborhood minimum filtering processing on the first preset area after smoothing filtering processing; performing preset ratio binarization processing on the first preset area after neighborhood minimum filtering processing to obtain the processed first
- calculating the feature vector corresponding to the second image includes: calculating the feature vector corresponding to the processed second image.
- Homomorphic filtering is an image processing method that combines frequency filtering and grayscale transformation. It relies on the image's illuminance or reflectance model as the basis of frequency domain processing, and uses compressed brightness range and enhanced contrast to improve image quality. Using this method can make the image processing conform to the non-linear characteristics of the human eye to the brightness response, so as to avoid the distortion caused by the direct Fourier transform processing of the image.
- a Gaussian filter may be used to perform smoothing filtering processing on the image of the first preset region that has been homomorphically filtered.
- the Gaussian filter is a linear smoothing filter that selects weights according to the shape of the Gaussian function.
- the Gaussian filter has a good effect on removing noise that obeys the normal distribution.
- Neighborhood minimum filtering is to traverse each pixel in the image, and the value of the traversed pixel is replaced by the minimum pixel value of all points in a certain neighborhood window of that point.
- the preset ratio binarization refers to the proportion of the gray value starting from 0 to the total gray value. Using histogram statistics to obtain the corresponding gray value when the preset proportion is met, the threshold value of the segmented image is obtained.
- the feature vector corresponding to the second image is calculated and subsequent operations are performed. If the target user wears sunglasses, a prompt message is output. The prompt message is used to prompt the target user to take off the sunglasses, and then reacquire the target user's image to ensure that the captured image does not contain sunglasses, so that the captured image is compared with When multiple preset face images in the target database are compared one by one, the accuracy of the comparison is increased and the interference caused by the sunglasses is avoided.
- the first preset area includes the area where the left eye is located and the area where the right eye is located.
- the first preset area is estimated according to the position relationship according to the size of the second image. The specific steps are as follows : Assuming that the second image is a rectangle with length M and width N, the area where the left eye is located is: the area between rows 0.12M and 0.47M and columns between 0.11N and 0.38N; the area where the right eye is located is: The area between rows 0.12M and 0.47M and columns between 0.62N and 0.89N.
- the embodiment of the present application provides a face recognition device, which is used to execute the above face recognition method.
- the device includes: a collection unit 10, an extraction unit 12, an interception unit 14, a statistics unit 16, The first judgment unit 18, the first calculation unit 20, the acquisition unit 22, the second calculation unit 24, the second judgment unit 26, the first output unit 28, the screening unit 30, the determination unit 32, and the second output unit 34.
- the acquisition unit 10 is used to acquire an image of a target user to obtain a first image.
- the extracting unit 12 is used to extract a face area from the first image to obtain a second image.
- the capturing unit 14 is configured to capture a first preset area in the second image, where the first preset area is an eye area.
- the statistics unit 16 is used to count the number of pixels in the first preset area whose gray value is less than the first preset threshold.
- the first judging unit 18 is configured to judge whether the target user wears sunglasses according to the number of pixels in the first preset area whose gray value is less than the first preset threshold.
- the first calculation unit 20 is configured to calculate the feature vector corresponding to the second image if it is determined that the target user is not wearing sunglasses.
- the acquiring unit 22 is configured to acquire feature vectors corresponding to multiple preset face images in the target database.
- the second calculation unit 24 is configured to perform normalization processing on the feature vector corresponding to the second image, perform normalization processing on the feature vectors corresponding to a plurality of preset face images, respectively, and calculate the normalized second
- the cosine similarity between the feature vector of the image and the feature vector of each preset face image in the multiple preset face images after normalization processing, and the second image and multiple preset face images are determined according to the calculated cosine similarity.
- the second judging unit 26 is used to judge whether all the calculated similarities are less than a preset similarity threshold.
- the first output unit 28 is configured to output first prompt information if all the calculated similarities are less than the preset similarity threshold.
- the first prompt information is used to prompt the target user that the verification fails.
- the screening unit 30 is configured to screen out the preset face image corresponding to the largest similarity if at least one of the calculated similarities is greater than or equal to the preset similarity threshold.
- the determining unit 32 is configured to use the user associated with the preset face image corresponding to the greatest similarity as a candidate user.
- the second output unit 34 is configured to output second prompt information, which is used to prompt the target user to pass the verification and activate the user authority of the candidate user.
- the feature vector corresponding to the second image is normalized, the feature vector corresponding to a plurality of preset face images is respectively normalized, and the normalized value is calculated according to matrix multiplication.
- the cosine similarity between the feature vector of the second image and the feature vectors of the multiple preset face images after normalization is determined, and the difference between the second image and the multiple preset face images is determined according to the calculated cosine similarity.
- Similarity because the feature vector is normalized before the cosine similarity is calculated, there is no need to perform the modulus processing every time in the process of calculating the cosine similarity, so that multiple vector multiplication operations are converted into a single
- the matrix multiplication operation realizes parallel calculation, the similarity calculation efficiency is high, and the face recognition speed is faster, which solves the problem that the low similarity calculation efficiency in the prior art leads to the slow face recognition speed.
- the second calculation unit 24 includes: a first calculation subunit, a second calculation subunit, an arrangement subunit, and a third calculation subunit.
- the first calculation subunit is used to normalize the feature vector corresponding to the second image, and then the vector obtained after transposing is used as the first vector.
- the first vector is a matrix with 1 row and m columns, and m is the first vector.
- the second calculation subunit is used to normalize the feature vectors corresponding to n preset face images as the second vector.
- the second vector is a matrix with m rows and 1 column.
- the second vector There are n, and n is the number of preset face images.
- the arrangement subunit is used to arrange the n second vectors into a first matrix, where the first matrix is a matrix with m rows and n columns.
- the third calculation subunit is used for matrix multiplication of the first vector and the first matrix to obtain a second vector, where the second vector is a matrix with 1 row and n columns, and the k-th element of the second vector is the second image
- the cosine similarity between the corresponding feature vector and the feature vector corresponding to the k-th preset face image is 1 ⁇ k ⁇ n.
- the first calculation unit 20 includes: a first processing subunit, a second processing subunit, and a fourth calculation subunit.
- the first processing subunit is used to perform illumination preprocessing on the second image by using the differential Gaussian algorithm, filter out the low frequency information of the second image, retain the high frequency information of the second image, and obtain a Gaussian image.
- the second processing subunit is used to perform image histogram equalization processing on the Gaussian image to obtain an image with uniform gray value.
- the fourth calculation subunit is used to calculate the feature vector corresponding to the image with uniform gray value, and use the calculated feature vector as the feature vector corresponding to the second image.
- the device further includes: a first processing unit, a second processing unit, a third processing unit, and a fourth processing unit.
- the first processing unit is configured to perform homomorphic filtering processing on the first preset area after the intercepting unit 14 intercepts the first preset area in the second image.
- the second processing unit is configured to perform smoothing filtering processing on the first preset region after homomorphic filtering processing.
- the third processing unit is configured to perform neighborhood minimum filtering processing on the first preset area after smooth filtering processing.
- the fourth processing unit is configured to perform a preset ratio binarization process on the first preset area after the neighborhood minimum filtering process, to obtain a processed second image.
- the first calculation unit includes: a fifth calculation subunit. The fifth calculation subunit is used to calculate the feature vector corresponding to the processed second image.
- the first judgment unit 18 includes: a sixth calculation subunit, a first determination subunit, and a second determination subunit.
- the first determining subunit is configured to determine that the target user wears sunglasses if the first proportional relationship L is greater than or equal to the second preset threshold.
- the second determining subunit is configured to determine that the target user does not wear sunglasses if the first proportional relationship L is less than the second preset threshold.
- the embodiment of the present application provides a computer non-volatile readable storage medium
- the computer non-volatile readable storage medium includes a stored program
- the device where the computer non-volatile readable storage medium is located is controlled when the program is running
- the device where the non-volatile readable storage medium of the computer is controlled further executes the following steps: normalize the feature vector corresponding to the second image, and then use the vector obtained after transposition as the first A vector, the first vector is a matrix with 1 row and m columns, and m is the dimension of the feature vector corresponding to the second image; the feature vectors obtained by normalizing the feature vectors corresponding to n preset face images are taken as The second vector, the second vector is a matrix with m rows and 1 column, there are n second vectors, and n is the number of preset face images; arrange the n second vectors into the first matrix, where the first matrix is A matrix with m rows and n columns; multiply the first vector with the first matrix to obtain a second vector, where the second vector is a matrix with 1 row and n columns, and the k-th element of the second vector corresponds to the second image
- the device where the computer's non-volatile readable storage medium is located is controlled to perform the following steps: perform illumination preprocessing on the second image using a differential Gaussian algorithm, filter out the low-frequency information of the second image, and retain the second image. High-frequency information of the image to obtain a Gaussian image; perform image histogram equalization processing on the Gaussian image to obtain an image with uniform gray value; calculate the feature vector corresponding to the image with uniform gray value, and use the calculated feature vector as the second The feature vector corresponding to the image.
- the device where the non-volatile readable storage medium of the computer is controlled further executes the following steps: after the first preset area in the second image is intercepted, homomorphic filtering is performed on the first preset area; Perform smoothing filter processing on the first preset area after homomorphic filtering processing; perform neighborhood minimum filtering processing on the first preset area after smoothing filtering processing; perform neighborhood minimum filtering processing on the first preset area that has undergone neighborhood minimum filtering processing.
- the preset area is subjected to a preset ratio binarization process to obtain a processed second image, and a feature vector corresponding to the processed second image is calculated.
- the embodiment of the present application provides a computer device, including a memory and a processor, the memory is used to store information including program instructions, the processor is used to control the execution of the program instructions, and the program instructions are loaded and executed by the processor to implement the following steps:
- the first image is obtained from the image of the target user; the face area is extracted from the first image to obtain the second image; the first preset area in the second image is intercepted, and the first preset area is the eye area;
- the number of pixels in the preset area whose gray value is less than the first preset threshold judge whether the target user wears sunglasses according to the number of pixels in the first preset area whose gray value is less than the first preset threshold; if it is determined If the target user does not wear sunglasses, the feature vector corresponding to the second image is calculated; the feature vector corresponding to multiple preset face images in the target database is obtained; the feature vector corresponding to the second image is normalized, and the multiple preset face images are normalized.
- the feature vector corresponding to the face image is normalized separately, and the feature vector of the second image after the normalization process is calculated and each preset face image in the multiple preset face images after the normalization process is calculated
- the following steps are also implemented: normalizing the feature vector corresponding to the second image, and then transposing the vector obtained as the first vector, the first vector is A matrix with 1 row and m columns, where m is the dimension of the feature vector corresponding to the second image; the feature vector obtained after normalization of the feature vectors corresponding to n preset face images is used as the second vector, the second vector Is a matrix with m rows and 1 column, there are n second vectors, n is the number of preset face images; arrange n second vectors into a first matrix, where the first matrix is a matrix with m rows and n columns; Multiply the first vector and the first matrix to obtain the second vector, where the second vector is a matrix with 1 row and n columns, and the kth element of the second vector is the eigenvector corresponding to the second image and the kth
- the cosine similarity between feature vectors corresponding to the face image is preset, 1 ⁇ k ⁇ n
- the following steps are also implemented: perform illumination preprocessing on the second image using the differential Gaussian algorithm, filter out the low-frequency information of the second image, and retain the high-frequency information of the second image to obtain Gaussian image; perform image histogram equalization processing on the Gaussian image to obtain an image with uniform gray value; calculate the feature vector corresponding to the image with uniform gray value, and use the calculated feature vector as the feature vector corresponding to the second image.
- the following steps are also implemented: after the first preset area in the second image is intercepted, homomorphic filtering is performed on the first preset area; Perform smoothing filtering processing on the first preset area of, performing smoothing filtering processing on the first preset area after smoothing filtering processing; performing neighborhood minimum filtering processing on the first preset area after smoothing filtering processing; performing preset ratio on the first preset area after neighborhood minimum filtering processing.
- the binarization process obtains the processed second image, and calculates the feature vector corresponding to the processed second image.
- FIG. 3 is a schematic diagram of a computer device provided by an embodiment of the present application.
- the computer device 50 of this embodiment includes: a processor 51, a memory 52, and a computer program 53 stored in the memory 52 and running on the processor 51.
- the computer program 53 is executed by the processor 51, To implement the face recognition method in the embodiment, in order to avoid repetition, it will not be repeated here.
- the computer program is executed by the processor 51, the function of each model/unit in the face recognition device in the embodiment is realized. To avoid repetition, it will not be repeated here.
- the computer device 50 may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server.
- the computer equipment may include, but is not limited to, a processor 51 and a memory 52.
- FIG. 3 is only an example of the computer device 50, and does not constitute a limitation on the computer device 50, and may include more or less components than shown, or combine some components, or different components.
- computer equipment may also include input and output devices, network access devices, buses, and so on.
- the so-called processor 51 can be a central processing unit (Central Processing Unit, CPU), other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
- the general-purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
- the memory 52 may be an internal storage unit of the computer device 50, such as a hard disk or memory of the computer device 50.
- the memory 52 may also be an external storage device of the computer device 50, for example, a plug-in hard disk equipped on the computer device 50, a smart memory card (Smart Media (SMC), a secure digital (SD) card, and a flash memory card (Flash Card) etc.
- the memory 52 may also include both the internal storage unit of the computer device 50 and the external storage device.
- the memory 52 is used to store computer programs and other programs and data required by computer devices.
- the memory 52 may also be used to temporarily store data that has been or will be output.
- the disclosed system, device, and method may be implemented in other ways.
- the device embodiments described above are only schematic.
- the division of the unit is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components may be combined Or it can be integrated into another system, or some features can be ignored or not implemented.
- the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical, or other forms.
- the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
- each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
- the above integrated unit can be implemented in the form of hardware, or in the form of hardware plus software functional units.
- the above-mentioned integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium.
- the above software functional unit is stored in a storage medium, and includes several instructions to enable a computer device (which may be a personal computer, server, or network device, etc.) or processor (Processor) to perform the methods described in the embodiments of the present application Partial steps.
- the foregoing storage media include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program code .
Landscapes
- Engineering & Computer Science (AREA)
- Oral & Maxillofacial Surgery (AREA)
- Health & Medical Sciences (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- General Health & Medical Sciences (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Multimedia (AREA)
- Human Computer Interaction (AREA)
- Bioinformatics & Cheminformatics (AREA)
- General Engineering & Computer Science (AREA)
- Evolutionary Computation (AREA)
- Evolutionary Biology (AREA)
- Bioinformatics & Computational Biology (AREA)
- Artificial Intelligence (AREA)
- Life Sciences & Earth Sciences (AREA)
- Image Analysis (AREA)
Abstract
一种人脸识别方法和装置,涉及人工智能技术领域,该方法包括:计算第二图像对应的特征向量(S112);计算归一化处理后的第二图像的特征向量与归一化处理后的多个预设人脸图像中每个预设人脸图像的特征向量之间的余弦相似度(S116);如果计算出的所有相似度均小于预设相似度阈值,则输出第一提示信息,第一提示信息用于提示目标用户验证失败(S120);如果计算出的相似度中有至少一个大于或等于预设相似度阈值,则筛选出最大的相似度对应的预设人脸图像(S122);将最大的相似度对应的预设人脸图像相关联的用户作为候选用户(S124)。因此,上述技术方案能够解决现有技术中相似度计算效率低导致人脸识别的速度较慢的问题。
Description
本申请要求于2019年1月16日提交中国专利局、申请号为201910039146.X、申请名称为“一种人脸识别方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及人工智能技术领域,尤其涉及一种人脸识别方法和装置。
人脸识别,是基于人的脸部特征信息进行身份识别的一种生物识别技术。用摄像机或摄像头采集含有人脸的图像或视频流,并自动在图像中检测和跟踪人脸,进而对检测到的人脸进行脸部识别。
人脸识别过程中,需要将现场采集的图像与数据库中预先存储的图像进行相似度计算,在图像数量大的情况下,相似度计算效率低导致人脸识别的速度较慢。
【申请内容】
有鉴于此,本申请实施例提供了一种人脸识别方法和装置,用以解决现有技术中相似度计算效率低导致人脸识别的速度较慢的问题。
一方面,本申请实施例提供了一种人脸识别方法,所述方法包括:采集目标用户的图像,得到第一图像;从所述第一图像中提取人脸区域,得到第二图像;截取所述第二图像中的第一预设区域,所述第一预设区域为眼部区域;统计所述第一预设区域中灰度值小于第一预设阈值的像素点的数量;根据所述第一预设区域中灰度值小于所述第一预设阈值的像素点的数量判断所述目标 用户是否佩戴墨镜;如果判断出所述目标用户没有佩戴墨镜,则计算所述第二图像对应的特征向量;获取目标数据库中多个预设人脸图像对应的特征向量;将所述第二图像对应的特征向量进行归一化处理,将所述多个预设人脸图像对应的特征向量分别进行归一化处理,计算归一化处理后的所述第二图像的特征向量与归一化处理后的所述多个预设人脸图像中每个预设人脸图像的特征向量之间的余弦相似度,根据计算得到的余弦相似度确定所述第二图像与所述多个预设人脸图像中每个预设人脸图像的相似度;判断计算出的所有相似度是否均小于预设相似度阈值;如果计算出的所有相似度均小于所述预设相似度阈值,则输出第一提示信息,所述第一提示信息用于提示所述目标用户验证失败;如果计算出的相似度中有至少一个大于或等于所述预设相似度阈值,则筛选出最大的相似度对应的预设人脸图像;将最大的相似度对应的预设人脸图像相关联的用户作为候选用户;输出第二提示信息,所述第二提示信息用于提示所述目标用户验证通过,并开启所述候选用户的用户权限。
一方面,本申请实施例提供了一种人脸识别装置,所述装置包括:采集单元,用于采集目标用户的图像,得到第一图像;提取单元,用于从所述第一图像中提取人脸区域,得到第二图像;截取单元,用于截取所述第二图像中的第一预设区域,所述第一预设区域为眼部区域;统计单元,用于统计所述第一预设区域中灰度值小于第一预设阈值的像素点的数量;第一判断单元,用于根据所述第一预设区域中灰度值小于所述第一预设阈值的像素点的数量判断所述目标用户是否佩戴墨镜;第一计算单元,用于如果判断出所述目标用户没有佩戴墨镜,则计算所述第二图像对应的特征向量;获取单元,用于获取目标数据库中多个预设人脸图像对应的特征向量;第二计算单元,用于将所述第二图像对应的特征向量进行归一化处理,将所述多个预设人脸图像对应的特征向量分别进行归一化处理,计算归一化处理后的所述第二图像的特征向量与归一化处理后的所述多个预设人脸图像中每个预设人脸图像的特征向量之间的余弦相似度,根据计算得到的余弦相 似度确定所述第二图像与所述多个预设人脸图像中每个预设人脸图像的相似度;第二判断单元,用于判断计算出的所有相似度是否均小于预设相似度阈值;第一输出单元,用于如果计算出的所有相似度均小于所述预设相似度阈值,则输出第一提示信息,所述第一提示信息用于提示所述目标用户验证失败;筛选单元,用于如果计算出的相似度中有至少一个大于或等于所述预设相似度阈值,则筛选出最大的相似度对应的预设人脸图像;确定单元,用于将最大的相似度对应的预设人脸图像相关联的用户作为候选用户;第二输出单元,用于输出第二提示信息,所述第二提示信息用于提示所述目标用户验证通过,并开启所述候选用户的用户权限。
一方面,本申请实施例提供了一种存储介质,所述存储介质包括存储的程序,其中,在所述程序运行时控制所述存储介质所在设备执行上述的人脸识别方法。
一方面,本申请实施例提供了一种计算机设备,包括存储器和处理器,所述存储器用于存储包括程序指令的信息,所述处理器用于控制程序指令的执行,所述程序指令被处理器加载并执行时实现上述的人脸识别方法的步骤。
在本申请实施例中,将第二图像对应的特征向量进行归一化处理,将多个预设人脸图像对应的特征向量分别进行归一化处理,根据矩阵乘法计算归一化处理后的第二图像的特征向量与归一化处理后的多个预设人脸图像的特征向量之间的余弦相似度,根据计算得到的余弦相似度确定第二图像与多个预设人脸图像的相似度,由于在计算余弦相似度之前先将特征向量进行了归一化处理,在计算余弦相似度的过程中不需要每次都进行除模处理,从而将多次向量乘法运算转换为单次矩阵乘法运算,实现了并行计算,相似度计算效率高,人脸识别的速度较快,解决了现有技术中相似度计算效率低导致人脸识别的速度较慢的问题。
为了更清楚地说明本申请实施例的技术方案,下面将对实施例中所需要 使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其它的附图。
图1是本申请实施例提供的一种可选的人脸识别方法的流程图;
图2是本申请实施例提供的一种可选的人脸识别装置的示意图;
图3是本申请实施例提供的一种可选的计算机设备的示意图。
为了更好的理解本申请的技术方案,下面结合附图对本申请实施例进行详细描述。
应当明确,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其它实施例,都属于本申请保护的范围。
在本申请实施例中使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本申请。在本申请实施例和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。
应当理解,本文中使用的术语“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,甲和/或乙,可以表示:单独存在甲,同时存在甲和乙,单独存在乙这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。
图1是本申请实施例提供的一种可选的人脸识别方法的流程图,如图1所示,该方法包括:
步骤S102:采集目标用户的图像,得到第一图像。
步骤S104:从第一图像中提取人脸区域,得到第二图像。
步骤S106:截取第二图像中的第一预设区域,第一预设区域为眼部区域。
步骤S108:统计第一预设区域中灰度值小于第一预设阈值的像素点的数量。
步骤S110:根据第一预设区域中灰度值小于第一预设阈值的像素点的数量判断目标用户是否佩戴墨镜。
步骤S112:如果判断出目标用户没有佩戴墨镜,则计算第二图像对应的特征向量。
步骤S114:获取目标数据库中多个预设人脸图像对应的特征向量。
步骤S116:将第二图像对应的特征向量进行归一化处理,将多个预设人脸图像对应的特征向量分别进行归一化处理,计算归一化处理后的第二图像的特征向量与归一化处理后的多个预设人脸图像中每个预设人脸图像的特征向量之间的余弦相似度,根据计算得到的余弦相似度确定第二图像与多个预设人脸图像中每个预设人脸图像的相似度。
步骤S118:判断计算出的所有相似度是否均小于预设相似度阈值。
步骤S120:如果计算出的所有相似度均小于预设相似度阈值,则输出第一提示信息,第一提示信息用于提示目标用户验证失败。
步骤S122:如果计算出的相似度中有至少一个大于或等于预设相似度阈值,则筛选出最大的相似度对应的预设人脸图像。
步骤S124:将最大的相似度对应的预设人脸图像相关联的用户作为候选用户。
步骤S126:输出第二提示信息,第二提示信息用于提示目标用户验证通过,并开启候选用户的用户权限。
摄像头采集目标用户的图像,得到第一图像,从第一图像中提取人脸区域,得到第二图像,统计第二图像的眼部区域中灰度值小于第一预设阈值的像素点的数量,根据眼部区域中灰度值小于第一预设阈值的像素点的数量判断目标用户是否佩戴墨镜,如果判断出目标用户没有佩戴墨镜,则计算第二图像对应的特征向量。目标数据库中存储了多个预设人脸图像。将第二图像对应的特征向量进行归一化处理,将多个预设人脸图像对应的特征向量分别进行归一化处理,计算归一化处理后的第二图像的特征向量与归一化处理后的多个预设人脸图像中每个预设人脸图像的特征向量之间的余弦相似度,根据计算得到的余弦相似度确定第二图像与多个预设人脸图像中每个预设人脸图像的相似度,如果计算出的所有相似度均小于预设相似度阈值,则说明目标数据库没有预存该目标用户的人脸图像,输出第一提示信息,第一提示信息用于提示目标用户验证失败。如果计算出的相似度中有至少一个大于或等于预设相似度阈值,则筛选出最大的相似度对应的预设人脸图像,将最大的相似度对应的预设人脸图像相关联的用户作为候选用户,确定候选用户与目标用户为同一个人,输出第二提示信息,第二提示信息用于提示目标用户验证通过,并开启候选用户的用户权限。
在本申请实施例中,将第二图像对应的特征向量进行归一化处理,将多个预设人脸图像对应的特征向量分别进行归一化处理,根据矩阵乘法计算归一化处理后的第二图像的特征向量与归一化处理后的多个预设人脸图像的特征向量之间的余弦相似度,根据计算得到的余弦相似度确定第二图像与多个预设人脸图像的相似度,由于在计算余弦相似度之前先将特征向量进行了归一化处理,在计算余弦相似度的过程中不需要每次都进行除模处理,从而将多次向量乘法运算转换为单次矩阵乘法运算,实现了并行计算,相似度计算效率高,人脸识别的速度较快,解决了现有技术中相似度计算效率低导致人脸识别的速度较慢的问题。
并且,只有在第二图像不包含墨镜的情况下,才将第二图像与目标数据库中多个预设人脸图像进行比对,增加了比对的准确度,避免了由墨镜带来的干扰。
可选地,将第二图像对应的特征向量进行归一化处理,将多个预设人脸图像对应的特征向量分别进行归一化处理,计算归一化处理后的第二图像的特征向量与归一化处理后的多个预设人脸图像中每个预设人脸图像的特征向量之间的余弦相似度,包括:将第二图像对应的特征向量进行归一化处理,再进行转置处理后得到的向量作为第一向量,第一向量为1行m列的矩阵,m为第二图像对应的特征向量的维度;将n个预设人脸图像对应的特征向量分别进行归一化处理后得到的特征向量作为第二向量,第二向量为m行1列的矩阵,第二向量有n个,n为预设人脸图像的数量;将n个第二向量排列成第一矩阵,其中,第一矩阵为m行n列的矩阵;将第一向量与第一矩阵作矩阵乘法,得到第二向量,其中,第二向量为1行n列的矩阵,第二向量的第k个元素为第二图像对应的特征向量与第k个预设人脸图像对应的特征向量之间的余弦相似度,1≤k≤n。
归一化处理可以采用向量L2范数归一化的方式进行。
向量L2范数归一化就是向量中每个元素除以向量的L2范数。L2范数根据以下公式计算:
本方案由于在计算余弦相似度之前先将特征向量进行了归一化处理,在计算余弦相似度的过程中不需要每次都进行除模处理,从而将多次向量乘法运算转换为单次矩阵乘法运算,实现了并行计算,相似度计算效率高,人脸识别的速度较快。
可选地,计算第二图像对应的特征向量,包括:利用差分高斯算法对第二图像进行光照预处理,滤除第 二图像的低频信息,保留第二图像的高频信息,得到高斯图像;对高斯图像进行图像直方图均衡化处理,得到灰度值均匀的图像;计算灰度值均匀的图像对应的特征向量,将计算得到的特征向量作为第二图像对应的特征向量。
图像直方图均衡化处理是把图像的灰度直方图从在某个灰度区间比较集中的形式,变成在全部灰度范围内的均匀分布的形式,从而增加图像的局部对比度,使图像的局部更加清晰。
可选地,截取第二图像中的第一预设区域之后,方法还包括:对第一预设区域进行同态滤波处理;对经过同态滤波处理后的第一预设区域进行平滑滤波处理;对经过平滑滤波处理后的第一预设区域进行邻域最小值滤波处理;对经过邻域最小值滤波处理后的第一预设区域进行预设比例二值化处理,得到处理后的第二图像,计算第二图像对应的特征向量,包括:计算处理后的第二图像对应的特征向量。
同态滤波是将频率过滤和灰度变换相结合的一种图像处理方法,依靠图像的照度或者反射率模型作为频域处理的基础,利用压缩亮度范围和增强对比度来改善图像的质量。使用该方法可以使图像处理符合人眼对于亮度响应的非线性特性,从而避免直接对图像进行傅里叶变换处理所导致的失真。
可以使用高斯滤波器对经过同态滤波的第一预设区域的图像进行平滑滤波处理。高斯滤波器是根据高斯函数的形状来选择权值的线性平滑滤波器。高斯滤波器对去除服从正态分布的噪声有较好的效果。
邻域最小值滤波是对图像中每个像素进行遍历,遍历到的像素的值被该点某邻域窗口内的所有点中的最小像素值取代。
预设比例二值化,是指从0开始的灰度值占总灰度值的比重,利用直方图统计得到满足预设比重时对应的灰度值,即得到分割图像的阈值。
可选地,根据第一预设区域中灰度值小于第一预设阈值的像素点的数量判断目标用户是否佩戴墨镜,包括:根据公式L=t1/t计算第一比例关系,L为第一比例关系,t1为第一预设区域中灰度值小于第一预设阈值的像素点的数量,t为第一预设区域中像素点的数量;如果第一比例关系L大于等于第二预设阈值,则确定目标用户佩戴墨镜;如果第一比例关系L小于第二预设阈值,则确定目标用户没有佩戴墨镜。
如果目标用户没有佩戴墨镜,则计算第二图像对应的特征向量并进行后续的操作。如果目标用户佩戴了墨镜,则输出提示信息,提示信息用于提示目标用户摘掉墨镜,之后重新采集目标用户的图像,确保采集到的图像是不包含墨镜的,从而在将采集到的图像与目标数据库中多个预设人脸图像一一比对时,增加比对的准确度,避免由墨镜带来的干扰。
第一预设区域包括左眼所在的区域和右眼所在的区域,截取第二图像中的第一预设区域之前,根据第二图像的大小按照位置关系估计第一预设区域,具体步骤为:假设第二图像为长为M宽为N的矩形,则左眼所在的区域为:行0.12M至0.47M之间、列0.11N至0.38N之间的区域;右眼所在的区域为:行0.12M至0.47M之间、列0.62N至0.89N之间的区域。
本申请实施例提供了一种人脸识别装置,该装置用于执行上述人脸识别方法,如图2所示,该装置包括:采集单元10、提取单元12、截取单元14、统计单元16、第一判断单元18、第一计算单元20、获取单元22、第二计算单元24、第二判断单元26、第一输出单元28、筛选单元30、确定单元32、第二输出单元34。
采集单元10,用于采集目标用户的图像,得到第一图像。
提取单元12,用于从第一图像中提取人脸区域,得到第二图像。
截取单元14,用于截取第二图像中的第一预设区域,第一预设区域为眼部区域。
统计单元16,用于统计第一预设区域中灰度值小于第一预设阈值的像素点的数量。
第一判断单元18,用于根据第一预设区域中灰度值小于第一预设阈值的像素点的数量判断目标用户是 否佩戴墨镜。
第一计算单元20,用于如果判断出目标用户没有佩戴墨镜,则计算第二图像对应的特征向量。
获取单元22,用于获取目标数据库中多个预设人脸图像对应的特征向量。
第二计算单元24,用于将第二图像对应的特征向量进行归一化处理,将多个预设人脸图像对应的特征向量分别进行归一化处理,计算归一化处理后的第二图像的特征向量与归一化处理后的多个预设人脸图像中每个预设人脸图像的特征向量之间的余弦相似度,根据计算得到的余弦相似度确定第二图像与多个预设人脸图像中每个预设人脸图像的相似度。
第二判断单元26,用于判断计算出的所有相似度是否均小于预设相似度阈值。
第一输出单元28,用于如果计算出的所有相似度均小于预设相似度阈值,则输出第一提示信息,第一提示信息用于提示目标用户验证失败。
筛选单元30,用于如果计算出的相似度中有至少一个大于或等于预设相似度阈值,则筛选出最大的相似度对应的预设人脸图像。
确定单元32,用于将最大的相似度对应的预设人脸图像相关联的用户作为候选用户。
第二输出单元34,用于输出第二提示信息,第二提示信息用于提示目标用户验证通过,并开启候选用户的用户权限。
在本申请实施例中,将第二图像对应的特征向量进行归一化处理,将多个预设人脸图像对应的特征向量分别进行归一化处理,根据矩阵乘法计算归一化处理后的第二图像的特征向量与归一化处理后的多个预设人脸图像的特征向量之间的余弦相似度,根据计算得到的余弦相似度确定第二图像与多个预设人脸图像的相似度,由于在计算余弦相似度之前先将特征向量进行了归一化处理,在计算余弦相似度的过程中不需要每次都进行除模处理,从而将多次向量乘法运算转换为单次矩阵乘法运算,实现了并行计算,相似度计算效率高,人脸识别的速度较快,解决了现有技术中相似度计算效率低导致人脸识别的速度较慢的问题。
可选地,第二计算单元24包括:第一计算子单元、第二计算子单元、排列子单元、第三计算子单元。第一计算子单元,用于将第二图像对应的特征向量进行归一化处理,再进行转置处理后得到的向量作为第一向量,第一向量为1行m列的矩阵,m为第二图像对应的特征向量的维度。第二计算子单元,用于将n个预设人脸图像对应的特征向量分别进行归一化处理后得到的特征向量作为第二向量,第二向量为m行1列的矩阵,第二向量有n个,n为预设人脸图像的数量。排列子单元,用于将n个第二向量排列成第一矩阵,其中,第一矩阵为m行n列的矩阵。第三计算子单元,用于将第一向量与第一矩阵作矩阵乘法,得到第二向量,其中,第二向量为1行n列的矩阵,第二向量的第k个元素为第二图像对应的特征向量与第k个预设人脸图像对应的特征向量之间的余弦相似度,1≤k≤n。
可选地,第一计算单元20包括:第一处理子单元、第二处理子单元、第四计算子单元。第一处理子单元,用于利用差分高斯算法对第二图像进行光照预处理,滤除第二图像的低频信息,保留第二图像的高频信息,得到高斯图像。第二处理子单元,用于对高斯图像进行图像直方图均衡化处理,得到灰度值均匀的图像。第四计算子单元,用于计算灰度值均匀的图像对应的特征向量,将计算得到的特征向量作为第二图像对应的特征向量。
可选地,装置还包括:第一处理单元、第二处理单元、第三处理单元、第四处理单元。第一处理单元,用于截取单元14截取第二图像中的第一预设区域之后,对第一预设区域进行同态滤波处理。第二处理单元,用于对经过同态滤波处理后的第一预设区域进行平滑滤波处理。第三处理单元,用于对经过平滑滤波处理后的第一预设区域进行邻域最小值滤波处理。第四处理单元,用于对经过邻域最小值滤波处理后的第一预设区域进行预设比例二值化处理,得到处理后的第二图像。第一计算单元包括:第五计算子单元。第五计算子单 元,用于计算处理后的第二图像对应的特征向量。
可选地,第一判断单元18包括:第六计算子单元、第一确定子单元、第二确定子单元。第六计算子单元,用于根据公式L=t1/t计算第一比例关系,L为第一比例关系,t1为第一预设区域中灰度值小于第一预设阈值的像素点的数量,t为第一预设区域中像素点的数量。第一确定子单元,用于如果第一比例关系L大于等于第二预设阈值,则确定目标用户佩戴墨镜。第二确定子单元,用于如果第一比例关系L小于第二预设阈值,则确定目标用户没有佩戴墨镜。
本申请实施例提供了一种计算机非易失性可读存储介质,计算机非易失性可读存储介质包括存储的程序,其中,在程序运行时控制计算机非易失性可读存储介质所在设备执行以下步骤:采集目标用户的图像,得到第一图像;从第一图像中提取人脸区域,得到第二图像;截取第二图像中的第一预设区域,第一预设区域为眼部区域;统计第一预设区域中灰度值小于第一预设阈值的像素点的数量;根据第一预设区域中灰度值小于第一预设阈值的像素点的数量判断目标用户是否佩戴墨镜;如果判断出目标用户没有佩戴墨镜,则计算第二图像对应的特征向量;获取目标数据库中多个预设人脸图像对应的特征向量;将第二图像对应的特征向量进行归一化处理,将多个预设人脸图像对应的特征向量分别进行归一化处理,计算归一化处理后的第二图像的特征向量与归一化处理后的多个预设人脸图像中每个预设人脸图像的特征向量之间的余弦相似度,根据计算得到的余弦相似度确定第二图像与多个预设人脸图像中每个预设人脸图像的相似度;判断计算出的所有相似度是否均小于预设相似度阈值;如果计算出的所有相似度均小于预设相似度阈值,则输出第一提示信息,第一提示信息用于提示目标用户验证失败;如果计算出的相似度中有至少一个大于或等于预设相似度阈值,则筛选出最大的相似度对应的预设人脸图像;将最大的相似度对应的预设人脸图像相关联的用户作为候选用户;输出第二提示信息,第二提示信息用于提示目标用户验证通过,并开启候选用户的用户权限。
可选地,在程序运行时控制计算机非易失性可读存储介质所在设备还执行以下步骤:将第二图像对应的特征向量进行归一化处理,再进行转置处理后得到的向量作为第一向量,第一向量为1行m列的矩阵,m为第二图像对应的特征向量的维度;将n个预设人脸图像对应的特征向量分别进行归一化处理后得到的特征向量作为第二向量,第二向量为m行1列的矩阵,第二向量有n个,n为预设人脸图像的数量;将n个第二向量排列成第一矩阵,其中,第一矩阵为m行n列的矩阵;将第一向量与第一矩阵作矩阵乘法,得到第二向量,其中,第二向量为1行n列的矩阵,第二向量的第k个元素为第二图像对应的特征向量与第k个预设人脸图像对应的特征向量之间的余弦相似度,1≤k≤n。
可选地,在程序运行时控制计算机非易失性可读存储介质所在设备还执行以下步骤:利用差分高斯算法对第二图像进行光照预处理,滤除第二图像的低频信息,保留第二图像的高频信息,得到高斯图像;对高斯图像进行图像直方图均衡化处理,得到灰度值均匀的图像;计算灰度值均匀的图像对应的特征向量,将计算得到的特征向量作为第二图像对应的特征向量。
可选地,在程序运行时控制计算机非易失性可读存储介质所在设备还执行以下步骤:截取第二图像中的第一预设区域之后,对第一预设区域进行同态滤波处理;对经过同态滤波处理后的第一预设区域进行平滑滤波处理;对经过平滑滤波处理后的第一预设区域进行邻域最小值滤波处理;对经过邻域最小值滤波处理后的第一预设区域进行预设比例二值化处理,得到处理后的第二图像,计算处理后的第二图像对应的特征向量。
可选地,在程序运行时控制计算机非易失性可读存储介质所在设备还执行以下步骤:根据公式L=t1/t计算第一比例关系,L为第一比例关系,t1为第一预设区域中灰度值小于第一预设阈值的像素点的数量,t为第一预设区域中像素点的数量;如果第一比例关系L大于等于第二预设阈值,则确定目标用户佩戴墨镜;如果第一比例关系L小于第二预设阈值,则确定目标用户没有佩戴墨镜。
本申请实施例提供了一种计算机设备,包括存储器和处理器,存储器用于存储包括程序指令的信息,处理器用于控制程序指令的执行,程序指令被处理器加载并执行时实现以下步骤:采集目标用户的图像,得到第一图像;从第一图像中提取人脸区域,得到第二图像;截取第二图像中的第一预设区域,第一预设区域为眼部区域;统计第一预设区域中灰度值小于第一预设阈值的像素点的数量;根据第一预设区域中灰度值小于第一预设阈值的像素点的数量判断目标用户是否佩戴墨镜;如果判断出目标用户没有佩戴墨镜,则计算第二图像对应的特征向量;获取目标数据库中多个预设人脸图像对应的特征向量;将第二图像对应的特征向量进行归一化处理,将多个预设人脸图像对应的特征向量分别进行归一化处理,计算归一化处理后的第二图像的特征向量与归一化处理后的多个预设人脸图像中每个预设人脸图像的特征向量之间的余弦相似度,根据计算得到的余弦相似度确定第二图像与多个预设人脸图像中每个预设人脸图像的相似度;判断计算出的所有相似度是否均小于预设相似度阈值;如果计算出的所有相似度均小于预设相似度阈值,则输出第一提示信息,第一提示信息用于提示目标用户验证失败;如果计算出的相似度中有至少一个大于或等于预设相似度阈值,则筛选出最大的相似度对应的预设人脸图像;将最大的相似度对应的预设人脸图像相关联的用户作为候选用户;输出第二提示信息,第二提示信息用于提示目标用户验证通过,并开启候选用户的用户权限。
可选地,程序指令被处理器加载并执行时还实现以下步骤:将第二图像对应的特征向量进行归一化处理,再进行转置处理后得到的向量作为第一向量,第一向量为1行m列的矩阵,m为第二图像对应的特征向量的维度;将n个预设人脸图像对应的特征向量分别进行归一化处理后得到的特征向量作为第二向量,第二向量为m行1列的矩阵,第二向量有n个,n为预设人脸图像的数量;将n个第二向量排列成第一矩阵,其中,第一矩阵为m行n列的矩阵;将第一向量与第一矩阵作矩阵乘法,得到第二向量,其中,第二向量为1行n列的矩阵,第二向量的第k个元素为第二图像对应的特征向量与第k个预设人脸图像对应的特征向量之间的余弦相似度,1≤k≤n。
可选地,程序指令被处理器加载并执行时还实现以下步骤:利用差分高斯算法对第二图像进行光照预处理,滤除第二图像的低频信息,保留第二图像的高频信息,得到高斯图像;对高斯图像进行图像直方图均衡化处理,得到灰度值均匀的图像;计算灰度值均匀的图像对应的特征向量,将计算得到的特征向量作为第二图像对应的特征向量。
可选地,程序指令被处理器加载并执行时还实现以下步骤:截取第二图像中的第一预设区域之后,对第一预设区域进行同态滤波处理;对经过同态滤波处理后的第一预设区域进行平滑滤波处理;对经过平滑滤波处理后的第一预设区域进行邻域最小值滤波处理;对经过邻域最小值滤波处理后的第一预设区域进行预设比例二值化处理,得到处理后的第二图像,计算处理后的第二图像对应的特征向量。
可选地,程序指令被处理器加载并执行时还实现以下步骤:根据公式L=t1/t计算第一比例关系,L为第一比例关系,t1为第一预设区域中灰度值小于第一预设阈值的像素点的数量,t为第一预设区域中像素点的数量;如果第一比例关系L大于等于第二预设阈值,则确定目标用户佩戴墨镜;如果第一比例关系L小于第二预设阈值,则确定目标用户没有佩戴墨镜。
图3是本申请实施例提供的一种计算机设备的示意图。如图3所示,该实施例的计算机设备50包括:处理器51、存储器52以及存储在存储器52中并可在处理器51上运行的计算机程序53,该计算机程序53被处理器51执行时实现实施例中的人脸识别方法,为避免重复,此处不一一赘述。或者,该计算机程序被处理器51执行时实现实施例中人脸识别装置中各模型/单元的功能,为避免重复,此处不一一赘述。
计算机设备50可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。计算机设备 可包括,但不仅限于,处理器51、存储器52。本领域技术人员可以理解,图3仅仅是计算机设备50的示例,并不构成对计算机设备50的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如计算机设备还可以包括输入输出设备、网络接入设备、总线等。
所称处理器51可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
存储器52可以是计算机设备50的内部存储单元,例如计算机设备50的硬盘或内存。存储器52也可以是计算机设备50的外部存储设备,例如计算机设备50上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器52还可以既包括计算机设备50的内部存储单元也包括外部存储设备。存储器52用于存储计算机程序以及计算机设备所需的其他程序和数据。存储器52还可以用于暂时地存储已经输出或者将要输出的数据。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如,多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。
上述以软件功能单元的形式实现的集成的单元,可以存储在一个计算机可读取存储介质中。上述软件功能单元存储在一个存储介质中,包括若干指令用以使得一台计算机装置(可以是个人计算机,服务器,或者网络装置等)或处理器(Processor)执行本申请各个实施例所述方法的部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述仅为本申请的较佳实施例而已,并不用以限制本申请,凡在本申请的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本申请保护的范围之内。
Claims (20)
- 一种人脸识别方法,其特征在于,所述方法包括:采集目标用户的图像,得到第一图像;从所述第一图像中提取人脸区域,得到第二图像;截取所述第二图像中的第一预设区域,所述第一预设区域为眼部区域;统计所述第一预设区域中灰度值小于第一预设阈值的像素点的数量;根据所述第一预设区域中灰度值小于所述第一预设阈值的像素点的数量判断所述目标用户是否佩戴墨镜;如果判断出所述目标用户没有佩戴墨镜,则计算所述第二图像对应的特征向量;获取目标数据库中多个预设人脸图像对应的特征向量;将所述第二图像对应的特征向量进行归一化处理,将所述多个预设人脸图像对应的特征向量分别进行归一化处理,计算归一化处理后的所述第二图像的特征向量与归一化处理后的所述多个预设人脸图像中每个预设人脸图像的特征向量之间的余弦相似度,根据计算得到的余弦相似度确定所述第二图像与所述多个预设人脸图像中每个预设人脸图像的相似度;判断计算出的所有相似度是否均小于预设相似度阈值;如果计算出的所有相似度均小于所述预设相似度阈值,则输出第一提示信息,所述第一提示信息用于提示所述目标用户验证失败;如果计算出的相似度中有至少一个大于或等于所述预设相似度阈值,则筛选出最大的相似度对应的预设人脸图像;将最大的相似度对应的预设人脸图像相关联的用户作为候选用户;输出第二提示信息,所述第二提示信息用于提示所述目标用户验证通过,并开启所述候选用户的用户权限。
- 根据权利要求1所述的方法,其特征在于,所述将所述第二图像对应的 特征向量进行归一化处理,将所述多个预设人脸图像对应的特征向量分别进行归一化处理,计算归一化处理后的所述第二图像的特征向量与归一化处理后的所述多个预设人脸图像中每个预设人脸图像的特征向量之间的余弦相似度,包括:将所述第二图像对应的特征向量进行归一化处理,再进行转置处理后得到的向量作为第一向量,所述第一向量为1行m列的矩阵,m为所述第二图像对应的特征向量的维度;将n个预设人脸图像对应的特征向量分别进行归一化处理后得到的特征向量作为第二向量,所述第二向量为m行1列的矩阵,第二向量有n个,n为预设人脸图像的数量;将n个所述第二向量排列成第一矩阵,其中,所述第一矩阵为m行n列的矩阵;将所述第一向量与所述第一矩阵作矩阵乘法,得到第二向量,其中,所述第二向量为1行n列的矩阵,所述第二向量的第k个元素为所述第二图像对应的特征向量与第k个预设人脸图像对应的特征向量之间的余弦相似度,1≤k≤n。
- 根据权利要求1所述的方法,其特征在于,所述计算所述第二图像对应的特征向量,包括:利用差分高斯算法对所述第二图像进行光照预处理,滤除所述第二图像的低频信息,保留所述第二图像的高频信息,得到高斯图像;对所述高斯图像进行图像直方图均衡化处理,得到灰度值均匀的图像;计算所述灰度值均匀的图像对应的特征向量,将计算得到的特征向量作为所述第二图像对应的特征向量。
- 根据权利要求1所述的方法,其特征在于,所述截取所述第二图像中的第一预设区域之后,所述方法还包括:对所述第一预设区域进行同态滤波处理;对经过同态滤波处理后的所述第一预设区域进行平滑滤波处理;对经过平滑滤波处理后的所述第一预设区域进行邻域最小值滤波处理;对经过邻域最小值滤波处理后的所述第一预设区域进行预设比例二值化处理,得到处理后的所述第二图像,所述计算所述第二图像对应的特征向量,包括:计算处理后的所述第二图像对应的特征向量。
- 根据权利要求1至4任一项所述的方法,其特征在于,所述根据所述第一预设区域中灰度值小于所述第一预设阈值的像素点的数量判断所述目标用户是否佩戴墨镜,包括:根据公式L=t1/t计算第一比例关系,L为所述第一比例关系,t1为所述第一预设区域中灰度值小于所述第一预设阈值的像素点的数量,t为所述第一预设区域中像素点的数量;如果所述第一比例关系L大于等于第二预设阈值,则确定所述目标用户佩戴墨镜;如果所述第一比例关系L小于所述第二预设阈值,则确定所述目标用户没有佩戴墨镜。
- 一种人脸识别装置,其特征在于,所述装置包括:采集单元,用于采集目标用户的图像,得到第一图像;提取单元,用于从所述第一图像中提取人脸区域,得到第二图像;截取单元,用于截取所述第二图像中的第一预设区域,所述第一预设区域为眼部区域;统计单元,用于统计所述第一预设区域中灰度值小于第一预设阈值的像素点的数量;第一判断单元,用于根据所述第一预设区域中灰度值小于所述第一预设阈值的像素点的数量判断所述目标用户是否佩戴墨镜;第一计算单元,用于如果判断出所述目标用户没有佩戴墨镜,则计算所述第 二图像对应的特征向量;获取单元,用于获取目标数据库中多个预设人脸图像对应的特征向量;第二计算单元,用于将所述第二图像对应的特征向量进行归一化处理,将所述多个预设人脸图像对应的特征向量分别进行归一化处理,计算归一化处理后的所述第二图像的特征向量与归一化处理后的所述多个预设人脸图像中每个预设人脸图像的特征向量之间的余弦相似度,根据计算得到的余弦相似度确定所述第二图像与所述多个预设人脸图像中每个预设人脸图像的相似度;第二判断单元,用于判断计算出的所有相似度是否均小于预设相似度阈值;第一输出单元,用于如果计算出的所有相似度均小于所述预设相似度阈值,则输出第一提示信息,所述第一提示信息用于提示所述目标用户验证失败;筛选单元,用于如果计算出的相似度中有至少一个大于或等于所述预设相似度阈值,则筛选出最大的相似度对应的预设人脸图像;确定单元,用于将最大的相似度对应的预设人脸图像相关联的用户作为候选用户;第二输出单元,用于输出第二提示信息,所述第二提示信息用于提示所述目标用户验证通过,并开启所述候选用户的用户权限。
- 根据权利要求6所述的装置,其特征在于,所述第二计算单元包括:第一计算子单元,用于将所述第二图像对应的特征向量进行归一化处理,再进行转置处理后得到的向量作为第一向量,所述第一向量为1行m列的矩阵,m为所述第二图像对应的特征向量的维度;第二计算子单元,用于将n个预设人脸图像对应的特征向量分别进行归一化处理后得到的特征向量作为第二向量,所述第二向量为m行1列的矩阵,第二向量有n个,n为预设人脸图像的数量;排列子单元,用于将n个所述第二向量排列成第一矩阵,其中,所述第一矩阵为m行n列的矩阵;第三计算子单元,用于将所述第一向量与所述第一矩阵作矩阵乘法,得到第二向量,其中,所述第二向量为1行n列的矩阵,所述第二向量的第k个元素为所述第二图像对应的特征向量与第k个预设人脸图像对应的特征向量之间的余弦相似度,1≤k≤n。
- 根据权利要求6所述的装置,其特征在于,所述第一计算单元包括:第一处理子单元,用于利用差分高斯算法对所述第二图像进行光照预处理,滤除所述第二图像的低频信息,保留所述第二图像的高频信息,得到高斯图像;第二处理子单元,用于对所述高斯图像进行图像直方图均衡化处理,得到灰度值均匀的图像;第四计算子单元,用于计算所述灰度值均匀的图像对应的特征向量,将计算得到的特征向量作为所述第二图像对应的特征向量。
- 根据权利要求6所述的装置,其特征在于,所述装置还包括:第一处理单元,用于所述截取单元截取所述第二图像中的第一预设区域之后,对所述第一预设区域进行同态滤波处理;第二处理单元,用于对经过同态滤波处理后的所述第一预设区域进行平滑滤波处理;第三处理单元,用于对经过平滑滤波处理后的所述第一预设区域进行邻域最小值滤波处理;第四处理单元,用于对经过邻域最小值滤波处理后的所述第一预设区域进行预设比例二值化处理,得到处理后的所述第二图像,所述第一计算单元包括:第五计算子单元,用于计算处理后的所述第二图像对应的特征向量。
- 根据权利要求6至9任一项所述的装置,其特征在于,所述第一判断单元包括:第六计算子单元,用于根据公式L=t1/t计算第一比例关系,L为所述第一比例关系,t1为所述第一预设区域中灰度值小于所述第一预设阈值的像素点的数量, t为所述第一预设区域中像素点的数量;第一确定子单元,用于如果所述第一比例关系L大于等于第二预设阈值,则确定所述目标用户佩戴墨镜;第二确定子单元,用于如果所述第一比例关系L小于所述第二预设阈值,则确定所述目标用户没有佩戴墨镜。
- 一种计算机设备,包括存储器和处理器,所述存储器用于存储包括程序指令的信息,所述处理器用于控制所述程序指令的执行,其特征在于,所述程序指令被所述处理器加载并执行时实现以下步骤:采集目标用户的图像,得到第一图像;从所述第一图像中提取人脸区域,得到第二图像;截取所述第二图像中的第一预设区域,所述第一预设区域为眼部区域;统计所述第一预设区域中灰度值小于第一预设阈值的像素点的数量;根据所述第一预设区域中灰度值小于所述第一预设阈值的像素点的数量判断所述目标用户是否佩戴墨镜;如果判断出所述目标用户没有佩戴墨镜,则计算所述第二图像对应的特征向量;获取目标数据库中多个预设人脸图像对应的特征向量;将所述第二图像对应的特征向量进行归一化处理,将所述多个预设人脸图像对应的特征向量分别进行归一化处理,计算归一化处理后的所述第二图像的特征向量与归一化处理后的所述多个预设人脸图像中每个预设人脸图像的特征向量之间的余弦相似度,根据计算得到的余弦相似度确定所述第二图像与所述多个预设人脸图像中每个预设人脸图像的相似度;判断计算出的所有相似度是否均小于预设相似度阈值;如果计算出的所有相似度均小于所述预设相似度阈值,则输出第一提示信息, 所述第一提示信息用于提示所述目标用户验证失败;如果计算出的相似度中有至少一个大于或等于所述预设相似度阈值,则筛选出最大的相似度对应的预设人脸图像;将最大的相似度对应的预设人脸图像相关联的用户作为候选用户;输出第二提示信息,所述第二提示信息用于提示所述目标用户验证通过,并开启所述候选用户的用户权限。
- 根据权利要求11所述的计算机设备,其特征在于,所述程序指令被所述处理器加载并执行时还实现以下步骤:将所述第二图像对应的特征向量进行归一化处理,再进行转置处理后得到的向量作为第一向量,所述第一向量为1行m列的矩阵,m为所述第二图像对应的特征向量的维度;将n个预设人脸图像对应的特征向量分别进行归一化处理后得到的特征向量作为第二向量,所述第二向量为m行1列的矩阵,第二向量有n个,n为预设人脸图像的数量;将n个所述第二向量排列成第一矩阵,其中,所述第一矩阵为m行n列的矩阵;将所述第一向量与所述第一矩阵作矩阵乘法,得到第二向量,其中,所述第二向量为1行n列的矩阵,所述第二向量的第k个元素为所述第二图像对应的特征向量与第k个预设人脸图像对应的特征向量之间的余弦相似度,1≤k≤n。
- 根据权利要求11所述的计算机设备,其特征在于,所述程序指令被所述处理器加载并执行时还实现以下步骤:利用差分高斯算法对所述第二图像进行光照预处理,滤除所述第二图像的低频信息,保留所述第二图像的高频信息,得到高斯图像;对所述高斯图像进行图像直方图均衡化处理,得到灰度值均匀的图像;计算所述灰度值均匀的图像对应的特征向量,将计算得到的特征向量作为所 述第二图像对应的特征向量。
- 根据权利要求11所述的计算机设备,其特征在于,所述程序指令被所述处理器加载并执行时还实现以下步骤:截取所述第二图像中的第一预设区域之后,对所述第一预设区域进行同态滤波处理;对经过同态滤波处理后的所述第一预设区域进行平滑滤波处理;对经过平滑滤波处理后的所述第一预设区域进行邻域最小值滤波处理;对经过邻域最小值滤波处理后的所述第一预设区域进行预设比例二值化处理,得到处理后的所述第二图像,计算处理后的所述第二图像对应的特征向量。
- 根据权利要求11至14任一项所述的计算机设备,其特征在于,所述程序指令被所述处理器加载并执行时还实现以下步骤:根据公式L=t1/t计算第一比例关系,L为所述第一比例关系,t1为所述第一预设区域中灰度值小于所述第一预设阈值的像素点的数量,t为所述第一预设区域中像素点的数量;如果所述第一比例关系L大于等于第二预设阈值,则确定所述目标用户佩戴墨镜;如果所述第一比例关系L小于所述第二预设阈值,则确定所述目标用户没有佩戴墨镜。
- 一种计算机非易失性可读存储介质,其特征在于,所述计算机非易失性可读存储介质包括存储的程序,其中,在所述程序运行时控制所述计算机非易失性可读存储介质所在设备执行以下步骤:采集目标用户的图像,得到第一图像;从所述第一图像中提取人脸区域,得到第二图像;截取所述第二图像中的第一预设区域,所述第一预设区域为眼部区域;统计所述第一预设区域中灰度值小于第一预设阈值的像素点的数量;根据所述第一预设区域中灰度值小于所述第一预设阈值的像素点的数量判断所述目标用户是否佩戴墨镜;如果判断出所述目标用户没有佩戴墨镜,则计算所述第二图像对应的特征向量;获取目标数据库中多个预设人脸图像对应的特征向量;将所述第二图像对应的特征向量进行归一化处理,将所述多个预设人脸图像对应的特征向量分别进行归一化处理,计算归一化处理后的所述第二图像的特征向量与归一化处理后的所述多个预设人脸图像中每个预设人脸图像的特征向量之间的余弦相似度,根据计算得到的余弦相似度确定所述第二图像与所述多个预设人脸图像中每个预设人脸图像的相似度;判断计算出的所有相似度是否均小于预设相似度阈值;如果计算出的所有相似度均小于所述预设相似度阈值,则输出第一提示信息,所述第一提示信息用于提示所述目标用户验证失败;如果计算出的相似度中有至少一个大于或等于所述预设相似度阈值,则筛选出最大的相似度对应的预设人脸图像;将最大的相似度对应的预设人脸图像相关联的用户作为候选用户;输出第二提示信息,所述第二提示信息用于提示所述目标用户验证通过,并开启所述候选用户的用户权限。
- 根据权利要求16所述的计算机非易失性可读存储介质,其特征在于,在所述程序运行时控制所述计算机非易失性可读存储介质所在设备还执行以下步骤:将所述第二图像对应的特征向量进行归一化处理,再进行转置处理后得到的向量作为第一向量,所述第一向量为1行m列的矩阵,m为所述第二图像对应的特征向量的维度;将n个预设人脸图像对应的特征向量分别进行归一化处理后得到的特征向量作为第二向量,所述第二向量为m行1列的矩阵,第二向量有n个,n为预设人脸图像的数量;将n个所述第二向量排列成第一矩阵,其中,所述第一矩阵为m行n列的矩阵;将所述第一向量与所述第一矩阵作矩阵乘法,得到第二向量,其中,所述第二向量为1行n列的矩阵,所述第二向量的第k个元素为所述第二图像对应的特征向量与第k个预设人脸图像对应的特征向量之间的余弦相似度,1≤k≤n。
- 根据权利要求16所述的计算机非易失性可读存储介质,其特征在于,在所述程序运行时控制所述计算机非易失性可读存储介质所在设备还执行以下步骤:利用差分高斯算法对所述第二图像进行光照预处理,滤除所述第二图像的低频信息,保留所述第二图像的高频信息,得到高斯图像;对所述高斯图像进行图像直方图均衡化处理,得到灰度值均匀的图像;计算所述灰度值均匀的图像对应的特征向量,将计算得到的特征向量作为所述第二图像对应的特征向量。
- 根据权利要求16所述的计算机非易失性可读存储介质,其特征在于,在所述程序运行时控制所述计算机非易失性可读存储介质所在设备还执行以下步骤:截取所述第二图像中的第一预设区域之后,对所述第一预设区域进行同态滤波处理;对经过同态滤波处理后的所述第一预设区域进行平滑滤波处理;对经过平滑滤波处理后的所述第一预设区域进行邻域最小值滤波处理;对经过邻域最小值滤波处理后的所述第一预设区域进行预设比例二值化处理,得到处理后的所述第二图像,计算处理后的所述第二图像对应的特征向量。
- 根据权利要求16至19任一项所述的计算机非易失性可读存储介质,其特征在于,在所述程序运行时控制所述计算机非易失性可读存储介质所在设备还执行以下步骤:根据公式L=t1/t计算第一比例关系,L为所述第一比例关系,t1为所述第一预设区域中灰度值小于所述第一预设阈值的像素点的数量,t为所述第一预设区域中像素点的数量;如果所述第一比例关系L大于等于第二预设阈值,则确定所述目标用户佩戴墨镜;如果所述第一比例关系L小于所述第二预设阈值,则确定所述目标用户没有佩戴墨镜。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910039146.XA CN109657652A (zh) | 2019-01-16 | 2019-01-16 | 一种人脸识别方法和装置 |
| CN201910039146.X | 2019-01-16 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2020147257A1 true WO2020147257A1 (zh) | 2020-07-23 |
Family
ID=66120067
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2019/091099 Ceased WO2020147257A1 (zh) | 2019-01-16 | 2019-06-13 | 一种人脸识别方法和装置 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN109657652A (zh) |
| WO (1) | WO2020147257A1 (zh) |
Cited By (18)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112183480A (zh) * | 2020-10-29 | 2021-01-05 | 深圳奥比中光科技有限公司 | 一种人脸识别方法、装置、终端设备及存储介质 |
| CN112215822A (zh) * | 2020-10-13 | 2021-01-12 | 北京中电兴发科技有限公司 | 一种基于轻量级回归网络的人脸图像质量评估方法 |
| CN112434578A (zh) * | 2020-11-13 | 2021-03-02 | 浙江大华技术股份有限公司 | 口罩佩戴规范性检测方法、装置、计算机设备和存储介质 |
| CN113033373A (zh) * | 2021-03-19 | 2021-06-25 | 北京百度网讯科技有限公司 | 用于训练人脸识别模型及识别人脸的方法及相关装置 |
| CN113239218A (zh) * | 2021-05-14 | 2021-08-10 | 南京甄视智能科技有限公司 | 在具有npu的设备上并发执行人脸搜索的方法 |
| CN113505765A (zh) * | 2021-09-09 | 2021-10-15 | 北京轻松筹信息技术有限公司 | 基于用户头像的年龄预测方法、装置及电子设备 |
| CN114373209A (zh) * | 2021-12-30 | 2022-04-19 | 深圳云天励飞技术股份有限公司 | 基于视频的人脸识别方法、装置、电子设备及存储介质 |
| CN114445892A (zh) * | 2022-01-27 | 2022-05-06 | 北京百度网讯科技有限公司 | 图像检测方法和装置 |
| CN114817986A (zh) * | 2022-04-24 | 2022-07-29 | 海信集团控股股份有限公司 | 一种保护人脸图像隐私的方法及电子设备 |
| CN114972995A (zh) * | 2022-05-30 | 2022-08-30 | 首钢京唐钢铁联合有限责任公司 | 一种横切剪异物识别方法、控制器、介质及设备 |
| CN115240234A (zh) * | 2022-08-31 | 2022-10-25 | 海宁奕斯伟集成电路设计有限公司 | 身份验证装置及方法 |
| CN115880761A (zh) * | 2023-02-09 | 2023-03-31 | 数据空间研究院 | 基于策略优化的人脸识别方法、系统、存储介质及应用 |
| CN115909434A (zh) * | 2022-09-07 | 2023-04-04 | 以萨技术股份有限公司 | 一种获取人脸图像特征的数据处理系统 |
| CN116012928A (zh) * | 2023-02-16 | 2023-04-25 | 平安壹钱包电子商务有限公司 | 基于图像处理的身份验证方法及装置、介质、计算机设备 |
| CN116383423A (zh) * | 2022-12-30 | 2023-07-04 | 深圳云天励飞技术股份有限公司 | 图像检索结果的重排方法、装置、计算机设备及介质 |
| CN116453173A (zh) * | 2022-12-16 | 2023-07-18 | 南京奥看信息科技有限公司 | 一种基于图片区域分割技术的图片处理方法 |
| CN117113321A (zh) * | 2023-09-04 | 2023-11-24 | 北京锐融天下科技股份有限公司 | 一种以脸搜脸的图像搜索方法及系统 |
| CN118155269A (zh) * | 2024-05-09 | 2024-06-07 | 深圳聚瑞云控科技有限公司 | 一种门禁控制智能识别系统 |
Families Citing this family (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110516656A (zh) * | 2019-09-04 | 2019-11-29 | 上海眼控科技股份有限公司 | 视频监控方法、装置、计算机设备和可读存储介质 |
| CN111179880A (zh) * | 2019-12-26 | 2020-05-19 | 恒大新能源汽车科技(广东)有限公司 | 一种显示屏幕的亮度调节方法、装置、电子设备及系统 |
| CN111507293A (zh) * | 2020-04-22 | 2020-08-07 | 浙江工业大学 | 基于图卷积模型的信号分类方法 |
| CN111310743B (zh) * | 2020-05-11 | 2020-08-25 | 腾讯科技(深圳)有限公司 | 人脸识别方法、装置、电子设备及可读存储介质 |
| CN112633199A (zh) * | 2020-12-29 | 2021-04-09 | 深圳市子瑜杰恩科技有限公司 | 智慧园区的安全防护方法、装置及存储介质 |
| CN116188805B (zh) * | 2023-04-26 | 2023-08-04 | 青岛尘元科技信息有限公司 | 海量图像的图像内容分析方法、装置和图像信息网络 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105320921A (zh) * | 2014-07-31 | 2016-02-10 | 腾讯科技(深圳)有限公司 | 双眼定位方法及双眼定位装置 |
| US20160110586A1 (en) * | 2014-10-15 | 2016-04-21 | Nec Corporation | Image recognition apparatus, image recognition method and computer-readable medium |
| CN107622243A (zh) * | 2017-09-21 | 2018-01-23 | 广东欧珀移动通信有限公司 | 解锁控制方法及相关产品 |
| CN108460319A (zh) * | 2017-02-22 | 2018-08-28 | 浙江宇视科技有限公司 | 异常人脸检测方法及装置 |
| CN108985232A (zh) * | 2018-07-18 | 2018-12-11 | 平安科技(深圳)有限公司 | 人脸图像比对方法、装置、计算机设备及存储介质 |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103093210B (zh) * | 2013-01-24 | 2017-02-08 | 北京天诚盛业科技有限公司 | 人脸识别中眼镜的鉴别方法及装置 |
| CN103745235B (zh) * | 2013-12-18 | 2017-07-04 | 小米科技有限责任公司 | 人脸识别方法、装置及终端设备 |
| CN109214273A (zh) * | 2018-07-18 | 2019-01-15 | 平安科技(深圳)有限公司 | 人脸图像比对方法、装置、计算机设备及存储介质 |
-
2019
- 2019-01-16 CN CN201910039146.XA patent/CN109657652A/zh active Pending
- 2019-06-13 WO PCT/CN2019/091099 patent/WO2020147257A1/zh not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105320921A (zh) * | 2014-07-31 | 2016-02-10 | 腾讯科技(深圳)有限公司 | 双眼定位方法及双眼定位装置 |
| US20160110586A1 (en) * | 2014-10-15 | 2016-04-21 | Nec Corporation | Image recognition apparatus, image recognition method and computer-readable medium |
| CN108460319A (zh) * | 2017-02-22 | 2018-08-28 | 浙江宇视科技有限公司 | 异常人脸检测方法及装置 |
| CN107622243A (zh) * | 2017-09-21 | 2018-01-23 | 广东欧珀移动通信有限公司 | 解锁控制方法及相关产品 |
| CN108985232A (zh) * | 2018-07-18 | 2018-12-11 | 平安科技(深圳)有限公司 | 人脸图像比对方法、装置、计算机设备及存储介质 |
Cited By (25)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112215822A (zh) * | 2020-10-13 | 2021-01-12 | 北京中电兴发科技有限公司 | 一种基于轻量级回归网络的人脸图像质量评估方法 |
| CN112215822B (zh) * | 2020-10-13 | 2023-04-07 | 北京中电兴发科技有限公司 | 一种基于轻量级回归网络的人脸图像质量评估方法 |
| CN112183480B (zh) * | 2020-10-29 | 2024-06-04 | 奥比中光科技集团股份有限公司 | 一种人脸识别方法、装置、终端设备及存储介质 |
| CN112183480A (zh) * | 2020-10-29 | 2021-01-05 | 深圳奥比中光科技有限公司 | 一种人脸识别方法、装置、终端设备及存储介质 |
| CN112434578A (zh) * | 2020-11-13 | 2021-03-02 | 浙江大华技术股份有限公司 | 口罩佩戴规范性检测方法、装置、计算机设备和存储介质 |
| CN112434578B (zh) * | 2020-11-13 | 2023-07-25 | 浙江大华技术股份有限公司 | 口罩佩戴规范性检测方法、装置、计算机设备和存储介质 |
| CN113033373A (zh) * | 2021-03-19 | 2021-06-25 | 北京百度网讯科技有限公司 | 用于训练人脸识别模型及识别人脸的方法及相关装置 |
| CN113239218B (zh) * | 2021-05-14 | 2022-08-23 | 南京甄视智能科技有限公司 | 在具有npu的设备上并发执行人脸搜索的方法 |
| CN113239218A (zh) * | 2021-05-14 | 2021-08-10 | 南京甄视智能科技有限公司 | 在具有npu的设备上并发执行人脸搜索的方法 |
| CN113505765B (zh) * | 2021-09-09 | 2022-02-08 | 北京轻松筹信息技术有限公司 | 基于用户头像的年龄预测方法、装置及电子设备 |
| CN113505765A (zh) * | 2021-09-09 | 2021-10-15 | 北京轻松筹信息技术有限公司 | 基于用户头像的年龄预测方法、装置及电子设备 |
| CN114373209A (zh) * | 2021-12-30 | 2022-04-19 | 深圳云天励飞技术股份有限公司 | 基于视频的人脸识别方法、装置、电子设备及存储介质 |
| CN114445892A (zh) * | 2022-01-27 | 2022-05-06 | 北京百度网讯科技有限公司 | 图像检测方法和装置 |
| CN114817986A (zh) * | 2022-04-24 | 2022-07-29 | 海信集团控股股份有限公司 | 一种保护人脸图像隐私的方法及电子设备 |
| CN114972995A (zh) * | 2022-05-30 | 2022-08-30 | 首钢京唐钢铁联合有限责任公司 | 一种横切剪异物识别方法、控制器、介质及设备 |
| CN115240234A (zh) * | 2022-08-31 | 2022-10-25 | 海宁奕斯伟集成电路设计有限公司 | 身份验证装置及方法 |
| CN115909434A (zh) * | 2022-09-07 | 2023-04-04 | 以萨技术股份有限公司 | 一种获取人脸图像特征的数据处理系统 |
| CN116453173A (zh) * | 2022-12-16 | 2023-07-18 | 南京奥看信息科技有限公司 | 一种基于图片区域分割技术的图片处理方法 |
| CN116453173B (zh) * | 2022-12-16 | 2023-09-08 | 南京奥看信息科技有限公司 | 一种基于图片区域分割技术的图片处理方法 |
| CN116383423A (zh) * | 2022-12-30 | 2023-07-04 | 深圳云天励飞技术股份有限公司 | 图像检索结果的重排方法、装置、计算机设备及介质 |
| CN115880761A (zh) * | 2023-02-09 | 2023-03-31 | 数据空间研究院 | 基于策略优化的人脸识别方法、系统、存储介质及应用 |
| CN116012928A (zh) * | 2023-02-16 | 2023-04-25 | 平安壹钱包电子商务有限公司 | 基于图像处理的身份验证方法及装置、介质、计算机设备 |
| CN117113321A (zh) * | 2023-09-04 | 2023-11-24 | 北京锐融天下科技股份有限公司 | 一种以脸搜脸的图像搜索方法及系统 |
| CN117113321B (zh) * | 2023-09-04 | 2024-01-30 | 北京锐融天下科技股份有限公司 | 一种以脸搜脸的图像搜索方法及系统 |
| CN118155269A (zh) * | 2024-05-09 | 2024-06-07 | 深圳聚瑞云控科技有限公司 | 一种门禁控制智能识别系统 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN109657652A (zh) | 2019-04-19 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2020147257A1 (zh) | 一种人脸识别方法和装置 | |
| CN110084135B (zh) | 人脸识别方法、装置、计算机设备及存储介质 | |
| CN103116763B (zh) | 一种基于hsv颜色空间统计特征的活体人脸检测方法 | |
| Lee et al. | Preprocessing of a fingerprint image captured with a mobile camera | |
| WO2021004402A1 (zh) | 图像识别方法及装置、存储介质和处理器 | |
| WO2020094091A1 (zh) | 一种图像抓拍方法、监控相机及监控系统 | |
| CN106250821A (zh) | 一种聚类再分类的人脸识别方法 | |
| Qing et al. | Automated detection and identification of white-backed planthoppers in paddy fields using image processing | |
| WO2020143325A1 (zh) | 一种电子文档的生成方法及设备 | |
| CN111144366A (zh) | 一种基于联合人脸质量评估的陌生人脸聚类方法 | |
| CN107293011B (zh) | 一种智能家居的门禁系统 | |
| CN110909636B (zh) | 一种基于非均匀分布的人脸识别方法 | |
| WO2020155764A1 (zh) | 掌纹提取方法、装置及存储介质、服务器 | |
| CN106909884B (zh) | 一种基于分层结构和可变形部分模型的手部区域检测方法和装置 | |
| CN107273783A (zh) | 人脸识别系统及其方法 | |
| CN114511893B (zh) | 一种卷积神经网络的训练方法、人脸识别方法及装置 | |
| WO2024077785A1 (zh) | 基于卷积神经网络模型的图像识别方法、装置及终端设备 | |
| Li et al. | Quality assessment for fingerprints collected by smartphone cameras | |
| CN103927518A (zh) | 一种用于人脸分析系统的人脸特征提取方法 | |
| CN105631285A (zh) | 一种生物特征身份识别方法及装置 | |
| CN113159037B (zh) | 图片矫正方法、装置、计算机设备及存储介质 | |
| CN111708907B (zh) | 一种目标人员的查询方法、装置、设备及存储介质 | |
| CN111709305A (zh) | 一种基于局部图像块的人脸年龄识别方法 | |
| CN105139019B (zh) | 虹膜图像筛选的方法及装置 | |
| CN112085683A (zh) | 一种显著性检测中的深度图可信度检测方法 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 19910308 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS (EPO FORM 1205A DATED 07.09.2021) |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 19910308 Country of ref document: EP Kind code of ref document: A1 |