WO2019128362A1 - Human facial recognition method, apparatus and system, and medium - Google Patents

Human facial recognition method, apparatus and system, and medium Download PDF

Info

Publication number
WO2019128362A1
WO2019128362A1 PCT/CN2018/108994 CN2018108994W WO2019128362A1 WO 2019128362 A1 WO2019128362 A1 WO 2019128362A1 CN 2018108994 W CN2018108994 W CN 2018108994W WO 2019128362 A1 WO2019128362 A1 WO 2019128362A1
Authority
WO
WIPO (PCT)
Prior art keywords
grayscale
face
light source
image frame
face image
Prior art date
Application number
PCT/CN2018/108994
Other languages
French (fr)
Chinese (zh)
Inventor
冯玉娜
Original Assignee
北京京东尚科信息技术有限公司
北京京东世纪贸易有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 北京京东尚科信息技术有限公司, 北京京东世纪贸易有限公司 filed Critical 北京京东尚科信息技术有限公司
Publication of WO2019128362A1 publication Critical patent/WO2019128362A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/161Detection; Localisation; Normalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation

Definitions

  • the present disclosure relates to the field of Internet technologies, and in particular, to a face recognition method, apparatus, system, and medium.
  • Face recognition has always been a hot research in the field of biometrics. Visible face recognition is easily affected by external lighting conditions, which may result in inaccurate face recognition. Although the near-infrared technology is not affected by the influence of ambient light, the application of the device is limited, and the recognition method is contrary to people's daily life habits.
  • there are some recognition methods combining visible light recognition and near-infrared light recognition mainly including a visible-near-infrared face recognition method based on face synthesis, and a visible-near-infrared face recognition method based on unified subspace. And a visible-near-infrared face recognition method based on invariant features,
  • the recognition method combining visible light recognition and near-infrared recognition is generally a face obtained under registration of a light source condition. Library. When identifying the authentication, when the face image is collected, the light source environment at the time of the acquisition is inconsistent with the registration time, and the collected face image processing needs to be converted and compared, and the essence is the face recognition under the different quality light sources.
  • the present disclosure provides a face recognition method, apparatus, system, and medium that can achieve face image comparison under a homogeneous light source.
  • the method includes acquiring a face image and performing face recognition according to a light source environment in which the face image is collected.
  • Performing face recognition according to the light source environment in which the face image is collected specifically includes: when the light source environment in which the face image is collected is visible light, the face image is in visible light condition The registered face map is compared and recognized; or, in the case where the light source environment in which the face image is collected is near-infrared light, the face image and the face map registered under the near-infrared light condition are registered. Perform alignment recognition.
  • the method further includes determining whether the light source environment in which the face image is acquired is visible light or near-infrared light.
  • acquiring a face image specifically includes acquiring a complete image frame including a face and a background environment, acquiring a face region from the complete image frame, and extracting the face image from the face region. . Determining whether the light source environment in which the face image is collected is visible light or near-infrared light, including graying out the complete image frame, obtaining a gray image frame, and judging according to the distribution of gray scales in the gray image frame
  • the light source environment in which the face image is acquired is visible light or near-infrared light.
  • determining, according to the distribution of gray scales in the grayscale image frame, whether the light source environment in which the face image is captured is visible light or near-infrared light includes the following operation process; calculating the grayscale image frame a first pixel number of the gray scale value in the initial closed interval, wherein one end point of the initial closed interval is a gray level minimum value of the gray image frame, and the other end point is the gray level minimum value And adding a preset value; calculating a second pixel number of the grayscale value in the grayscale image frame in the termination closed interval, wherein one end point of the termination closed interval is a grayscale maximum value of the grayscale image frame Subtracting the preset value, another endpoint is the grayscale maximum value; calculating a grayscale average value of the region other than the face region in the grayscale image frame; when the first pixel number is greater than When the second pixel number is less than the preset grayscale mean value, determining that the light source environment in which the face image is collected is near-in
  • the preset value includes 15.
  • the preset grayscale mean comprises 140.
  • the method further includes separately registering the face map under visible light conditions and near-infrared light conditions.
  • the device includes an acquisition module and an identification module.
  • the acquisition module is used to acquire a face image.
  • the identification module is configured to perform face recognition according to a light source environment in which the face image is collected.
  • the identification module is specifically configured to compare the face image with a face image registered under visible light conditions when the light source environment in which the face image is collected is visible light; or, in the collection center In the case where the light source environment in which the face image is located is near-infrared light, the face image is compared with the face map registered under the near-infrared light condition.
  • the apparatus further includes a light source determination module.
  • the light source determining module is configured to determine whether the light source environment in which the face image is collected is visible light or near-infrared light.
  • the acquisition module includes a complete image frame acquisition sub-module, a face region acquisition sub-module, and a face image extraction sub-module.
  • the complete image frame acquisition sub-module is used to acquire a complete image frame including a face and a background environment.
  • the face region acquisition sub-module is configured to acquire a face region from the complete image frame.
  • a face image extraction sub-module for extracting the face image from the face region.
  • the light source judging module includes a grayscale submodule and a light source judging submodule. Wherein, the grayscale sub-module is used to grayscale the complete image frame to obtain a grayscale image frame.
  • the light source determining sub-module is configured to determine, according to the distribution of gray scales in the grayscale image frame, whether the light source environment in which the face image is collected is visible light or near-infrared light.
  • determining, according to the distribution of gray scales in the grayscale image frame, whether the light source environment in which the face image is captured is visible light or near-infrared light comprises: calculating gray in the grayscale image frame a first number of pixels in the initial closed interval, wherein one end of the initial closed interval is a grayscale minimum of the grayscale image frame, and the other endpoint is the grayscale minimum plus a preset value; calculating a second pixel number of the grayscale value in the grayscale image frame in the termination closed interval, wherein one end point of the termination closed interval is a grayscale maximum value of the grayscale image frame minus The preset value, another endpoint is the grayscale maximum value; calculating a grayscale average value in the region other than the face region in the grayscale image frame; and when the first pixel number is greater than When the second pixel number is less than the preset grayscale mean value, determining that the light source environment in which the face image is collected is near-infrared light, otherwise determining the location
  • the preset value includes 15.
  • the preset grayscale mean comprises 140.
  • the apparatus further includes a registration module.
  • the registration module is configured to separately register a face map under visible light conditions and near-infrared light conditions.
  • Another aspect of the present disclosure provides a system for face recognition including one or more processors, and a memory.
  • the memory is used to store one or more programs. Wherein, when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the methods described above.
  • Another aspect of the present disclosure provides a computer readable medium having stored thereon executable instructions that, when executed by a processor, cause a processor to implement the methods described above.
  • Another aspect of the disclosure provides a computer program comprising computer executable instructions that, when executed, are used to implement a method as described above.
  • the recognition error caused by the excessive difference of the face image under different quality light sources can be at least partially avoided, and thus the face recognition of the person under the homogenous light source can be realized, thereby improving the accuracy of the face recognition.
  • FIG. 1 schematically illustrates an exemplary architecture of a face recognition method and apparatus according to an embodiment of the present disclosure
  • FIG. 2 schematically shows a flowchart of a face recognition method according to an embodiment of the present disclosure
  • FIG. 3 schematically shows a flowchart of a face recognition method according to another embodiment of the present disclosure
  • FIG. 4 schematically shows a flowchart of a face recognition method according to still another embodiment of the present disclosure
  • 5A and 5B respectively schematically illustrate gray scale distributions in grayscale image frames corresponding to images acquired in visible light and near-infrared light environments
  • FIG. 6 is a flow chart schematically illustrating determining a light source environment when a face image is acquired according to a gray scale distribution according to another embodiment of the present disclosure
  • FIG. 7 is a schematic diagram showing an application scenario of a face recognition method according to various embodiments of the present disclosure.
  • FIG. 8 is a block diagram schematically showing a face recognition device according to an embodiment of the present disclosure.
  • FIG. 9 schematically illustrates a block diagram of a computer system suitable for implementing a robot in accordance with an embodiment of the present disclosure.
  • Embodiments of the present disclosure provide a face recognition method, apparatus, system, and medium.
  • the method includes acquiring a face image and performing face recognition according to a light source environment in which the face image is collected.
  • Performing face recognition according to the light source environment in which the face image is collected specifically includes: when the light source environment in which the face image is collected is visible light, the face image is registered with the person under visible light conditions The face image is compared and recognized; or, when the light source environment in which the face image is collected is near-infrared light, the face image is compared with the face image registered under the near-infrared light condition.
  • FIG. 1 schematically illustrates an exemplary architecture 100 of a face recognition method and apparatus in accordance with an embodiment of the present disclosure. It should be noted that FIG. 1 is only an example of a system architecture to which the embodiments of the present disclosure may be applied, to help those skilled in the art understand the technical content of the present disclosure, but does not mean that the embodiments of the present disclosure may not be used for other Device, system, environment, or scenario.
  • the system architecture 100 may include a camera 101, a network 102, and a server 103.
  • the network 102 is used to provide a medium for communication links between the camera 101 and the server 103.
  • Network 102 can include a variety of connection types, such as wired, wireless communication links, fiber optic cables, and the like.
  • the camera 101 can collect a face image and transmit the obtained face image to the server 103 via the network 102.
  • the server 103 may be a server that provides various services, such as processing for analyzing data such as receiving a face image.
  • the terminal device 104 may also be included in the system architecture 100.
  • a face image collected by the camera 101 or other cameras can be stored in the terminal device 104.
  • the terminal device 104 can transmit the face image stored therein to the server 105 through the network 102 according to the user's operation, to request the server 105 to perform the identification authentication.
  • the server 105 can process according to the user request and feed back the processing result to the terminal device 104.
  • the terminal device 104 can be a variety of electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop portable computers, desktop computers, and the like.
  • the terminal device 104 and the camera 101 can be combined or the camera 101 can be an integral part of the terminal device 104.
  • the face recognition method provided by the embodiment of the present disclosure may be generally performed by the server 103.
  • the face recognition device provided by the embodiment of the present disclosure may be generally disposed in the server 103.
  • the face recognition method provided by the embodiments of the present disclosure may also be performed by a server or server cluster different from the server 103 and capable of communicating with the server 103.
  • the face recognition device provided by the embodiment of the present disclosure may also be disposed in a server or server cluster different from the server 103 and capable of communicating with the server 103.
  • terminal devices, networks, and servers in Figure 1 is merely illustrative. Depending on the implementation needs, there can be any number of terminal devices, networks, and servers.
  • FIG. 2 schematically illustrates a flow chart of a face recognition method in accordance with an embodiment of the present disclosure.
  • the face recognition method includes an operation S210 and an operation S220.
  • a face image acquired by the camera in real time can be acquired.
  • the face image acquired by the camera acquisition can be obtained from a network or other image storage location or the like.
  • face recognition is performed according to the light source environment in which the face image is collected.
  • the operation S220 performs face recognition according to the light source environment in which the face image is collected, and includes: when the light source environment where the face image is collected is visible light, the face image and the visible light condition The registered face image is compared and recognized; or, when the light source environment in which the face image is collected is near-infrared light, the face image and the face map registered under the near-infrared light condition are performed. Alignment identification.
  • face recognition under a homogenous light source may be performed according to a light source environment in which the face image is collected, and the face image to be recognized is homogenous with the face database.
  • the face maps under the light source are compared, and the recognition error caused by the excessive difference of the face images under different quality light sources is avoided to some extent, and the accuracy of face recognition is improved.
  • FIG. 3 schematically shows a flowchart of a face recognition method according to another embodiment of the present disclosure.
  • the face recognition method further includes an operation S310 in addition to the operations S210 and S220.
  • the operation S310 may be before the operation S220, or the operation S310 may be performed in parallel with the operation S220.
  • operation S310 it is determined whether the light source environment in which the face image is collected is visible light or near-infrared light.
  • the light source environment in which the face image is collected may be determined, so that the face image to be recognized may be compared with the face image under the homogenous light source in the face database to achieve homogeneity. Face recognition under the light source.
  • FIG. 4 schematically illustrates a flow chart of a face recognition method according to still another embodiment of the present disclosure.
  • the face recognition method includes an operation S210, an operation S310, and an operation S220.
  • the operation S210 includes operations S211 to S213, and operation S310 includes operations S311 and S312.
  • acquiring the face image in operation S210 may include operations S211 to S213.
  • a full image frame containing the background environment surrounding the face and face is acquired in real time by the camera.
  • the dedicated camera may be fixed to a complete image frame containing the face collected in a direction of 0.5 degrees upward from the shooting face level of 0.5 m-0.8 m.
  • a complete image frame containing a human face captured by the camera can be obtained from other locations, such as the network.
  • a face area is acquired from the complete image frame in operation S212.
  • the face detection is performed using the Adaboost algorithm to obtain a face region.
  • the face image is extracted from the face region in operation S213.
  • the face image is extracted from a face region using the Adaboost algorithm.
  • operation S310 determines whether the light source environment in which the face image is collected is visible light or near-infrared light, and may include operations S311 and S312.
  • the complete image frame is grayed out to obtain a grayscale image frame.
  • operation S312 it is determined whether the light source environment when collecting the face image is visible light or near-infrared light according to the distribution of gray scales in the grayscale image frame.
  • FIG. 5A and 5B schematically illustrate gray scale distributions in grayscale image frames corresponding to images acquired in visible light and near-infrared light environments, respectively.
  • FIG. 5A shows the gray scale distribution in the grayscale image frame obtained by the grayscale processing of the complete image frame acquired by the visible light source according to the experiment.
  • FIG. 5B shows the gray scale distribution in the grayscale image frame obtained by the grayscale processing of the complete image frame acquired by the near-infrared light source obtained according to the experiment.
  • Gray begin refers to the grayscale minimum in the grayscale image frame.
  • Gray end refers to the grayscale maximum in the grayscale image frame.
  • 5A and 5B illustrate the number of pixels corresponding to respective grayscale values in the range of the minimum value to the maximum value of the grayscale value in the grayscale image frame.
  • the grayscale image frame can be scanned line by line, and the number of pixels corresponding to each grayscale value is counted, for example, labeled as N0, N1, ..., N255, and the minimum grayscale value of the mark is Gray begin , and the grayscale of the maximum is terminated.
  • the value is Gray end .
  • the grayscale image frame obtained by the complete image frame acquired under the visible light source has a grayscale value near the Gray end .
  • the grayscale image of the gray image frame obtained by the complete image frame acquired under the near-infrared light source has a larger number of pixels near the gray begin .
  • FIG. 6 is a flow chart schematically showing a light source environment when a face image is acquired according to a gray scale distribution in operation S312 according to another embodiment of the present disclosure.
  • operation S312 includes operations S3121 to S3124.
  • a grayscale average value of the region other than the face region in the grayscale image frame is calculated, for example, marked as Gray Ave.
  • the preset value includes 15. It will be appreciated that the preset values may vary in particular different embodiments.
  • the preset grayscale mean comprises 140.
  • FIG. 7 schematically illustrates an application scenario diagram of a face recognition method according to various embodiments of the present disclosure.
  • the specific application scenario may be as shown in FIG. 7, and the face image may be acquired in operation S210.
  • a complete image frame containing a face may be acquired by a dedicated camera in operation S211, and the type of the light source that collects the face image is unknown at this time.
  • the face area obtained by the Adaboost face detection is performed on the complete image frame in operation S212.
  • the face image is then extracted from the face region in operation S213.
  • the complete image frame is grayed out in operation S311 to obtain a corresponding grayscale image frame.
  • the amount of pixels corresponding to each grayscale value in the grayscale image frame may be scanned line by line, for example, labeled as N0, N1, ..., N255, respectively, and the minimum grayscale value of the marker is Gray begin , and the grayscale of the termination is maximum.
  • the preset value may take a value of 15, and the preset grayscale mean may take a value of 140.
  • the gradation mean Gray Ave of the region other than the face region in the grayscale image frame is calculated.
  • face recognition is performed according to the light source environment in which the face image is collected.
  • the feature extraction is performed on the face image obtained in operation S210, and compared with the face map under the homogeneous light source type, and the consistency between the light source condition at the time of registration and the light source environment at the time of authentication is realized.
  • the face recognition method further includes separately registering a face map under visible light conditions and near-infrared light conditions.
  • the consistency of the face map (including the expression, the position of the acquired position, etc.) obtained by registration under visible light and near-infrared conditions can be ensured, and the error caused by the recognition process due to the difference of the registered image can be reduced.
  • FIG. 8 schematically shows a block diagram of a face recognition device in accordance with an embodiment of the present disclosure.
  • device 800 includes an acquisition module 810 and an identification module 820.
  • the obtaining module 810 is configured to acquire a face image.
  • the identification module 820 is configured to perform face recognition according to a light source environment in which the face image is collected.
  • the identification module 820 is specifically configured to compare the face image with a face image registered under visible light conditions when the light source environment in which the face image is collected is visible light; or, collect the person In the case where the light source environment in which the face image is located is near-infrared light, the face image is compared with the face map registered under the near-infrared light condition.
  • the apparatus further includes a light source determination module 830.
  • the light source determining module 830 is configured to determine whether the light source environment in which the face image is collected is visible light or near-infrared light.
  • the acquisition module 810 includes a full image frame acquisition sub-module 811, a face region acquisition sub-module 812, and a face image extraction sub-module 813.
  • the complete image frame acquisition sub-module 811 is used to acquire a complete image frame including a face and a background environment.
  • the face region acquisition sub-module 812 is configured to acquire a face region from the complete image frame.
  • the face image extraction sub-module 813 is configured to extract the face image from the face region.
  • the light source determination mode 830 includes a grayscale sub-module 831 and a light source determination sub-module 832.
  • the grayscale sub-module 831 is used to grayscale the complete image frame to obtain a grayscale image frame.
  • the light source determining sub-module 832 is configured to determine, according to the distribution of gray scales in the grayscale image frame, whether the light source environment in which the face image is collected is visible light or near-infrared.
  • determining, according to the distribution of gray scales in the grayscale image frame, whether the light source environment in which the face image is captured is visible light or near infrared including: calculating a grayscale value in the grayscale image frame.
  • a first number of pixels in the initial closed interval wherein one end of the initial closed interval is a gray level minimum of the gray image frame, and the other end point is the gray level minimum plus a preset value
  • the second pixel number of the grayscale value in the ending closed interval wherein one end point of the termination closed interval is the grayscale maximum value of the grayscale image frame minus the preset value, and the other endpoint is the a grayscale maximum value
  • calculating a grayscale average value of the region other than the face region in the grayscale image frame and when the first pixel number is greater than the second pixel number, and the grayscale average value is less than a preset grayscale
  • the mean value it is judged that the light source environment in which the face image is collected is near-infrared light, otherwise the light source environment in which the face image is collected is visible light.
  • the preset value includes 15. According to an embodiment of the present disclosure, the preset grayscale mean comprises 140.
  • the apparatus further includes a registration module 840.
  • the registration module 840 is configured to separately register a face map under visible light conditions and near-infrared light conditions.
  • the apparatus 800 may be used to implement the face recognition method described with reference to FIGS. 2 to 7.
  • any of the modules, sub-modules, units, sub-units, or at least some of the functions of any of the plurality of the embodiments of the present disclosure may be implemented in one module. Any one or more of the modules, sub-modules, units, sub-units according to an embodiment of the present disclosure may be implemented by being split into a plurality of modules.
  • any one or more of the modules, sub-modules, units, sub-units in accordance with embodiments of the present disclosure may be implemented at least in part as hardware circuitry, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), System-on-a-chip, system on a substrate, system on a package, an application specific integrated circuit (ASIC), or any other reasonable means of hardware or firmware that integrates or encapsulates the circuit, or in software, hardware, and firmware. Any one of the implementations or in any suitable combination of any of them.
  • FPGA Field Programmable Gate Array
  • PLA Programmable Logic Array
  • ASIC application specific integrated circuit
  • one or more of the modules, sub-modules, units, sub-units in accordance with embodiments of the present disclosure may be implemented at least in part as a computer program module that, when executed, can perform the corresponding functions.
  • the light source determination sub-module 832 can be implemented in one module, or any one of the modules can be split into multiple modules. Alternatively, at least some of the functionality of one or more of the modules may be combined with at least some of the functionality of the other modules and implemented in one module.
  • At least one of the sub-module 831 and the light source determination sub-module 832 can be implemented at least in part as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, A system, an application specific integrated circuit (ASIC) on the package, or hardware or firmware in any other reasonable manner to integrate or package the circuit, or in a suitable combination of software, hardware, and firmware implementations.
  • FPGA field programmable gate array
  • PLA programmable logic array
  • ASIC application specific integrated circuit
  • the obtaining module 810, the identifying module 820, the light source determining module 830, the registration module 840, the complete image frame obtaining sub-module 811, the face region obtaining sub-module 812, the face image extracting sub-module 813, the graying sub-module 831, and At least one of the light source determination sub-modules 832 may be implemented at least in part as a computer program module that, when executed by the computer, may perform the functions of the respective modules.
  • FIG. 9 schematically illustrates a block diagram of a computer system suitable for implementing a robot in accordance with an embodiment of the present disclosure.
  • the computer system shown in FIG. 9 is merely an example and should not impose any limitation on the function and scope of use of the embodiments of the present disclosure.
  • a computer system 900 in accordance with an embodiment of the present disclosure includes a processor 901 that can be loaded into a random access memory (RAM) 903 according to a program stored in a read only memory (ROM) 902 or from a storage portion 908.
  • the program performs various appropriate actions and processes.
  • Processor 901 may, for example, comprise a general purpose microprocessor (e.g., a CPU), an instruction set processor, and/or a related chipset and/or a special purpose microprocessor (e.g., an application specific integrated circuit (ASIC)), and the like.
  • ASIC application specific integrated circuit
  • Processor 901 may also include an onboard memory for caching purposes.
  • the processor 901 may include a single processing unit or a plurality of processing units for performing different actions of the method flow according to the embodiments of the present disclosure described with reference to FIGS. 2-7.
  • the processor 901, the ROM 902, and the RAM 903 are connected to each other through a bus 904.
  • the processor 901 performs various operations of the face recognition method described above with reference to FIGS. 2 to 7 by executing programs in the ROM 902 and/or the RAM 903. It is noted that the program can also be stored in one or more memories other than the ROM 902 and the RAM 903.
  • the processor 901 can also perform various operations of the face recognition method described above with reference to FIGS. 2 to 7 by executing a program stored in the one or more memories.
  • System 900 may also include an input/output (I/O) interface 905 to which an input/output (I/O) interface 905 is also coupled, in accordance with an embodiment of the present disclosure.
  • System 900 can also include one or more of the following components coupled to I/O interface 905: an input portion 906 including a keyboard, mouse, etc.; including, for example, a cathode ray tube (CRT), a liquid crystal display (LCD), and the like, and a speaker An output portion 907 of the like; a storage portion 908 including a hard disk or the like; and a communication portion 909 including a network interface card such as a LAN card, a modem, and the like.
  • I/O interface 905 to which an input/output (I/O) interface 905 is also coupled, in accordance with an embodiment of the present disclosure.
  • System 900 can also include one or more of the following components coupled to I/O interface 905: an input portion 906 including a keyboard, mouse, etc.;
  • the communication section 909 performs communication processing via a network such as the Internet.
  • Driver 610 is also coupled to I/O interface 905 as needed.
  • a removable medium 911 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory or the like is mounted on the drive 910 as needed so that a computer program read therefrom is installed into the storage portion 908 as needed.
  • an embodiment of the present disclosure includes a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for executing the method illustrated in the flowchart.
  • the computer program can be downloaded and installed from the network via the communication portion 909, and/or installed from the removable medium 911.
  • the above-described functions defined in the system of the embodiments of the present disclosure are executed when the computer program is executed by the processor 901.
  • the systems, devices, devices, modules, units, and the like described above may be implemented by a computer program module in accordance with an embodiment of the present disclosure.
  • the computer readable medium shown in the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two.
  • the computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of computer readable storage media may include, but are not limited to, electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable Programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the foregoing.
  • a computer readable storage medium may be any tangible medium that can contain or store a program, which can be used by or in connection with an instruction execution system, apparatus, or device.
  • a computer readable signal medium may include a data signal that is propagated in the baseband or as part of a carrier, carrying computer readable program code. Such propagated data signals can take a variety of forms including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • the computer readable signal medium can also be any computer readable medium other than a computer readable storage medium, which can transmit, propagate, or transport a program for use by or in connection with the instruction execution system, apparatus, or device. .
  • Program code embodied on a computer readable medium can be transmitted by any suitable medium, including but not limited to wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
  • the computer readable medium may include one or more memories other than the ROM 902 and/or the RAM 903 and/or the ROM 902 and the RAM 903 described above.
  • each block of the flowchart or block diagrams can represent a module, a program segment, or a portion of code that includes one or more Executable instructions.
  • the functions noted in the blocks may also occur in a different order than that illustrated in the drawings. For example, two successively represented blocks may in fact be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending upon the functionality involved.
  • each block of the block diagrams or flowcharts, and combinations of blocks in the block diagrams or flowcharts can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be used A combination of dedicated hardware and computer instructions is implemented.
  • the present disclosure also provides a computer readable medium, which may be included in the apparatus described in the above embodiments, or may be separately present and not incorporated into the apparatus.
  • the computer readable medium described above carries one or more programs that, when executed by one of the devices, cause the device to perform a face recognition method in accordance with an embodiment of the present disclosure.
  • the method includes acquiring a face image and performing face recognition according to a light source environment in which the face image is collected.
  • Performing face recognition according to the light source environment in which the face image is collected specifically includes: when the light source environment in which the face image is collected is visible light, the face image is registered with the person under visible light conditions The face image is compared and recognized; or, when the light source environment in which the face image is collected is near-infrared light, the face image is compared with the face image registered under the near-infrared light condition.
  • the method further includes determining whether the light source environment in which the face image is acquired is visible light or near-infrared light.
  • acquiring the face image specifically includes acquiring a complete image frame including a face and a background environment, acquiring a face region from the complete image frame, and extracting the face image from the face region. Determining whether the light source environment in which the face image is collected is visible light or near-infrared light, including graying out the complete image frame, obtaining a gray image frame, and determining the person according to the gray scale distribution in the gray image frame
  • the light source environment in which the face image is located is visible light or near-infrared light.
  • determining, according to the distribution of gray scales in the grayscale image frame, whether the light source environment in which the face image is captured is visible light or near-infrared light includes a plurality of operation processes; calculating grayscale in the grayscale image frame The first pixel number of the order value in the initial closed interval, wherein one end point of the initial closed interval is the gray level minimum value of the gray image frame, and the other end point is the gray level minimum value plus a preset value Calculating a second pixel number of the grayscale value in the grayscale image frame in the termination closed interval, wherein an endpoint of the termination closed interval is a grayscale maximum value of the grayscale image frame minus the preset value, and An endpoint is the grayscale maximum; calculating a grayscale average of the region of the grayscale image frame other than the face region; when the first pixel number is greater than the second pixel number, and the grayscale average is less than When the gray level mean value is set, it is judged that the light source environment in which the face
  • the preset value includes 15.
  • the preset grayscale mean comprises 140.
  • the method further includes separately registering the face map under visible light conditions and near-infrared light conditions.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Health & Medical Sciences (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Computation (AREA)
  • Evolutionary Biology (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Artificial Intelligence (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Multimedia (AREA)
  • Image Processing (AREA)

Abstract

Provided are a human facial recognition method. The method comprises: acquiring a human facial image, and performing human facial recognition according to a light source environment where the human facial image is collected. The performing of human facial recognition according to a light source environment where the human facial image is collected specifically comprises: where the light source environment where the human facial image is collected is visible light, performing comparison and recognition on the human facial image and a human facial image registered under a visible light condition; or where the light source environment where the human facial image is collected is near-infrared light, performing comparison and recognition on the human facial image and a human facial image registered under a near-infrared light condition. Further provided are a human facial recognition apparatus and system, and a medium.

Description

人脸识别方法、装置、系统及介质Face recognition method, device, system and medium 技术领域Technical field
本公开涉及互联网技术领域,更具体地,涉及一种人脸识别方法、装置、系统及介质。The present disclosure relates to the field of Internet technologies, and in particular, to a face recognition method, apparatus, system, and medium.
背景技术Background technique
人脸识别一直是生物特征技术领域的一个热门研究。可见光人脸识别容易受到外界光照条件的影响,会造成人脸识别的不准确。近红外技术虽然不受环境光照影响识别效果较好,但是设备应用受限,而且识别方式与人们日常生活习惯相背。现有技术中存在一些将可见光识别和近红外光识别相结合的识别方式,主要包括基于人脸合成的可见光-近红外光人脸识别方法、基于统一子空间的可见光-近红外人脸识别方法、以及基于不变特征的可见光-近红外人脸识别方法、Face recognition has always been a hot research in the field of biometrics. Visible face recognition is easily affected by external lighting conditions, which may result in inaccurate face recognition. Although the near-infrared technology is not affected by the influence of ambient light, the application of the device is limited, and the recognition method is contrary to people's daily life habits. In the prior art, there are some recognition methods combining visible light recognition and near-infrared light recognition, mainly including a visible-near-infrared face recognition method based on face synthesis, and a visible-near-infrared face recognition method based on unified subspace. And a visible-near-infrared face recognition method based on invariant features,
在实现本发明构思的过程中,发明人发现现有技术中至少存在如下问题:现有技术中将可见光识别和近红外识别相结合的识别方式普遍是注册时获得一种光源条件下的人脸库。在识别认证时,当采集人脸图像时当采集时的光源环境与注册时不一致,需要将采集的人脸图像处理转换后进行比对,其实质还是不同质光源下的人脸识别。In the process of implementing the inventive concept, the inventors have found that at least the following problems exist in the prior art: in the prior art, the recognition method combining visible light recognition and near-infrared recognition is generally a face obtained under registration of a light source condition. Library. When identifying the authentication, when the face image is collected, the light source environment at the time of the acquisition is inconsistent with the registration time, and the collected face image processing needs to be converted and compared, and the essence is the face recognition under the different quality light sources.
发明内容Summary of the invention
有鉴于此,本公开提供了一种可以实现同质光源下的人脸图像比对的人脸识别方法、装置、系统及介质。In view of this, the present disclosure provides a face recognition method, apparatus, system, and medium that can achieve face image comparison under a homogeneous light source.
本公开的一个方面提供了一种人脸识别方法。所述方法包括获取人脸图像,以及根据采集所述人脸图像时所处的光源环境进行人脸识别。根据采集所述人脸图像时所处的光源环境进行人脸识别具体包括:在采集所述人脸图像时所处的光源环境是可见光的情况下,将所述人脸图像与在可见光条件下注册的人脸图进行比对识别;或者,在采集所述人脸图像时所处的光源环境是近红外光的情况下,将所述人脸图像与近红外光条件下注册的人脸图进行比对识别。One aspect of the present disclosure provides a face recognition method. The method includes acquiring a face image and performing face recognition according to a light source environment in which the face image is collected. Performing face recognition according to the light source environment in which the face image is collected specifically includes: when the light source environment in which the face image is collected is visible light, the face image is in visible light condition The registered face map is compared and recognized; or, in the case where the light source environment in which the face image is collected is near-infrared light, the face image and the face map registered under the near-infrared light condition are registered. Perform alignment recognition.
根据本公开的实施例,所述方法还包括判断采集所述人脸图像时所处的光源环境是可见光还是近红外光。According to an embodiment of the present disclosure, the method further includes determining whether the light source environment in which the face image is acquired is visible light or near-infrared light.
根据本公开的实施例,获取人脸图像具体包括获取包括人脸和背景环境的完整图像帧,从所述完整图像帧中获取人脸区域,以及从所述人脸区域提取所述人脸图像。判断采集所述人脸图像时所处的光源环境是可见光还是近红外光,包括灰度化所述完整图像帧,得到灰度图像帧,以及根据所述灰度图像帧中灰阶的分布判断采集所述人脸图像时所处的光源环境是 可见光还是近红外光。According to an embodiment of the present disclosure, acquiring a face image specifically includes acquiring a complete image frame including a face and a background environment, acquiring a face region from the complete image frame, and extracting the face image from the face region. . Determining whether the light source environment in which the face image is collected is visible light or near-infrared light, including graying out the complete image frame, obtaining a gray image frame, and judging according to the distribution of gray scales in the gray image frame The light source environment in which the face image is acquired is visible light or near-infrared light.
根据本公开的实施例,根据所述灰度图像帧中灰阶的分布判断采集所述人脸图像时所处的光源环境是可见光还是近红外光包括以下操作过程;计算所述灰度图像帧中灰阶值在起始闭区间内的第一像素数量,其中,所述起始闭区间的一个端点为所述灰度图像帧的灰阶最小值,另一个端点为所述灰阶最小值加上预设值;计算所述灰度图像帧中灰阶值在终止闭区间内的第二像素数量,其中,所述终止闭区间的一个端点为所述灰度图像帧的灰阶最大值减去所述预设值,另一个端点为所述灰阶最大值;计算所述灰度图像帧中除所述人脸区域以外的区域的灰阶平均值;当所述第一像素数量大于第二像素数量,并且所述灰阶平均值小于预设灰阶均值时,判断采集所述人脸图像时所处的光源环境是近红外光;否则,判断采集所述人脸图像时所处的光源环境是可见光。According to an embodiment of the present disclosure, determining, according to the distribution of gray scales in the grayscale image frame, whether the light source environment in which the face image is captured is visible light or near-infrared light includes the following operation process; calculating the grayscale image frame a first pixel number of the gray scale value in the initial closed interval, wherein one end point of the initial closed interval is a gray level minimum value of the gray image frame, and the other end point is the gray level minimum value And adding a preset value; calculating a second pixel number of the grayscale value in the grayscale image frame in the termination closed interval, wherein one end point of the termination closed interval is a grayscale maximum value of the grayscale image frame Subtracting the preset value, another endpoint is the grayscale maximum value; calculating a grayscale average value of the region other than the face region in the grayscale image frame; when the first pixel number is greater than When the second pixel number is less than the preset grayscale mean value, determining that the light source environment in which the face image is collected is near-infrared light; otherwise, determining that the face image is collected is The light source environment is visible light
根据本公开的实施例,所述预设值包括15。According to an embodiment of the present disclosure, the preset value includes 15.
根据本公开的实施例,所述预设灰阶均值包括140。According to an embodiment of the present disclosure, the preset grayscale mean comprises 140.
根据本公开的实施例,所述方法还包括同时在可见光条件下和近红外光条件下分别注册人脸图。According to an embodiment of the present disclosure, the method further includes separately registering the face map under visible light conditions and near-infrared light conditions.
本公开的另一方面提供了一种人脸识别装置。所述装置包括获取模块和识别模块。获取模块用于获取人脸图像。识别模块用于根据采集所述人脸图像时所处的光源环境进行人脸识别。识别模块具体用于在采集所述人脸图像时所处的光源环境是可见光的情况下,将所述人脸图像与在可见光条件下注册的人脸图进行比对识别;或者,在采集所述人脸图像时所处的光源环境是近红外光的情况下,将所述人脸图像与近红外光条件下注册的人脸图进行比对识别。Another aspect of the present disclosure provides a face recognition device. The device includes an acquisition module and an identification module. The acquisition module is used to acquire a face image. The identification module is configured to perform face recognition according to a light source environment in which the face image is collected. The identification module is specifically configured to compare the face image with a face image registered under visible light conditions when the light source environment in which the face image is collected is visible light; or, in the collection center In the case where the light source environment in which the face image is located is near-infrared light, the face image is compared with the face map registered under the near-infrared light condition.
根据本公开的实施例,所述装置还包括光源判断模块。光源判断模块用于判断采集所述人脸图像时所处的光源环境是可见光还是近红外光。According to an embodiment of the present disclosure, the apparatus further includes a light source determination module. The light source determining module is configured to determine whether the light source environment in which the face image is collected is visible light or near-infrared light.
根据本公开的实施例,获取模块,包括完整图像帧获取子模块、人脸区域获取子模块、以及人脸图像提取子模块。其中,完整图像帧获取子模块用于获取包括人脸和背景环境的完整图像帧。人脸区域获取子模块用于从所述完整图像帧中获取人脸区域。人脸图像提取子模块,用于从所述人脸区域提取所述人脸图像。光源判断模块包括灰度化子模块和光源判断子模块。其中,灰度化子模块用于灰度化所述完整图像帧,得到灰度图像帧。光源判断子模块用于根据所述灰度图像帧中灰阶的分布判断采集所述人脸图像时所处的光源环境是可见光还是近红外光。According to an embodiment of the present disclosure, the acquisition module includes a complete image frame acquisition sub-module, a face region acquisition sub-module, and a face image extraction sub-module. The complete image frame acquisition sub-module is used to acquire a complete image frame including a face and a background environment. The face region acquisition sub-module is configured to acquire a face region from the complete image frame. a face image extraction sub-module for extracting the face image from the face region. The light source judging module includes a grayscale submodule and a light source judging submodule. Wherein, the grayscale sub-module is used to grayscale the complete image frame to obtain a grayscale image frame. The light source determining sub-module is configured to determine, according to the distribution of gray scales in the grayscale image frame, whether the light source environment in which the face image is collected is visible light or near-infrared light.
根据本公开的实施例,根据所述灰度图像帧中灰阶的分布确定采集所述人脸图像时所处的光源环境是可见光还是近红外光,包括:计算所述灰度图像帧中灰阶值在起始闭区间内的 第一像素数量,其中,所述起始闭区间的一个端点为所述灰度图像帧的灰阶最小值,另一个端点为所述灰阶最小值加上预设值;计算所述灰度图像帧中灰阶值在终止闭区间内的第二像素数量,其中,所述终止闭区间的一个端点为所述灰度图像帧的灰阶最大值减去所述预设值,另一个端点为所述灰阶最大值;计算所述灰度图像帧中除所述人脸区域以外的区域中的灰阶平均值;以及当所述第一像素数量大于第二像素数量,并且所述灰阶平均值小于预设灰阶均值时,判断采集所述人脸图像时所处的光源环境是近红外光,否则判断采集所述人脸图像时所处的光源环境是可见光。According to an embodiment of the present disclosure, determining, according to the distribution of gray scales in the grayscale image frame, whether the light source environment in which the face image is captured is visible light or near-infrared light comprises: calculating gray in the grayscale image frame a first number of pixels in the initial closed interval, wherein one end of the initial closed interval is a grayscale minimum of the grayscale image frame, and the other endpoint is the grayscale minimum plus a preset value; calculating a second pixel number of the grayscale value in the grayscale image frame in the termination closed interval, wherein one end point of the termination closed interval is a grayscale maximum value of the grayscale image frame minus The preset value, another endpoint is the grayscale maximum value; calculating a grayscale average value in the region other than the face region in the grayscale image frame; and when the first pixel number is greater than When the second pixel number is less than the preset grayscale mean value, determining that the light source environment in which the face image is collected is near-infrared light, otherwise determining the location where the face image is collected The light source environment is visible light.
根据本公开的实施例,所述预设值包括15。According to an embodiment of the present disclosure, the preset value includes 15.
根据本公开的实施例,所述预设灰阶均值包括140。According to an embodiment of the present disclosure, the preset grayscale mean comprises 140.
根据本公开的实施例,所述装置还包括注册模块。所述注册模块用于同时在可见光条件下和近红外光条件下分别注册人脸图。According to an embodiment of the present disclosure, the apparatus further includes a registration module. The registration module is configured to separately register a face map under visible light conditions and near-infrared light conditions.
本公开的另一方面提供了一种人脸识别的系统,包括一个或多个处理器,以及存储器。存储器用于存储一个或多个程序。其中,当所述一个或多个程序被所述一个或多个处理器执行时,使得所述一个或多个处理器实现以上所述的方法。Another aspect of the present disclosure provides a system for face recognition including one or more processors, and a memory. The memory is used to store one or more programs. Wherein, when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the methods described above.
本公开的另一方面提供了一种计算机可读介质,其上存储有可执行指令,该指令被处理器执行时使处理器实现如上所述所述的方法。Another aspect of the present disclosure provides a computer readable medium having stored thereon executable instructions that, when executed by a processor, cause a processor to implement the methods described above.
本公开的另一方面提供了一种计算机程序,所述计算机程序包括计算机可执行指令,所述指令在被执行时用于实现如上所述的方法。Another aspect of the disclosure provides a computer program comprising computer executable instructions that, when executed, are used to implement a method as described above.
根据本公开的实施例,可以至少部分避免了不同质光源下人脸图像差异过大造成的识别误差,并因此可以实现同质光源下人的人脸识别,从而达到提高人脸识别的准确性的技术效果。According to the embodiment of the present disclosure, the recognition error caused by the excessive difference of the face image under different quality light sources can be at least partially avoided, and thus the face recognition of the person under the homogenous light source can be realized, thereby improving the accuracy of the face recognition. Technical effect.
附图说明DRAWINGS
通过以下参照附图对本公开实施例的描述,本公开的上述以及其他目的、特征和优点将更为清楚,在附图中:The above and other objects, features and advantages of the present disclosure will become more apparent from
图1示意性示出了根据本公开实施例的人脸识别方法和装置的示例性架构;FIG. 1 schematically illustrates an exemplary architecture of a face recognition method and apparatus according to an embodiment of the present disclosure;
图2示意性示出了根据本公开实施例的人脸识别方法的流程图;FIG. 2 schematically shows a flowchart of a face recognition method according to an embodiment of the present disclosure; FIG.
图3示意性示出了根据本公开另一实施例的人脸识别方法的流程图;FIG. 3 schematically shows a flowchart of a face recognition method according to another embodiment of the present disclosure; FIG.
图4示意性示出了根据本公开再一实施例的人脸识别方法的流程图;FIG. 4 schematically shows a flowchart of a face recognition method according to still another embodiment of the present disclosure; FIG.
图5A和图5B分别示意性示出了在可见光和近红外光环境下采集的图像对应的灰度图像帧中的灰阶分布;5A and 5B respectively schematically illustrate gray scale distributions in grayscale image frames corresponding to images acquired in visible light and near-infrared light environments;
图6示意性示出了根据本公开另一实施例的根据灰阶分布判断采集人脸图像时的光源环境的流程图;FIG. 6 is a flow chart schematically illustrating determining a light source environment when a face image is acquired according to a gray scale distribution according to another embodiment of the present disclosure; FIG.
图7示意性示出了根据本公开各个实施例的人脸识别方法的应用情景示意;FIG. 7 is a schematic diagram showing an application scenario of a face recognition method according to various embodiments of the present disclosure; FIG.
图8示意性示出了根据本公开实施例的人脸识别装置的框图;以及FIG. 8 is a block diagram schematically showing a face recognition device according to an embodiment of the present disclosure;
图9示意性示出了根据本公开实施例的适于实现机器人的计算机系统的方框图。FIG. 9 schematically illustrates a block diagram of a computer system suitable for implementing a robot in accordance with an embodiment of the present disclosure.
具体实施方式Detailed ways
以下,将参照附图来描述本公开的实施例。但是应该理解,这些描述只是示例性的,而并非要限制本公开的范围。此外,在以下说明中,省略了对公知结构和技术的描述,以避免不必要地混淆本公开的概念。Hereinafter, embodiments of the present disclosure will be described with reference to the drawings. It should be understood, however, that the description is only illustrative, and is not intended to limit the scope of the disclosure. In addition, descriptions of well-known structures and techniques are omitted in the following description in order to avoid unnecessarily obscuring the concept of the present disclosure.
在此使用的术语仅仅是为了描述具体实施例,而并非意在限制本公开。在此使用的术语“包括”、“包含”等表明了所述特征、步骤、操作和/或部件的存在,但是并不排除存在或添加一个或多个其他特征、步骤、操作或部件。The terminology used herein is for the purpose of describing the particular embodiments, The use of the terms "comprising", "comprising" or "an"
在此使用的所有术语(包括技术和科学术语)具有本领域技术人员通常所理解的含义,除非另外定义。应注意,这里使用的术语应解释为具有与本说明书的上下文相一致的含义,而不应以理想化或过于刻板的方式来解释。All terms (including technical and scientific terms) used herein have the meaning commonly understood by one of ordinary skill in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted as having a meaning consistent with the context of the present specification and should not be interpreted in an ideal or too rigid manner.
在使用类似于“A、B和C等中至少一个”这样的表述的情况下,一般来说应该按照本领域技术人员通常理解该表述的含义来予以解释(例如,“具有A、B和C中至少一个的系统”应包括但不限于单独具有A、单独具有B、单独具有C、具有A和B、具有A和C、具有B和C、和/或具有A、B、C的系统等)。在使用类似于“A、B或C等中至少一个”这样的表述的情况下,一般来说应该按照本领域技术人员通常理解该表述的含义来予以解释(例如,“具有A、B或C中至少一个的系统”应包括但不限于单独具有A、单独具有B、单独具有C、具有A和B、具有A和C、具有B和C、和/或具有A、B、C的系统等)。本领域技术人员还应理解,实质上任意表示两个或更多可选项目的转折连词和/或短语,无论是在说明书、权利要求书还是附图中,都应被理解为给出了包括这些项目之一、这些项目任一方、或两个项目的可能性。例如,短语“A或B”应当被理解为包括“A”或“B”、或“A和B”的可能性。Where an expression similar to "at least one of A, B, and C, etc." is used, it should generally be interpreted in accordance with the meaning of the expression as commonly understood by those skilled in the art (for example, "having A, B, and C" "Systems of at least one of" shall include, but are not limited to, systems having A alone, B alone, C alone, A and B, A and C, B and C, and/or A, B, C, etc. ). Where an expression similar to "at least one of A, B or C, etc." is used, it should generally be interpreted according to the meaning of the expression as commonly understood by those skilled in the art (for example, "having A, B or C" "Systems of at least one of" shall include, but are not limited to, systems having A alone, B alone, C alone, A and B, A and C, B and C, and/or A, B, C, etc. ). Those skilled in the art will also appreciate that transitional conjunctions and/or phrases that are arbitrarily arbitrarily representing two or more optional items, whether in the specification, claims, or drawings, are to be construed as The possibility of one of the projects, either or both of these projects. For example, the phrase "A or B" should be understood to include the possibility of "A" or "B", or "A and B."
本公开的实施例提供了一种人脸识别方法、装置、系统及介质。该方法包括获取人脸图像,以及根据采集该人脸图像时所处的光源环境进行人脸识别。根据采集该人脸图像时所处的光源环境进行人脸识别具体包括:在采集该人脸图像时所处的光源环境是可见光的情况下,将该人脸图像与在可见光条件下注册的人脸图进行比对识别;或者,在采集该人脸图像时所 处的光源环境是近红外光的情况下,将该人脸图像与近红外光条件下注册的人脸图进行比对识别。Embodiments of the present disclosure provide a face recognition method, apparatus, system, and medium. The method includes acquiring a face image and performing face recognition according to a light source environment in which the face image is collected. Performing face recognition according to the light source environment in which the face image is collected specifically includes: when the light source environment in which the face image is collected is visible light, the face image is registered with the person under visible light conditions The face image is compared and recognized; or, when the light source environment in which the face image is collected is near-infrared light, the face image is compared with the face image registered under the near-infrared light condition.
图1示意性示出了根据本公开实施例的人脸识别方法和装置的示例性架构100。需要注意的是,图1所示仅为可以应用本公开实施例的系统架构的示例,以帮助本领域技术人员理解本公开的技术内容,但并不意味着本公开实施例不可以用于其他设备、系统、环境或场景。FIG. 1 schematically illustrates an exemplary architecture 100 of a face recognition method and apparatus in accordance with an embodiment of the present disclosure. It should be noted that FIG. 1 is only an example of a system architecture to which the embodiments of the present disclosure may be applied, to help those skilled in the art understand the technical content of the present disclosure, but does not mean that the embodiments of the present disclosure may not be used for other Device, system, environment, or scenario.
如图1所示,根据该实施例的系统架构100可以包括摄像头101,网络102和服务器103。网络102用以在摄像头101、和服务器103之间提供通信链路的介质。网络102可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。As shown in FIG. 1, the system architecture 100 according to this embodiment may include a camera 101, a network 102, and a server 103. The network 102 is used to provide a medium for communication links between the camera 101 and the server 103. Network 102 can include a variety of connection types, such as wired, wireless communication links, fiber optic cables, and the like.
摄像头101可以采集人脸图像,并经过网络102将获得的人脸图像传输给服务器103。The camera 101 can collect a face image and transmit the obtained face image to the server 103 via the network 102.
服务器103可以是提供各种服务的服务器,例如对接收到人脸图像等数据进行分析等处理。The server 103 may be a server that provides various services, such as processing for analyzing data such as receiving a face image.
在另一些实施例中,系统架构100中还可以包括终端设备104。终端设备104中可以存储经摄像头101或者其他摄像头采集的人脸图像。并且,终端设备104可以根据用户的操作将存储其中的人脸图像通过网络102发送给服务器105,以请求服务器105进行识别认证。服务器105可以根据用户请求进行处理,并将处理结果反馈给终端设备104。In other embodiments, the terminal device 104 may also be included in the system architecture 100. A face image collected by the camera 101 or other cameras can be stored in the terminal device 104. And, the terminal device 104 can transmit the face image stored therein to the server 105 through the network 102 according to the user's operation, to request the server 105 to perform the identification authentication. The server 105 can process according to the user request and feed back the processing result to the terminal device 104.
终端设备104可以是具有显示屏并且支持网页浏览的各种电子设备,包括但不限于智能手机、平板电脑、膝上型便携计算机和台式计算机等等。The terminal device 104 can be a variety of electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop portable computers, desktop computers, and the like.
在一些实施例中,终端设备104和摄像头101可以组合为一体,或者摄像头101可以是终端设备104的组成部分。In some embodiments, the terminal device 104 and the camera 101 can be combined or the camera 101 can be an integral part of the terminal device 104.
需要说明的是,本公开实施例所提供的人脸识别方法一般可以由服务器103执行。相应地,本公开实施例所提供的人脸识别装置一般可以设置于服务器103中。本公开实施例所提供的人脸识别方法也可以由不同于服务器103且能够与和/或服务器103通信的服务器或服务器集群执行。相应地,本公开实施例所提供的人脸识别装置也可以设置于不同于服务器103且能够与和/或服务器103通信的服务器或服务器集群中。It should be noted that the face recognition method provided by the embodiment of the present disclosure may be generally performed by the server 103. Correspondingly, the face recognition device provided by the embodiment of the present disclosure may be generally disposed in the server 103. The face recognition method provided by the embodiments of the present disclosure may also be performed by a server or server cluster different from the server 103 and capable of communicating with the server 103. Correspondingly, the face recognition device provided by the embodiment of the present disclosure may also be disposed in a server or server cluster different from the server 103 and capable of communicating with the server 103.
应该理解,图1中的终端设备、网络和服务器的数目仅仅是示意性的。根据实现需要,可以具有任意数目的终端设备、网络和服务器。It should be understood that the number of terminal devices, networks, and servers in Figure 1 is merely illustrative. Depending on the implementation needs, there can be any number of terminal devices, networks, and servers.
图2示意性示出了根据本公开实施例的人脸识别方法的流程图。FIG. 2 schematically illustrates a flow chart of a face recognition method in accordance with an embodiment of the present disclosure.
如图2所示,根据本公开实施例,该人脸识别方法包括操作S210和操作S220。As shown in FIG. 2, according to an embodiment of the present disclosure, the face recognition method includes an operation S210 and an operation S220.
在操作S210,获取人脸图像。In operation S210, a face image is acquired.
在一些实施例中,可以获取摄像头实时采集的人脸图像。在一些实施例中,可以从网络或其他图像存储位置等处获取由摄像头采集获得的人脸图像。In some embodiments, a face image acquired by the camera in real time can be acquired. In some embodiments, the face image acquired by the camera acquisition can be obtained from a network or other image storage location or the like.
在操作S220,根据采集该人脸图像时所处的光源环境进行人脸识别。In operation S220, face recognition is performed according to the light source environment in which the face image is collected.
具体的,操作S220根据采集该人脸图像时所处的光源环境进行人脸识别包括:在采集该人脸图像时所处的光源环境是可见光的情况下,将该人脸图像与在可见光条件下注册的人脸图进行比对识别;或者,在采集该人脸图像时所处的光源环境是近红外光的情况下,将该人脸图像与近红外光条件下注册的人脸图进行比对识别。Specifically, the operation S220 performs face recognition according to the light source environment in which the face image is collected, and includes: when the light source environment where the face image is collected is visible light, the face image and the visible light condition The registered face image is compared and recognized; or, when the light source environment in which the face image is collected is near-infrared light, the face image and the face map registered under the near-infrared light condition are performed. Alignment identification.
根据本公开的实施例,在进行人脸识别时,可以根据采集该人脸图像时所处的光源环境进行同质光源下的人脸识别,将待识别人脸图像与人脸库中同质光源下的人脸图进行比对,一定程度上避免了不同质光源下人脸图像差异过大造成的识别误差,提高了人脸识别的准确性。According to an embodiment of the present disclosure, when performing face recognition, face recognition under a homogenous light source may be performed according to a light source environment in which the face image is collected, and the face image to be recognized is homogenous with the face database. The face maps under the light source are compared, and the recognition error caused by the excessive difference of the face images under different quality light sources is avoided to some extent, and the accuracy of face recognition is improved.
图3示意性示出了根据本公开另一实施例的人脸识别方法的流程图。FIG. 3 schematically shows a flowchart of a face recognition method according to another embodiment of the present disclosure.
如图3所示,根据本公开另一实施例,该人脸识别方法除操作S210和操作S220之外,还包括操作S310。其中操作S310可以位于操作S220之前,或者操作S310可以与操作S220并行执行。As shown in FIG. 3, according to another embodiment of the present disclosure, the face recognition method further includes an operation S310 in addition to the operations S210 and S220. The operation S310 may be before the operation S220, or the operation S310 may be performed in parallel with the operation S220.
在操作S310,判断采集该人脸图像时所处的光源环境是可见光还是近红外光。In operation S310, it is determined whether the light source environment in which the face image is collected is visible light or near-infrared light.
根据本公开的实施例,可以判断采集该人脸图像时所处的光源环境,从而可以将将待识别人脸图像与人脸库中同质光源下的人脸图进行比对,实现同质光源下的人脸识别。According to the embodiment of the present disclosure, the light source environment in which the face image is collected may be determined, so that the face image to be recognized may be compared with the face image under the homogenous light source in the face database to achieve homogeneity. Face recognition under the light source.
图4示意性示出了根据本公开再一实施例的人脸识别方法的流程图。FIG. 4 schematically illustrates a flow chart of a face recognition method according to still another embodiment of the present disclosure.
如图4所示,根据本公开再一实施例,该人脸识别方法包括操作S210、操作S310和操作S220。其中操作S210包括操作S211~操作S213,操作S310包括操作S311和操作S312。As shown in FIG. 4, according to still another embodiment of the present disclosure, the face recognition method includes an operation S210, an operation S310, and an operation S220. The operation S210 includes operations S211 to S213, and operation S310 includes operations S311 and S312.
具体地,操作S210获取人脸图像可以包括操作S211~操作S213。Specifically, acquiring the face image in operation S210 may include operations S211 to S213.
在操作S211,获取包括人脸和背景环境的完整图像帧。In operation S211, a complete image frame including a face and a background environment is acquired.
在一些实施例中,获取摄像头实时采集的包含人脸和人脸周围的背景环境的完整图像帧。例如,通过摄像头实时采集人脸时可以是将专用摄像头固定于距离拍摄人脸水平0.5m-0.8m向上45度方向上采集的包含人脸的完整图像帧。在另一些实施例中,可以从网络等其他位置获取由摄像头采集的包含人脸的完整图像帧。In some embodiments, a full image frame containing the background environment surrounding the face and face is acquired in real time by the camera. For example, when the face is collected by the camera in real time, the dedicated camera may be fixed to a complete image frame containing the face collected in a direction of 0.5 degrees upward from the shooting face level of 0.5 m-0.8 m. In other embodiments, a complete image frame containing a human face captured by the camera can be obtained from other locations, such as the network.
在操作S212,从该完整图像帧中获取人脸区域。A face area is acquired from the complete image frame in operation S212.
例如,利用Adaboost算法进行人脸检测,得到人脸区域。For example, the face detection is performed using the Adaboost algorithm to obtain a face region.
在操作S213,从该人脸区域提取该人脸图像。The face image is extracted from the face region in operation S213.
例如,利用Adaboost算法从人脸区域提取该人脸图像。For example, the face image is extracted from a face region using the Adaboost algorithm.
具体地,操作S310判断采集该人脸图像时所处的光源环境是可见光还是近红外光,可以包括操作S311和操作S312。Specifically, operation S310 determines whether the light source environment in which the face image is collected is visible light or near-infrared light, and may include operations S311 and S312.
在操作S311,灰度化该完整图像帧,得到灰度图像帧。In operation S311, the complete image frame is grayed out to obtain a grayscale image frame.
在操作S312,根据该灰度图像帧中灰阶的分布判断采集该人脸图像时所的光源环境是可见光还是近红外光。In operation S312, it is determined whether the light source environment when collecting the face image is visible light or near-infrared light according to the distribution of gray scales in the grayscale image frame.
图5A和图5B分别示意性示出了在可见光和近红外光环境下采集的图像对应的灰度图像帧中的灰阶分布。图5A示出了根据实验获得的由可见光光源采集的完整图像帧灰度化处理得到的灰度图像帧中的灰阶分布。图5B示出了根据实验获得的由近红外光光源采集的完整图像帧灰度化处理得到的灰度图像帧中的灰阶分布。5A and 5B schematically illustrate gray scale distributions in grayscale image frames corresponding to images acquired in visible light and near-infrared light environments, respectively. FIG. 5A shows the gray scale distribution in the grayscale image frame obtained by the grayscale processing of the complete image frame acquired by the visible light source according to the experiment. FIG. 5B shows the gray scale distribution in the grayscale image frame obtained by the grayscale processing of the complete image frame acquired by the near-infrared light source obtained according to the experiment.
图中Gray begin指的是灰度图像帧中的灰阶最小值。Gray end指的是灰度图像帧中的灰阶最大值。 Gray begin refers to the grayscale minimum in the grayscale image frame. Gray end refers to the grayscale maximum in the grayscale image frame.
图5A和图5B示意出了在灰度图像帧中当灰阶值在的最小值到最大值的范围内,各个灰阶值对应的像素数量。5A and 5B illustrate the number of pixels corresponding to respective grayscale values in the range of the minimum value to the maximum value of the grayscale value in the grayscale image frame.
例如,可以逐行扫描灰度图像帧,统计各灰阶值对应的像素数量,例如标记为N0、N1、…、N255,并标记起始的灰阶最小值为Gray begin、终止的灰阶最大值为Gray endFor example, the grayscale image frame can be scanned line by line, and the number of pixels corresponding to each grayscale value is counted, for example, labeled as N0, N1, ..., N255, and the minimum grayscale value of the mark is Gray begin , and the grayscale of the maximum is terminated. The value is Gray end .
对比可以看出,可见光光源下采集的完整图像帧和近红外光光源下采集的完整图像帧对应得到的灰度图像帧中的灰阶分布存在明显的差异。It can be seen from the comparison that there is a significant difference in the gray scale distribution in the gray image frame obtained by the complete image frame acquired under the visible light source and the complete image frame acquired under the near-infrared light source.
可见光光源下采集的完整图像帧得到的灰度图像帧的灰阶值在Gray end附近的像素数量较多。而近红外光光源下采集的完整图像帧得到的灰度图像帧的灰阶值在Gray begin附近的像素数量较多。 The grayscale image frame obtained by the complete image frame acquired under the visible light source has a grayscale value near the Gray end . The grayscale image of the gray image frame obtained by the complete image frame acquired under the near-infrared light source has a larger number of pixels near the gray begin .
图6示意性示出了根据本公开另一实施例的操作S312中根据灰阶分布判断采集人脸图像时的光源环境的流程图。FIG. 6 is a flow chart schematically showing a light source environment when a face image is acquired according to a gray scale distribution in operation S312 according to another embodiment of the present disclosure.
如图6所示,操作S312包括操作S3121~操作S3124。As shown in FIG. 6, operation S312 includes operations S3121 to S3124.
在操作S3121,计算该灰度图像帧中灰阶值在起始闭区间内的第一像素数量,其中,该起始闭区间的一个端点为该灰度图像帧的灰阶最小值,另一个端点为该灰阶最小值加上预设值。In operation S3121, calculating a first pixel number of the grayscale value in the initial closed interval in the grayscale image frame, wherein one end point of the initial closed interval is a grayscale minimum value of the grayscale image frame, and the other The endpoint is the grayscale minimum plus a preset value.
例如,计算灰阶值在[Gray begin,Gray begin+预设值]区间内的像素个数,记为P 0For example, calculate the number of pixels of the grayscale value in the [Gray begin , Gray begin + preset value] interval, and record it as P 0 .
在操作S3122,计算该灰度图像帧中灰阶值在终止闭区间内的第二像素数量,其中,该终止闭区间的一个端点为该灰度图像帧的灰阶最大值减去该预设值,另一个端点为该灰阶最大值。In operation S3122, calculating a second pixel number of the grayscale value in the grayout image frame in the termination closed interval, wherein an endpoint of the termination closed interval is a grayscale maximum value of the grayscale image frame minus the preset The value, the other endpoint is the grayscale maximum.
例如,计算灰阶值在[Gray end-预设值,Gray end]区间内的像素个数,记为P 1For example, calculate the number of pixels of the grayscale value in the [Gray end - Preset, Gray end ] interval, and record it as P 1 .
在操作S3123,计算该灰度图像帧中除该人脸区域以外的区域的灰阶平均值,例如标记为Gray AveIn operation S3123, a grayscale average value of the region other than the face region in the grayscale image frame is calculated, for example, marked as Gray Ave.
在操作S3124,当该第一像素数量大于第二像素数量,并且该灰阶平均值小于预设灰阶均值时,判断采集该人脸图像时所处的光源环境是近红外光;否则,判断采集该人脸图像时所处的光源环境是可见光。In operation S3124, when the first pixel number is greater than the second pixel number, and the grayscale average value is less than the preset grayscale mean value, determining that the light source environment in which the face image is collected is near-infrared light; otherwise, determining The light source environment in which the face image is acquired is visible light.
即,若存在P 0>P 1且Gray Ave<预设灰阶均值,判断采集该人脸图像是该的光源环境是近红外光。否则,采集该人脸图像时所处的光源环境是可见光。 That is, if there is P 0 >P 1 and Gray Ave <preset gray scale mean, it is judged that the face image is collected, and the light source environment is near-infrared light. Otherwise, the light source environment in which the face image is acquired is visible light.
根据本公开的实施例,该预设值包括15。可以理解,在具体的不同实施例中,该预设值可以有所不同。According to an embodiment of the present disclosure, the preset value includes 15. It will be appreciated that the preset values may vary in particular different embodiments.
根据本公开的实施例,该预设灰阶均值包括140。According to an embodiment of the present disclosure, the preset grayscale mean comprises 140.
根据实验验证,当该预设值为15时,即P 0为区间[Gray begin,Gray begin+15]内的像素个数,P 1为区间[Gray end-15,Gray end]内的像素个数时,通过判断灰度图像帧中的灰阶分布是否满足P 0>P 1且Gray Ave<140,来确定采集该人脸图像的光源环境是否是近红外光具有较高的准确率。 According to the experimental verification, when the preset value is 15, P 0 is the number of pixels in the interval [Gray begin , Gray begin +15], and P 1 is the pixel in the interval [Gray end -15, Gray end ]. When judging whether the gray scale distribution in the gray image frame satisfies P 0 >P 1 and Gray Ave <140, it is determined whether the light source environment for collecting the face image is near-infrared light has a high accuracy.
以下结合图7的一个示例性实施例,对根据本公开各个实施例的方法进行详细说明。The method according to various embodiments of the present disclosure will be described in detail below in conjunction with an exemplary embodiment of FIG.
图7示意性示出了根据本公开各个实施例的人脸识别方法的应用情景示意。FIG. 7 schematically illustrates an application scenario diagram of a face recognition method according to various embodiments of the present disclosure.
具体应用情景可以如图7所示,可以在操作S210中获取人脸图像。The specific application scenario may be as shown in FIG. 7, and the face image may be acquired in operation S210.
例如可以在操作S211中通过专用摄像头采集得到的包含人脸的完整图像帧,此时采集该人脸图像的光源类型未知。接着在操作S212中对该完整图像帧进行Adaboost人脸检测得到的人脸区域。然后在操作S213中对从该人脸区域中提取出人脸图像。For example, a complete image frame containing a face may be acquired by a dedicated camera in operation S211, and the type of the light source that collects the face image is unknown at this time. Next, the face area obtained by the Adaboost face detection is performed on the complete image frame in operation S212. The face image is then extracted from the face region in operation S213.
然后,可以通过操作S310判断采集该人脸图像时所处的光源环境是可见光还是近红外光。Then, it can be determined by operation S310 whether the light source environment in which the face image is collected is visible light or near-infrared light.
具体地,在操作S311中灰度化该完整图像帧,得到对应的灰度图像帧。然后可以逐行扫描该灰度图像帧中各灰阶值对应的像素量,例如分别标记为N0、N1、…、N255,并标记起始的灰阶最小值为Gray begin、终止的灰阶最大值为Gray end(例如,假设Gray begin=10,Gray end=240)。并且,例如,根据本公开的实施例,预设值可以取值15,预设灰阶均值可以取值140。 Specifically, the complete image frame is grayed out in operation S311 to obtain a corresponding grayscale image frame. Then, the amount of pixels corresponding to each grayscale value in the grayscale image frame may be scanned line by line, for example, labeled as N0, N1, ..., N255, respectively, and the minimum grayscale value of the marker is Gray begin , and the grayscale of the termination is maximum. The value is Gray end (for example, assume Gray begin = 10, Gray end = 240). Also, for example, according to an embodiment of the present disclosure, the preset value may take a value of 15, and the preset grayscale mean may take a value of 140.
在操作S312中计算灰阶值在区间[10,25]中的像素数量P 0=N10+N11+...+N25。 The number of pixels of the grayscale value in the interval [10, 25] is calculated in operation S312 P 0 = N10 + N11 + ... + N25.
在操作S313中计算灰阶值在区间[225,240]范围内的像素数量P 1=N225+N226+…+N240。 The number of pixels of the grayscale value in the range of the interval [225, 240] is calculated in operation S313 P 1 = N225 + N226 + ... + N240.
在操作S313中,计算该灰度图像帧中除人脸区域以外的区域的灰度均值Gray AveIn operation S313, the gradation mean Gray Ave of the region other than the face region in the grayscale image frame is calculated.
然后在操作S314中判定P0、P1、Gray Ave是否满足:P0>P1且Gray Ave<140。如果满足,则确定采集该人脸图像时的光源环境为近红外光,否则为可见光。 It is then determined in operation S314 whether P0, P1, and Gray Ave are satisfied: P0 > P1 and Gray Ave < 140. If it is satisfied, it is determined that the light source environment when the face image is acquired is near-infrared light, otherwise it is visible light.
最后在操作S220中,根据采集该人脸图像时所处的光源环境进行人脸识别。对在操作S210中获得人人脸图像进行特征提取等,并与同质光源类型下的人脸图进行比对,实现了注册时的光源条件与识别认证时的光源环境的一致性。Finally, in operation S220, face recognition is performed according to the light source environment in which the face image is collected. The feature extraction is performed on the face image obtained in operation S210, and compared with the face map under the homogeneous light source type, and the consistency between the light source condition at the time of registration and the light source environment at the time of authentication is realized.
根据本公开的实施例,该人脸识别方法还包括同时在可见光条件下和近红外光条件下分别注册人脸图。通过同时注册可以保证在可见光和近红外条件下注册获得的人脸图(包括表情、获取的位置高低等)的一致性,减少因为注册图像的差异而给识别过程带来的误差。According to an embodiment of the present disclosure, the face recognition method further includes separately registering a face map under visible light conditions and near-infrared light conditions. By registering at the same time, the consistency of the face map (including the expression, the position of the acquired position, etc.) obtained by registration under visible light and near-infrared conditions can be ensured, and the error caused by the recognition process due to the difference of the registered image can be reduced.
图8示意性示出了根据本公开实施例的人脸识别装置的框图。FIG. 8 schematically shows a block diagram of a face recognition device in accordance with an embodiment of the present disclosure.
如图8所示,装置800该装置包括获取模块810和识别模块820。As shown in FIG. 8, device 800 includes an acquisition module 810 and an identification module 820.
获取模块810用于获取人脸图像。The obtaining module 810 is configured to acquire a face image.
识别模块820用于根据采集该人脸图像时所处的光源环境进行人脸识别。识别模块820具体用于在采集该人脸图像时所处的光源环境是可见光的情况下,将该人脸图像与在可见光条件下注册的人脸图进行比对识别;或者,在采集该人脸图像时所处的光源环境是近红外光的情况下,将该人脸图像与近红外光条件下注册的人脸图进行比对识别。The identification module 820 is configured to perform face recognition according to a light source environment in which the face image is collected. The identification module 820 is specifically configured to compare the face image with a face image registered under visible light conditions when the light source environment in which the face image is collected is visible light; or, collect the person In the case where the light source environment in which the face image is located is near-infrared light, the face image is compared with the face map registered under the near-infrared light condition.
根据本公开的实施例,该装置还包括光源判断模块830。According to an embodiment of the present disclosure, the apparatus further includes a light source determination module 830.
光源判断模块830用于判断采集该人脸图像时所处的光源环境是可见光还是近红外光。The light source determining module 830 is configured to determine whether the light source environment in which the face image is collected is visible light or near-infrared light.
根据本公开的实施例,获取模块810包括完整图像帧获取子模块811、人脸区域获取子模块812、以及人脸图像提取子模块813。According to an embodiment of the present disclosure, the acquisition module 810 includes a full image frame acquisition sub-module 811, a face region acquisition sub-module 812, and a face image extraction sub-module 813.
完整图像帧获取子模块811用于获取包括人脸和背景环境的完整图像帧。The complete image frame acquisition sub-module 811 is used to acquire a complete image frame including a face and a background environment.
人脸区域获取子模块812用于从该完整图像帧中获取人脸区域。The face region acquisition sub-module 812 is configured to acquire a face region from the complete image frame.
人脸图像提取子模块813用于从该人脸区域提取该人脸图像。The face image extraction sub-module 813 is configured to extract the face image from the face region.
根据本公开的实施例,光源判断模830包括灰度化子模块831和光源判断子模块832。According to an embodiment of the present disclosure, the light source determination mode 830 includes a grayscale sub-module 831 and a light source determination sub-module 832.
灰度化子模块831用于灰度化该完整图像帧,得到灰度图像帧。The grayscale sub-module 831 is used to grayscale the complete image frame to obtain a grayscale image frame.
光源判断子模块832用于根据该灰度图像帧中灰阶的分布判断采集该人脸图像时所处的光源环境是可见光还是近红外。The light source determining sub-module 832 is configured to determine, according to the distribution of gray scales in the grayscale image frame, whether the light source environment in which the face image is collected is visible light or near-infrared.
根据本公开的实施例,根据该灰度图像帧中灰阶的分布确定采集该人脸图像时所处的光源环境是可见光还是近红外,包括:计算该灰度图像帧中灰阶值在起始闭区间内的第一像素数量,其中,该起始闭区间的一个端点为该灰度图像帧的灰阶最小值,另一个端点为该灰阶最小值加上预设值;计算该灰度图像帧中灰阶值在终止闭区间内的第二像素数量,其中,该终止闭区间的一个端点为该灰度图像帧的灰阶最大值减去该预设值,另一个端点为该灰阶最大值;计算该灰度图像帧中除该人脸区域以外的区域的灰阶平均值;以及当该第一像素数量大于第二像素数量,并且该灰阶平均值小于预设灰阶均值时,判断采集该人脸图像时所处的光源环境是近红外光,否则判断采集该人脸图像时所处的光源环境是可见光。According to an embodiment of the present disclosure, determining, according to the distribution of gray scales in the grayscale image frame, whether the light source environment in which the face image is captured is visible light or near infrared, including: calculating a grayscale value in the grayscale image frame. a first number of pixels in the initial closed interval, wherein one end of the initial closed interval is a gray level minimum of the gray image frame, and the other end point is the gray level minimum plus a preset value; The second pixel number of the grayscale value in the ending closed interval, wherein one end point of the termination closed interval is the grayscale maximum value of the grayscale image frame minus the preset value, and the other endpoint is the a grayscale maximum value; calculating a grayscale average value of the region other than the face region in the grayscale image frame; and when the first pixel number is greater than the second pixel number, and the grayscale average value is less than a preset grayscale In the mean value, it is judged that the light source environment in which the face image is collected is near-infrared light, otherwise the light source environment in which the face image is collected is visible light.
根据本公开的实施例,该预设值包括15。根据本公开的实施例,该预设灰阶均值包括140。According to an embodiment of the present disclosure, the preset value includes 15. According to an embodiment of the present disclosure, the preset grayscale mean comprises 140.
根据本公开的实施例,该装置还包括注册模块840。该注册模块840用于同时在可见光条件下和近红外光条件下分别注册人脸图。According to an embodiment of the present disclosure, the apparatus further includes a registration module 840. The registration module 840 is configured to separately register a face map under visible light conditions and near-infrared light conditions.
根据本公开的实施例,该装置800可以用于实现参考图2~图7所描述的人脸识别方法。According to an embodiment of the present disclosure, the apparatus 800 may be used to implement the face recognition method described with reference to FIGS. 2 to 7.
可以理解的是,根据本公开的实施例的模块、子模块、单元、子单元中的任意多个、或其中任意多个的至少部分功能可以在一个模块中实现。根据本公开实施例的模块、子模块、单元、子单元中的任意一个或多个可以被拆分成多个模块来实现。根据本公开实施例的模块、子模块、单元、子单元中的任意一个或多个可以至少被部分地实现为硬件电路,例如现场可编程门阵列(FPGA)、可编程逻辑阵列(PLA)、片上系统、基板上的系统、封装上的系统、专用集成电路(ASIC),或可以通过对电路进行集成或封装的任何其他的合理方式的硬件或固件来实现,或以软件、硬件以及固件三种实现方式中任意一种或以其中任意几种的适当组合来实现。或者,根据本公开实施例的模块、子模块、单元、子单元中的一个或多个可以至少被部分地实现为计算机程序模块,当该计算机程序模块被运行时,可以执行相应的功能。It is to be understood that any of the modules, sub-modules, units, sub-units, or at least some of the functions of any of the plurality of the embodiments of the present disclosure may be implemented in one module. Any one or more of the modules, sub-modules, units, sub-units according to an embodiment of the present disclosure may be implemented by being split into a plurality of modules. Any one or more of the modules, sub-modules, units, sub-units in accordance with embodiments of the present disclosure may be implemented at least in part as hardware circuitry, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), System-on-a-chip, system on a substrate, system on a package, an application specific integrated circuit (ASIC), or any other reasonable means of hardware or firmware that integrates or encapsulates the circuit, or in software, hardware, and firmware. Any one of the implementations or in any suitable combination of any of them. Alternatively, one or more of the modules, sub-modules, units, sub-units in accordance with embodiments of the present disclosure may be implemented at least in part as a computer program module that, when executed, can perform the corresponding functions.
例如,获取模块810、识别模块820、光源判断模块830、注册模块840、完整图像帧获取子模块811、人脸区域获取子模块812、人脸图像提取子模块813、灰度化子模块831以及光源判断子模块832可以合并在一个模块中实现,或者其中的任意一个模块可以被拆分成多个模块。或者,这些模块中的一个或多个模块的至少部分功能可以与其他模块的至少部分功能相结合,并在一个模块中实现。根据本发明的实施例,获取模块810、识别模块820、光源判断模块830、注册模块840、完整图像帧获取子模块811、人脸区域获取子模块812、人脸图像提取子模块813、灰度化子模块831以及光源判断子模块832中的至少一个可以至少被部分地实现为硬件电路,例如现场可编程门阵列(FPGA)、可编程逻辑阵列(PLA)、片上系统、基板上的系统、封装上的系统、专用集成电路(ASIC),或可以以对电路进行集成或封装的任何其他的合理方式等硬件或固件来实现,或以软件、硬件以及固件三种实现方式的适当组合来实现。或者,获取模块810、识别模块820、光源判断模块830、注册模块840、完整图像帧获取子模块811、人脸区域获取子模块812、人脸图像提取子模块813、灰度化子模块831以及光源判断子模块832中的至少一个可以至少被部分地实现为计算机程序模块,当该程序被计算机运行时,可以执行相应模块的功能。For example, the obtaining module 810, the identifying module 820, the light source determining module 830, the registration module 840, the complete image frame obtaining sub-module 811, the face region obtaining sub-module 812, the face image extracting sub-module 813, the graying sub-module 831, and The light source determination sub-module 832 can be implemented in one module, or any one of the modules can be split into multiple modules. Alternatively, at least some of the functionality of one or more of the modules may be combined with at least some of the functionality of the other modules and implemented in one module. According to an embodiment of the present invention, the obtaining module 810, the identifying module 820, the light source determining module 830, the registration module 840, the complete image frame obtaining sub-module 811, the face region obtaining sub-module 812, the face image extracting sub-module 813, and the grayscale At least one of the sub-module 831 and the light source determination sub-module 832 can be implemented at least in part as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, A system, an application specific integrated circuit (ASIC) on the package, or hardware or firmware in any other reasonable manner to integrate or package the circuit, or in a suitable combination of software, hardware, and firmware implementations. . Alternatively, the obtaining module 810, the identifying module 820, the light source determining module 830, the registration module 840, the complete image frame obtaining sub-module 811, the face region obtaining sub-module 812, the face image extracting sub-module 813, the graying sub-module 831, and At least one of the light source determination sub-modules 832 may be implemented at least in part as a computer program module that, when executed by the computer, may perform the functions of the respective modules.
图9示意性示出了根据本公开实施例的适于实现机器人的计算机系统的方框图。图9示出的计算机系统仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。FIG. 9 schematically illustrates a block diagram of a computer system suitable for implementing a robot in accordance with an embodiment of the present disclosure. The computer system shown in FIG. 9 is merely an example and should not impose any limitation on the function and scope of use of the embodiments of the present disclosure.
如图9所示,根据本公开实施例的计算机系统900包括处理器901,其可以根据存储在只读存储器(ROM)902中的程序或者从存储部分908加载到随机访问存储器(RAM)903中的程序而执行各种适当的动作和处理。处理器901例如可以包括通用微处理器(例如CPU)、 指令集处理器和/或相关芯片组和/或专用微处理器(例如,专用集成电路(ASIC)),等等。处理器901还可以包括用于缓存用途的板载存储器。处理器901可以包括用于执行参考图2~图7描述的根据本公开实施例的方法流程的不同动作的单一处理单元或者是多个处理单元。As shown in FIG. 9, a computer system 900 in accordance with an embodiment of the present disclosure includes a processor 901 that can be loaded into a random access memory (RAM) 903 according to a program stored in a read only memory (ROM) 902 or from a storage portion 908. The program performs various appropriate actions and processes. Processor 901 may, for example, comprise a general purpose microprocessor (e.g., a CPU), an instruction set processor, and/or a related chipset and/or a special purpose microprocessor (e.g., an application specific integrated circuit (ASIC)), and the like. Processor 901 may also include an onboard memory for caching purposes. The processor 901 may include a single processing unit or a plurality of processing units for performing different actions of the method flow according to the embodiments of the present disclosure described with reference to FIGS. 2-7.
在RAM 903中,存储有系统900操作所需的各种程序和数据。处理器901、ROM 902以及RAM 903通过总线904彼此相连。处理器901通过执行ROM 902和/或RAM 903中的程序来执行以上参考图2~图7描述的人脸识别方法的各种操作。需要注意,该程序也可以存储在除ROM 902和RAM 903以外的一个或多个存储器中。处理器901也可以通过执行存储在该一个或多个存储器中的程序来执行以上参考图2~图7描述的人脸识别方法的各种操作。In the RAM 903, various programs and data required for the operation of the system 900 are stored. The processor 901, the ROM 902, and the RAM 903 are connected to each other through a bus 904. The processor 901 performs various operations of the face recognition method described above with reference to FIGS. 2 to 7 by executing programs in the ROM 902 and/or the RAM 903. It is noted that the program can also be stored in one or more memories other than the ROM 902 and the RAM 903. The processor 901 can also perform various operations of the face recognition method described above with reference to FIGS. 2 to 7 by executing a program stored in the one or more memories.
根据本公开的实施例,系统900还可以包括输入/输出(I/O)接口905,输入/输出(I/O)接口905也连接至总线904。系统900还可以包括连接至I/O接口905的以下部件中的一项或多项:包括键盘、鼠标等的输入部分906;包括诸如阴极射线管(CRT)、液晶显示器(LCD)等以及扬声器等的输出部分907;包括硬盘等的存储部分908;以及包括诸如LAN卡、调制解调器等的网络接口卡的通信部分909。通信部分909经由诸如因特网的网络执行通信处理。驱动器610也根据需要连接至I/O接口905。可拆卸介质911,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器910上,以便于从其上读出的计算机程序根据需要被安装入存储部分908。 System 900 may also include an input/output (I/O) interface 905 to which an input/output (I/O) interface 905 is also coupled, in accordance with an embodiment of the present disclosure. System 900 can also include one or more of the following components coupled to I/O interface 905: an input portion 906 including a keyboard, mouse, etc.; including, for example, a cathode ray tube (CRT), a liquid crystal display (LCD), and the like, and a speaker An output portion 907 of the like; a storage portion 908 including a hard disk or the like; and a communication portion 909 including a network interface card such as a LAN card, a modem, and the like. The communication section 909 performs communication processing via a network such as the Internet. Driver 610 is also coupled to I/O interface 905 as needed. A removable medium 911 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory or the like is mounted on the drive 910 as needed so that a computer program read therefrom is installed into the storage portion 908 as needed.
根据本公开的实施例,上文参考流程图描述的方法可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分909从网络上被下载和安装,和/或从可拆卸介质911被安装。在该计算机程序被处理器901执行时,执行本公开实施例的系统中限定的上述功能。根据本公开的实施例,上文描述的系统、设备、装置、模块、单元等可以通过计算机程序模块来实现。According to an embodiment of the present disclosure, the method described above with reference to the flowcharts may be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for executing the method illustrated in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network via the communication portion 909, and/or installed from the removable medium 911. The above-described functions defined in the system of the embodiments of the present disclosure are executed when the computer program is executed by the processor 901. The systems, devices, devices, modules, units, and the like described above may be implemented by a computer program module in accordance with an embodiment of the present disclosure.
需要说明的是,本公开所示的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号, 其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:无线、电线、光缆、RF等等,或者上述的任意合适的组合。根据本公开的实施例,计算机可读介质可以包括上文描述的ROM 902和/或RAM903和/或ROM 902和RAM 903以外的一个或多个存储器。It should be noted that the computer readable medium shown in the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of computer readable storage media may include, but are not limited to, electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable Programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain or store a program, which can be used by or in connection with an instruction execution system, apparatus, or device. While in the present disclosure, a computer readable signal medium may include a data signal that is propagated in the baseband or as part of a carrier, carrying computer readable program code. Such propagated data signals can take a variety of forms including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the foregoing. The computer readable signal medium can also be any computer readable medium other than a computer readable storage medium, which can transmit, propagate, or transport a program for use by or in connection with the instruction execution system, apparatus, or device. . Program code embodied on a computer readable medium can be transmitted by any suitable medium, including but not limited to wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing. According to an embodiment of the present disclosure, the computer readable medium may include one or more memories other than the ROM 902 and/or the RAM 903 and/or the ROM 902 and the RAM 903 described above.
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,上述模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图或流程图中的每个方框、以及框图或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products in accordance with various embodiments of the present disclosure. In this regard, each block of the flowchart or block diagrams can represent a module, a program segment, or a portion of code that includes one or more Executable instructions. It should also be noted that in some alternative implementations, the functions noted in the blocks may also occur in a different order than that illustrated in the drawings. For example, two successively represented blocks may in fact be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending upon the functionality involved. It is also noted that each block of the block diagrams or flowcharts, and combinations of blocks in the block diagrams or flowcharts, can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be used A combination of dedicated hardware and computer instructions is implemented.
作为另一方面,本公开还提供了一种计算机可读介质,该计算机可读介质可以是上述实施例中描述的设备中所包含的;也可以是单独存在,而未装配入该设备中。上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被一个该设备执行时,使得该设备执行根据本公开实施例的人脸识别方法。In another aspect, the present disclosure also provides a computer readable medium, which may be included in the apparatus described in the above embodiments, or may be separately present and not incorporated into the apparatus. The computer readable medium described above carries one or more programs that, when executed by one of the devices, cause the device to perform a face recognition method in accordance with an embodiment of the present disclosure.
该方法包括获取人脸图像,以及根据采集该人脸图像时所处的光源环境进行人脸识别。根据采集该人脸图像时所处的光源环境进行人脸识别具体包括:在采集该人脸图像时所处的光源环境是可见光的情况下,将该人脸图像与在可见光条件下注册的人脸图进行比对识别;或者,在采集该人脸图像时所处的光源环境是近红外光的情况下,将该人脸图像与近红外光条件下注册的人脸图进行比对识别。The method includes acquiring a face image and performing face recognition according to a light source environment in which the face image is collected. Performing face recognition according to the light source environment in which the face image is collected specifically includes: when the light source environment in which the face image is collected is visible light, the face image is registered with the person under visible light conditions The face image is compared and recognized; or, when the light source environment in which the face image is collected is near-infrared light, the face image is compared with the face image registered under the near-infrared light condition.
根据本公开的实施例,该方法还包括判断采集该人脸图像时所处的光源环境是可见光还是近红外光。According to an embodiment of the present disclosure, the method further includes determining whether the light source environment in which the face image is acquired is visible light or near-infrared light.
根据本公开的实施例,获取人脸图像具体包括获取包括人脸和背景环境的完整图像帧,从该完整图像帧中获取人脸区域,以及从该人脸区域提取该人脸图像。判断采集该人脸图像时所处的光源环境是可见光还是近红外光,包括灰度化该完整图像帧,得到灰度图像帧,以及根据该灰度图像帧中灰阶的分布判断采集该人脸图像时所处的光源环境是可见光还是近红外光。According to an embodiment of the present disclosure, acquiring the face image specifically includes acquiring a complete image frame including a face and a background environment, acquiring a face region from the complete image frame, and extracting the face image from the face region. Determining whether the light source environment in which the face image is collected is visible light or near-infrared light, including graying out the complete image frame, obtaining a gray image frame, and determining the person according to the gray scale distribution in the gray image frame The light source environment in which the face image is located is visible light or near-infrared light.
根据本公开的实施例,根据该灰度图像帧中灰阶的分布判断采集该人脸图像时所处的光源环境是可见光还是近红外光包括多个操作过程;计算该灰度图像帧中灰阶值在起始闭区间内的第一像素数量,其中,该起始闭区间的一个端点为该灰度图像帧的灰阶最小值,另一个端点为该灰阶最小值加上预设值;计算该灰度图像帧中灰阶值在终止闭区间内的第二像素数量,其中,该终止闭区间的一个端点为该灰度图像帧的灰阶最大值减去该预设值,另一个端点为该灰阶最大值;计算该灰度图像帧中除该人脸区域以外的区域的灰阶平均值;当该第一像素数量大于第二像素数量,并且该灰阶平均值小于预设灰阶均值时,判断采集该人脸图像时所处的光源环境是近红外光;否则,判断采集该人脸图像时所处的光源环境是可见光。According to an embodiment of the present disclosure, determining, according to the distribution of gray scales in the grayscale image frame, whether the light source environment in which the face image is captured is visible light or near-infrared light includes a plurality of operation processes; calculating grayscale in the grayscale image frame The first pixel number of the order value in the initial closed interval, wherein one end point of the initial closed interval is the gray level minimum value of the gray image frame, and the other end point is the gray level minimum value plus a preset value Calculating a second pixel number of the grayscale value in the grayscale image frame in the termination closed interval, wherein an endpoint of the termination closed interval is a grayscale maximum value of the grayscale image frame minus the preset value, and An endpoint is the grayscale maximum; calculating a grayscale average of the region of the grayscale image frame other than the face region; when the first pixel number is greater than the second pixel number, and the grayscale average is less than When the gray level mean value is set, it is judged that the light source environment in which the face image is collected is near-infrared light; otherwise, the light source environment in which the face image is collected is visible light.
根据本公开的实施例,该预设值包括15。According to an embodiment of the present disclosure, the preset value includes 15.
根据本公开的实施例,该预设灰阶均值包括140。According to an embodiment of the present disclosure, the preset grayscale mean comprises 140.
根据本公开的实施例,该方法还包括同时在可见光条件下和近红外光条件下分别注册人脸图。According to an embodiment of the present disclosure, the method further includes separately registering the face map under visible light conditions and near-infrared light conditions.
以上对本公开的实施例进行了描述。但是,这些实施例仅仅是为了说明的目的,而并非为了限制本公开的范围。尽管在以上分别描述了各实施例,但是这并不意味着各个实施例中的措施不能有利地结合使用。本公开的范围由所附权利要求及其等同物限定。不脱离本公开的范围,本领域技术人员可以做出多种替代和修改,这些替代和修改都应落在本公开的范围之内。The embodiments of the present disclosure have been described above. However, the examples are for illustrative purposes only and are not intended to limit the scope of the disclosure. Although the various embodiments have been described above, this does not mean that the measures in the various embodiments are not advantageously used in combination. The scope of the disclosure is defined by the appended claims and their equivalents. Numerous alternatives and modifications may be made by those skilled in the art without departing from the scope of the present disclosure.

Claims (16)

  1. 一种人脸识别方法,包括:A face recognition method includes:
    获取人脸图像;Obtaining a face image;
    根据采集所述人脸图像时所处的光源环境进行人脸识别,包括:The face recognition is performed according to the light source environment in which the face image is collected, including:
    在采集所述人脸图像时所处的光源环境是可见光的情况下,将所述人脸图像与在可见光条件下注册的人脸图进行比对识别;或者In the case where the light source environment in which the face image is collected is visible light, the face image is compared and recognized with a face map registered under visible light conditions; or
    在采集所述人脸图像时所处的光源环境是近红外光的情况下,将所述人脸图像与近红外光条件下注册的人脸图进行比对识别。In the case where the light source environment in which the face image is collected is near-infrared light, the face image is compared with the face map registered under the near-infrared light condition.
  2. 根据权利要求1所述的方法,其中,还包括:The method of claim 1 further comprising:
    判断采集所述人脸图像时所处的光源环境是可见光还是近红外光。It is judged whether the light source environment in which the face image is collected is visible light or near-infrared light.
  3. 根据权利要求2所述的方法,其中:The method of claim 2 wherein:
    获取人脸图像,包括:Get face images, including:
    获取包括人脸和背景环境的完整图像帧;Get a complete image frame including the face and background environment;
    从所述完整图像帧中获取人脸区域;以及Obtaining a face region from the complete image frame;
    从所述人脸区域提取所述人脸图像;Extracting the face image from the face region;
    判断采集所述人脸图像时所处的光源环境是可见光还是近红外光,包括:Determining whether the light source environment in which the face image is collected is visible light or near-infrared light, including:
    灰度化所述完整图像帧,得到灰度图像帧;以及Grayscale the complete image frame to obtain a grayscale image frame;
    根据所述灰度图像帧中灰阶的分布判断采集所述人脸图像时所处的光源环境是可见光还是近红外光。Determining, according to the distribution of gray scales in the grayscale image frame, whether the light source environment in which the face image is collected is visible light or near-infrared light.
  4. 根据权利要求3所述的方法,其中,根据所述灰度图像帧中灰阶的分布判断采集所述人脸图像时所处的光源环境是可见光还是近红外光,包括:The method according to claim 3, wherein determining whether the light source environment in which the face image is captured is visible light or near-infrared light according to a distribution of gray scales in the grayscale image frame comprises:
    计算所述灰度图像帧中灰阶值在起始闭区间内的第一像素数量,其中,所述起始闭区间的一个端点为所述灰度图像帧的灰阶最小值,另一个端点为所述灰阶最小值加上预设值;Calculating a first pixel number of the grayscale value in the initial closed interval in the grayscale image frame, wherein one end point of the initial closed interval is a grayscale minimum value of the grayscale image frame, and the other end point Adding a preset value to the grayscale minimum value;
    计算所述灰度图像帧中灰阶值在终止闭区间内的第二像素数量,其中,所述终止闭区间的一个端点为所述灰度图像帧的灰阶最大值减去所述预设值,另一个端点为所述灰阶最大值;Calculating a second pixel number of the grayscale value in the grayscale image frame in the termination closed interval, wherein one end point of the termination closed interval is a grayscale maximum value of the grayscale image frame minus the preset Value, the other endpoint is the grayscale maximum;
    计算所述灰度图像帧中除所述人脸区域以外的区域的灰阶平均值;Calculating a grayscale average value of the region other than the face region in the grayscale image frame;
    当所述第一像素数量大于第二像素数量,并且所述灰阶平均值小于预设灰阶均值时,判断采集所述人脸图像时所处的光源环境是近红外光;否则,判断采集所述人脸图像时所处的光源环境是可见光。When the first pixel number is greater than the second pixel number, and the grayscale average value is less than the preset grayscale mean value, determining that the light source environment in which the face image is collected is near-infrared light; otherwise, determining the collection The light source environment in which the face image is located is visible light.
  5. 根据权利要求4所述的方法,其中,所述预设值包括15。The method of claim 4 wherein said predetermined value comprises 15.
  6. 根据权利要求4所述的方法,其中,所述预设灰阶均值包括140。The method of claim 4 wherein said predetermined grayscale mean comprises 140.
  7. 根据权利要求1所述的方法,还包括:The method of claim 1 further comprising:
    同时在可见光条件下和近红外光条件下分别注册人脸图。At the same time, the face map is registered separately under visible light conditions and near-infrared light conditions.
  8. 一种人脸识别装置,包括:A face recognition device comprising:
    获取模块,用于获取人脸图像;Obtaining a module for acquiring a face image;
    识别模块,用于根据采集所述人脸图像时所处的光源环境进行人脸识别,包括:An identification module, configured to perform face recognition according to a light source environment in which the face image is collected, including:
    在采集所述人脸图像时所处的光源环境是可见光的情况下,将所述人脸图像与在可见光条件下注册的人脸图进行比对识别;或者,In a case where the light source environment in which the face image is collected is visible light, the face image is compared and recognized with a face map registered under visible light conditions; or
    在采集所述人脸图像时所处的光源环境是近红外光的情况下,将所述人脸图像与近红外光条件下注册的人脸图进行比对识别。In the case where the light source environment in which the face image is collected is near-infrared light, the face image is compared with the face map registered under the near-infrared light condition.
  9. 根据权利要求8所述的装置,其中,还包括:The apparatus of claim 8 further comprising:
    光源判断模块,用于判断采集所述人脸图像时所处的光源环境是可见光还是近红外光。The light source determining module is configured to determine whether the light source environment in which the face image is collected is visible light or near-infrared light.
  10. 根据权利要求9所述的装置,其中:The device of claim 9 wherein:
    获取模块,包括:Get the module, including:
    完整图像帧获取子模块,用于获取包括人脸和背景环境的完整图像帧;a complete image frame acquisition sub-module for acquiring a complete image frame including a face and a background environment;
    人脸区域获取子模块,用于从所述完整图像帧中获取人脸区域;以及a face area acquisition sub-module for acquiring a face area from the complete image frame;
    人脸图像提取子模块,用于从所述人脸区域提取所述人脸图像;a face image extraction sub-module, configured to extract the face image from the face region;
    光源判断模块包括:The light source judgment module includes:
    灰度化子模块,用于灰度化所述完整图像帧,得到灰度图像帧;以及a grayscale sub-module for graying out the complete image frame to obtain a grayscale image frame;
    光源判断子模块,用于根据所述灰度图像帧中灰阶的分布判断采集所述人脸图像时所处的光源环境是可见光还是近红外光。The light source determining sub-module is configured to determine, according to the distribution of gray scales in the grayscale image frame, whether the light source environment in which the facial image is collected is visible light or near-infrared light.
  11. 根据权利要求10所述的装置,其中,根据所述灰度图像帧中灰阶的分布确定采集所述人脸图像时所处的光源环境是可见光还是近红外光,包括:The apparatus according to claim 10, wherein determining whether the light source environment in which the face image is captured is visible light or near-infrared light according to a distribution of gray scales in the grayscale image frame comprises:
    计算所述灰度图像帧中灰阶值在起始闭区间内的第一像素数量,其中,所述起始闭区间的一个端点为所述灰度图像帧的灰阶最小值,另一个端点为所述灰阶最小值加上预设值;Calculating a first pixel number of the grayscale value in the initial closed interval in the grayscale image frame, wherein one end point of the initial closed interval is a grayscale minimum value of the grayscale image frame, and the other end point Adding a preset value to the grayscale minimum value;
    计算所述灰度图像帧中灰阶值在终止闭区间内的第二像素数量,其中,所述终止闭区间的一个端点为所述灰度图像帧的灰阶最大值减去所述预设值,另一个端点为所述灰阶最大值;Calculating a second pixel number of the grayscale value in the grayscale image frame in the termination closed interval, wherein one end point of the termination closed interval is a grayscale maximum value of the grayscale image frame minus the preset Value, the other endpoint is the grayscale maximum;
    计算所述灰度图像帧中除所述人脸区域以外的区域的灰阶平均值;Calculating a grayscale average value of the region other than the face region in the grayscale image frame;
    当所述第一像素数量大于第二像素数量,并且所述灰阶平均值小于预设灰阶均值时,判断采集所述人脸图像时所处的光源环境是近红外光;否则,判断采集所述人脸图像时所处的光源环境是可见光。When the first pixel number is greater than the second pixel number, and the grayscale average value is less than the preset grayscale mean value, determining that the light source environment in which the face image is collected is near-infrared light; otherwise, determining the collection The light source environment in which the face image is located is visible light.
  12. 根据权利要求11所述的装置,其中,所述预设值包括15。The apparatus of claim 11 wherein said predetermined value comprises 15.
  13. 根据权利要求11所述的装置,其中,所述预设灰阶均值包括140。The apparatus of claim 11 wherein said predetermined grayscale mean comprises 140.
  14. 根据权利要求8所述的装置,还包括:The apparatus of claim 8 further comprising:
    注册模块,用于同时在可见光条件下和近红外光条件下分别注册人脸图。The registration module is configured to register the face map separately under visible light conditions and near-infrared light conditions.
  15. 一种人脸识别的系统,包括:A system for face recognition, comprising:
    一个或多个处理器;One or more processors;
    存储器,用于存储一个或多个程序,Memory for storing one or more programs,
    其中,当所述一个或多个程序被所述一个或多个处理器执行时,使得所述一个或多个处理器实现根据权利要求1~7任意一项所述的方法。Wherein the one or more programs are executed by the one or more processors, such that the one or more processors implement the method of any one of claims 1-7.
  16. 一种计算机可读介质,其上存储有可执行指令,该指令被处理器执行时使处理器实现根据权利要求1~7任意一项所述的方法。A computer readable medium having stored thereon executable instructions that, when executed by a processor, cause a processor to implement the method of any one of claims 1-7.
PCT/CN2018/108994 2017-12-28 2018-09-30 Human facial recognition method, apparatus and system, and medium WO2019128362A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201711471179.9A CN109977741A (en) 2017-12-28 2017-12-28 Face identification method, device, system and medium
CN201711471179.9 2017-12-28

Publications (1)

Publication Number Publication Date
WO2019128362A1 true WO2019128362A1 (en) 2019-07-04

Family

ID=67065050

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/108994 WO2019128362A1 (en) 2017-12-28 2018-09-30 Human facial recognition method, apparatus and system, and medium

Country Status (2)

Country Link
CN (1) CN109977741A (en)
WO (1) WO2019128362A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110532992A (en) * 2019-09-04 2019-12-03 深圳市捷顺科技实业股份有限公司 A kind of face identification method based on visible light and near-infrared
CN110826535A (en) * 2019-12-02 2020-02-21 北京三快在线科技有限公司 Face recognition method, system and device
CN111325139A (en) * 2020-02-18 2020-06-23 浙江大华技术股份有限公司 Lip language identification method and device
CN114898429A (en) * 2022-05-10 2022-08-12 电子科技大学 Thermal infrared-visible light cross-modal face recognition method
CN115063855A (en) * 2022-06-15 2022-09-16 南京史徕克网络科技有限公司 Face recognition method and system based on feature grouping

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006003612A1 (en) * 2004-07-02 2006-01-12 Koninklijke Philips Electronics N.V. Face detection and/or recognition
CN101526991A (en) * 2008-03-03 2009-09-09 联想(北京)有限公司 Notebook computer and face recognition method thereof
CN202197300U (en) * 2010-08-05 2012-04-18 北京海鑫智圣技术有限公司 Mobile face identification system
CN102831379A (en) * 2011-06-14 2012-12-19 汉王科技股份有限公司 Face image recognition method and device
CN103400108A (en) * 2013-07-10 2013-11-20 北京小米科技有限责任公司 Face identification method and device as well as mobile terminal
CN103902962A (en) * 2012-12-28 2014-07-02 汉王科技股份有限公司 Shielding or light source self-adaption human face recognition method and device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101964056B (en) * 2010-10-26 2012-06-27 徐勇 Bimodal face authentication method with living body detection function and system
US10452894B2 (en) * 2012-06-26 2019-10-22 Qualcomm Incorporated Systems and method for facial verification
CN106372615A (en) * 2016-09-19 2017-02-01 厦门中控生物识别信息技术有限公司 Face anti-counterfeiting identification method and apparatus

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006003612A1 (en) * 2004-07-02 2006-01-12 Koninklijke Philips Electronics N.V. Face detection and/or recognition
CN101526991A (en) * 2008-03-03 2009-09-09 联想(北京)有限公司 Notebook computer and face recognition method thereof
CN202197300U (en) * 2010-08-05 2012-04-18 北京海鑫智圣技术有限公司 Mobile face identification system
CN102831379A (en) * 2011-06-14 2012-12-19 汉王科技股份有限公司 Face image recognition method and device
CN103902962A (en) * 2012-12-28 2014-07-02 汉王科技股份有限公司 Shielding or light source self-adaption human face recognition method and device
CN103400108A (en) * 2013-07-10 2013-11-20 北京小米科技有限责任公司 Face identification method and device as well as mobile terminal

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110532992A (en) * 2019-09-04 2019-12-03 深圳市捷顺科技实业股份有限公司 A kind of face identification method based on visible light and near-infrared
CN110532992B (en) * 2019-09-04 2023-01-10 深圳市捷顺科技实业股份有限公司 Human face recognition method based on visible light and near infrared
CN110826535A (en) * 2019-12-02 2020-02-21 北京三快在线科技有限公司 Face recognition method, system and device
CN111325139A (en) * 2020-02-18 2020-06-23 浙江大华技术股份有限公司 Lip language identification method and device
CN111325139B (en) * 2020-02-18 2023-08-04 浙江大华技术股份有限公司 Lip language identification method and device
CN114898429A (en) * 2022-05-10 2022-08-12 电子科技大学 Thermal infrared-visible light cross-modal face recognition method
CN114898429B (en) * 2022-05-10 2023-05-30 电子科技大学 Thermal infrared-visible light cross-modal face recognition method
CN115063855A (en) * 2022-06-15 2022-09-16 南京史徕克网络科技有限公司 Face recognition method and system based on feature grouping

Also Published As

Publication number Publication date
CN109977741A (en) 2019-07-05

Similar Documents

Publication Publication Date Title
WO2019128362A1 (en) Human facial recognition method, apparatus and system, and medium
CN108898086B (en) Video image processing method and device, computer readable medium and electronic equipment
US11244435B2 (en) Method and apparatus for generating vehicle damage information
US11392792B2 (en) Method and apparatus for generating vehicle damage information
WO2018086543A1 (en) Living body identification method, identity authentication method, terminal, server and storage medium
WO2019033572A1 (en) Method for detecting whether face is blocked, device and storage medium
WO2019001481A1 (en) Vehicle appearance feature identification and vehicle search method and apparatus, storage medium, and electronic device
CN108734185B (en) Image verification method and device
WO2019149186A1 (en) Method and apparatus for generating information
WO2021083069A1 (en) Method and device for training face swapping model
US11367310B2 (en) Method and apparatus for identity verification, electronic device, computer program, and storage medium
WO2020107951A1 (en) Image-based product checkout method and apparatus, medium, and electronic device
CN110660102B (en) Speaker recognition method, device and system based on artificial intelligence
CN108388889B (en) Method and device for analyzing face image
CN108509994B (en) Method and device for clustering character images
JP2016062253A (en) Object identification apparatus, object identification method, and program
CN110941978B (en) Face clustering method and device for unidentified personnel and storage medium
CA3052846A1 (en) Character recognition method, device, electronic device and storage medium
WO2020007191A1 (en) Method and apparatus for living body recognition and detection, and medium and electronic device
CN111368657A (en) Cow face identification method and device
CN114332993A (en) Face recognition method and device, electronic equipment and computer readable storage medium
CN111784660B (en) Method and system for analyzing frontal face degree of face image
CN108875553A (en) Method, apparatus, system and the computer storage medium that the testimony of a witness is veritified
CN111899239A (en) Image processing method and device
CN108446737B (en) Method and device for identifying objects

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: 18893439

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 PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 28/09/2020)

122 Ep: pct application non-entry in european phase

Ref document number: 18893439

Country of ref document: EP

Kind code of ref document: A1