TWI716008B - Face recognition method and device - Google Patents

Face recognition method and device Download PDF

Info

Publication number
TWI716008B
TWI716008B TW108121633A TW108121633A TWI716008B TW I716008 B TWI716008 B TW I716008B TW 108121633 A TW108121633 A TW 108121633A TW 108121633 A TW108121633 A TW 108121633A TW I716008 B TWI716008 B TW I716008B
Authority
TW
Taiwan
Prior art keywords
face
image
target
rgb image
rgb
Prior art date
Application number
TW108121633A
Other languages
Chinese (zh)
Other versions
TW202009785A (en
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 TW202009785A publication Critical patent/TW202009785A/en
Application granted granted Critical
Publication of TWI716008B publication Critical patent/TWI716008B/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
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/50Depth or shape recovery
    • G06T7/55Depth or shape recovery from multiple images
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30196Human being; Person
    • G06T2207/30201Face

Landscapes

  • Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Health & Medical Sciences (AREA)
  • Multimedia (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)
  • Collating Specific Patterns (AREA)

Abstract

本說明書實施例提供一種人臉識別方法及裝置,該方法包括:獲取用於人臉識別的RGB圖像和對應的深度圖像;從RGB圖像中選擇目標人臉;根據目標人臉和深度圖像判斷RGB圖像中是否存在干擾人臉;若不存在,則基於目標人臉進行人臉識別。本說明書實施例中,在對包含多個人臉的RGB圖像進行人臉識別時,可以結合對應的深度圖像來確定RGB圖像中用於人臉識別的人臉。由於深度圖像中包含的資訊比較豐富、且深度圖像可以反映該深度圖像中的各人臉到圖像採集設備的距離、且人臉到圖像採集設備的距離可以從一定程度上反映使用者的人臉識別意願,因此本說明書實施例可以避免RGB圖像中人臉的漏檢以及準確地確定出RGB圖像中用於人臉識別的人臉。The embodiments of this specification provide a face recognition method and device. The method includes: acquiring an RGB image and a corresponding depth image for face recognition; selecting a target face from the RGB image; according to the target face and depth The image judges whether there is an interfering face in the RGB image; if it does not exist, face recognition is performed based on the target face. In the embodiments of this specification, when performing face recognition on an RGB image containing multiple human faces, the corresponding depth image can be combined to determine the face used for face recognition in the RGB image. Since the information contained in the depth image is relatively rich, and the depth image can reflect the distance between each face in the depth image and the image capture device, and the distance between the face and the image capture device can reflect to a certain extent The user's face recognition willingness, therefore, the embodiments of this specification can avoid the missed detection of the face in the RGB image and accurately determine the face used for face recognition in the RGB image.

Description

人臉識別方法及裝置Face recognition method and device

本申請涉及電腦技術領域,尤其涉及一種人臉識別方法及裝置。This application relates to the field of computer technology, in particular to a face recognition method and device.

近年來,隨著人臉識別技術的發展,“刷臉”可以應用的場景越來越多,例如刷臉支付、刷臉打卡簽到、刷臉解鎖門禁、刷臉認證辦事等,具有操作方便、快捷等特點。但是,當用於刷臉的RGB圖像中存在多個人臉時,難以確定對該RGB圖像中的哪個人臉進行識別,進而導致識別失敗或識別錯誤給使用者帶來損失,因此,需要提出一種人臉識別方法。In recent years, with the development of face recognition technology, more and more scenarios can be applied to "face-swiping", such as face-swiping payment, face-swiping card sign-in, face-swiping to unlock access control, face-authentication, etc. It has convenient operation, Fast and other features. However, when there are multiple human faces in the RGB image used for face brushing, it is difficult to determine which face in the RGB image to recognize, which in turn leads to recognition failure or recognition error to the user. Therefore, it is necessary to A face recognition method is proposed.

本說明書實施例的目的是提供一種人臉識別方法及裝置,本說明書實施例是這樣實現的: 第一態樣,提供了一種人臉識別方法,所述方法包括: 獲取用於人臉識別的RGB圖像和對應的深度圖像,所述RGB圖像中包含至少一個人臉; 從所述RGB圖像中選擇目標人臉; 根據所述目標人臉和所述深度圖像,判斷所述RGB圖像中是否存在干擾人臉,所述干擾人臉到人臉圖像採集設備的距離與所述目標人臉到所述人臉圖像採集設備的距離的差值小於預設閾值; 如果所述RGB圖像中不存在所述干擾人臉,則基於所述目標人臉進行人臉識別。 第二態樣,提供了一種人臉識別裝置,所述裝置包括: 獲取模組,用於獲取用於人臉識別的RGB圖像和對應的深度圖像,所述RGB圖像中包含至少一個人臉; 選擇模組,用於從所述RGB圖像中選擇目標人臉; 判斷模組,用於根據所述目標人臉和所述深度圖像,判斷所述RGB圖像中是否存在干擾人臉,所述干擾人臉到人臉圖像採集設備的距離與所述目標人臉到所述人臉圖像採集設備的距離的差值小於預設閾值; 識別模組,用於在所述RGB圖像中不存在所述干擾人臉的情況下,基於所述目標人臉進行人臉識別。 第三態樣,提供了一種電子設備,包括: 處理器;以及 被安排成儲存電腦可執行指令的記憶體,所述可執行指令在被執行時使所述處理器執行以下操作: 獲取用於人臉識別的RGB圖像和對應的深度圖像,所述RGB圖像中包含至少一個人臉; 從所述RGB圖像中選擇目標人臉; 根據所述目標人臉和所述深度圖像,判斷所述RGB圖像中是否存在干擾人臉,所述干擾人臉到人臉圖像採集設備的距離與所述目標人臉到所述人臉圖像採集設備的距離的差值小於預設閾值; 如果所述RGB圖像中不存在所述干擾人臉,則基於所述目標人臉進行人臉識別。 第四態樣,提供了一種電腦儲存媒體,所述電腦可讀儲存媒體儲存一個或多個程式,所述一個或多個程式當被包括多個應用程式的電子設備執行時,使得所述電子設備執行以下操作: 獲取用於人臉識別的RGB圖像和對應的深度圖像,所述RGB圖像中包含至少一個人臉; 從所述RGB圖像中選擇目標人臉; 根據所述目標人臉和所述深度圖像,判斷所述RGB圖像中是否存在干擾人臉,所述干擾人臉到人臉圖像採集設備的距離與所述目標人臉到所述人臉圖像採集設備的距離的差值小於預設閾值; 如果所述RGB圖像中不存在所述干擾人臉,則基於所述目標人臉進行人臉識別。 由以上本說明書實施例提供的技術方案可見,本說明書實施例中,在對包含多個人臉的RGB圖像進行人臉識別時,可以結合該RGB圖像對應的深度圖像,來確定該RGB圖像中用於人臉識別的人臉。相對於僅僅依據RGB圖像進行人臉識別,本說明書實施例中,由於深度圖像中包含的資訊比較豐富、且深度圖像可以反映該深度圖像中的各人臉到圖像採集設備的距離、且人臉到圖像採集設備的距離可以從一定程度上反映了使用者的人臉識別意願,因此本說明書實施例可以避免RGB圖像中人臉的漏檢,以及可以比較準確地確定出RGB圖像中用於人臉識別的人臉。The purpose of the embodiments of this specification is to provide a face recognition method and device. The embodiments of this specification are implemented as follows: In the first aspect, a face recognition method is provided, and the method includes: Acquiring an RGB image used for face recognition and a corresponding depth image, where the RGB image contains at least one face; Selecting a target face from the RGB image; According to the target face and the depth image, it is determined whether there is an interfering face in the RGB image, and the distance from the interfering face to the face image acquisition device is the same as the distance from the target face to the person The difference in the distance of the face image acquisition device is less than a preset threshold; If the interfering face does not exist in the RGB image, face recognition is performed based on the target face. In a second aspect, a face recognition device is provided, and the device includes: An acquisition module for acquiring an RGB image and a corresponding depth image for face recognition, the RGB image contains at least one face; A selection module for selecting a target face from the RGB image; The judgment module is used to judge whether there is an interference face in the RGB image based on the target face and the depth image, and the distance between the interference face and the face image acquisition device is the same as that of the target The difference in the distance between the face and the face image collection device is less than a preset threshold; The recognition module is configured to perform face recognition based on the target face when the interfering face does not exist in the RGB image. The third aspect provides an electronic device, including: Processor; and A memory arranged to store computer-executable instructions, which when executed, cause the processor to perform the following operations: Acquiring an RGB image used for face recognition and a corresponding depth image, where the RGB image contains at least one face; Selecting a target face from the RGB image; According to the target face and the depth image, it is determined whether there is an interfering face in the RGB image, and the distance from the interfering face to the face image acquisition device is the same as the distance from the target face to the person The difference in the distance of the face image acquisition device is less than a preset threshold; If the interfering face does not exist in the RGB image, face recognition is performed based on the target face. In a fourth aspect, a computer storage medium is provided. The computer-readable storage medium stores one or more programs. When the one or more programs are executed by an electronic device including a plurality of application programs, the electronic The device performs the following operations: Acquiring an RGB image used for face recognition and a corresponding depth image, where the RGB image contains at least one face; Selecting a target face from the RGB image; According to the target face and the depth image, it is determined whether there is an interfering face in the RGB image, and the distance from the interfering face to the face image acquisition device is the same as the distance from the target face to the person The difference in the distance of the face image acquisition device is less than a preset threshold; If the interfering face does not exist in the RGB image, face recognition is performed based on the target face. It can be seen from the technical solutions provided by the above embodiments of this specification that, in the embodiments of this specification, when performing face recognition on an RGB image containing multiple faces, the depth image corresponding to the RGB image can be combined to determine the RGB The face in the image used for face recognition. Compared with the face recognition based only on RGB images, in the embodiments of this specification, since the information contained in the depth image is richer, and the depth image can reflect the information of each face in the depth image to the image acquisition device The distance and the distance from the face to the image acquisition device can reflect the user’s face recognition willingness to a certain extent. Therefore, the embodiments of this specification can avoid the missed detection of the face in the RGB image, and can be more accurately determined Output the face used for face recognition in RGB image.

為了使本技術領域的人員更好地理解本說明書中的技術方案,下面將結合本說明書實施例中的圖式,對本說明書實施例中的技術方案進行清楚、完整地描述,顯然,所描述的實施例僅是本說明書一部分實施例,而不是全部的實施例。基於本說明書中的實施例,本領域普通技術人員在沒有做出進步性勞動前提下所獲得的所有其他實施例,都應當屬於本說明書保護的範圍。 本說明書實施例提供了一種人臉識別方法及裝置。 下面首先對本說明書實施例提供的一種人臉識別方法進行介紹。 需要說明的是,本說明書實施例提供的人臉識別方法適用於電子設備,在實際應用中,該電子設備可以為伺服器,或者,該電子設備也可以為手機、平板電腦、個人數位助理等終端設備,或者,該電子設備也可以為筆記型電腦、桌上型電腦、桌面機等電腦設備,本說明書實施例對此不作限定。 圖1是本說明書的一個實施例的人臉識別方法的流程圖,如圖1所示,該方法可以包括以下步驟:步驟102、步驟104、步驟106和步驟108,其中, 在步驟102中,獲取用於人臉識別的RGB圖像和對應的深度圖像,其中,RGB圖像中包含至少一個人臉。 本說明書實施例中,用於人臉識別的RGB圖像(彩色圖)和對應的深度圖像為針對同一場景拍攝的圖像。深度圖像中每個像素點的灰度值可用於表徵拍攝場景中某一點到深度圖像採集設備的距離。用於採集深度圖像的設備稱為深度圖像採集設備,用於採集RGB彩色圖像的設備稱為RGB圖像採集設備。 在步驟104中,從RGB圖像中選擇目標人臉。 本說明書實施例中,目標人臉像為RGB圖中最有可能用於人臉識別的人臉。 本說明書實施例中,可以對RGB圖像進行人臉檢測,檢測其中包含的人臉,並從中選擇一個人臉,作為目標人臉。具體的,可以將RGB圖像中預設區域的人臉,選擇為目標人臉。 考慮到具有人臉識別意圖的使用者通常會正對圖像採集設備的拍攝焦點或處於人群的正中位置,基於這種情況,本說明書實施例中,預設區域可以包括:RGB圖像的中心區域、或者RGB圖像拍攝時的焦點區域。相應的,可以將RGB圖像中心區域內的人臉,選擇為目標人臉;或者,可以將RGB圖像拍攝時的焦點區域內的人臉,選擇為目標人臉。 在步驟106中,根據目標人臉和深度圖像,判斷RGB圖像中是否存在干擾人臉;若否,則執行步驟108;其中,干擾人臉到人臉圖像採集設備的距離與目標人臉到人臉圖像採集設備的距離的差值小於預設閾值。 本說明書實施例中,人臉圖像採集設備指的是深度圖像採集設備。干擾人臉與目標人臉到深度圖像採集設備的距離相當或相差不多。 考慮到具有人臉識別意圖的使用者通常比較靠近圖像採集設備、並且在多人場景下具有人臉識別意圖的使用者通常只有一個,基於這種情況,本說明書實施例中,通過判斷RGB圖像中是否有干擾人臉,來確定目標人臉是否為多人場景下最具人臉識別意圖的人臉;具體的,如果RGB圖像中存在干擾人臉,則表明目標人臉不是多人場景下最具人臉識別意圖的人臉;如果RGB圖像中不存在干擾人臉,則表明目標人臉時多人場景下最具人臉識別意圖的人臉。 考慮到對RGB圖像進行人臉檢測,有時會造成人臉的漏檢,例如RGB圖像的角落裡的人臉或RGB圖像中出現的半張人臉無法檢測出來,基於這種情況,本說明書實施例中,採用對RGB圖像和該RGB圖像對應的深度圖像,可以避免上述漏檢的問題。 在步驟108中,基於目標人臉進行人臉識別。 本說明書實施例中,如果RGB圖像中不存在干擾人臉,則基於RGB圖像中的目標人臉進行人臉識別;如果RGB圖像中存在干擾人臉,則輸出提示訊息,該提示訊息用於提示RGB圖像中存在干擾人臉。 為了便於理解,以“刷臉支付”場景為例對本說明書實施例的技術方案進行舉例說明。 “刷臉支付”是基於人臉識別的支付方式,已成為線下消費場景的主要支付手段之一,具有操作便捷、體驗好等特點。隨著人臉識別技術的發展,“刷臉支付”已無需使用者輸入其他身份資訊(如手機號、帳號)便可完成支付行為,即僅需使用者刷一下臉就可以直接完成支付行為。對於以上的刷臉流程而言,其具有一個風險問題:當用於刷臉的畫面中存在多個人臉時,難以確認該畫面中的哪個使用者有意願進行支付行為,此時,可能會出現誤扣錢的情況,如果發生該情況,會發生資損,對“刷臉支付”的完全性造成較大的影響。 考慮到隨著攝影鏡頭硬體的逐步發展,線下支付場景中通常都配備了深度圖像採集設備,而深度圖像採集設備所採集到的深度圖像可以表示每個物體到相機的距離,基於這種情況,本說明書實施例中,可以獲取用於“刷臉支付”的RGB圖像和對應的深度圖像,檢測RGB圖像中的人臉,選定可能的支付使用者人臉(即目標人臉);之後,根據選定的人臉和深度圖像,判斷RGB圖像中是否存在干擾人臉,如果RGB圖像中存在干擾人臉,則認為本次支付交易存在多人臉無法確認的風險,並提示使用者該風險,讓使用者再次輸入相關帳戶資訊進行確認;如果RGB圖像中不存在干擾人臉,則認為本次支付交易較為安全,基於選定的人臉進行識別,識別通過後進行支付。 由上述實施例可見,該實施例中,在對包含多個人臉的RGB圖像進行人臉識別時,可以結合該RGB圖像對應的深度圖像,來確定該RGB圖像中用於人臉識別的人臉。相對於僅僅依據RGB圖像進行人臉識別,本說明書實施例中,由於深度圖像中包含的資訊比較豐富、且深度圖像可以反映該深度圖像中的各人臉到圖像採集設備的距離、且人臉到圖像採集設備的距離可以從一定程度上反映了使用者的人臉識別意願,因此本說明書實施例可以避免RGB圖像中人臉的漏檢,以及可以比較準確地確定出RGB圖像中用於人臉識別的人臉。 圖2是本說明書的另一個實施例的人臉識別方法的流程圖,本說明書實施例中,可以首先計算目標人臉到圖像採集設備的距離,根據計算得到的距離和深度圖像,來判斷RGB圖像中是否存在干擾人臉,此時,如圖2所示,該方法可以包括以下步驟: 在步驟202中,獲取用於人臉識別的RGB圖像和對應的深度圖像,其中,RGB圖像中包含至少一個人臉。 本說明書實施例中,用於人臉識別的RGB圖像(彩色圖)和對應的深度圖像為針對同一場景拍攝的圖像。深度圖像中每個像素點的灰度值可用於表徵拍攝場景中某一點到深度圖像採集設備的距離。用於採集深度圖像的設備稱為深度圖像採集設備,用於採集RGB彩色圖像的設備稱為RGB圖像採集設備。 在步驟204中,從RGB圖像中選擇目標人臉。 本說明書實施例中,目標人臉像為RGB圖中最有可能用於人臉識別的人臉。 本說明書實施例中,可以對RGB圖像進行人臉檢測,檢測其中包含的人臉,並從中選擇一個人臉,作為目標人臉。具體的,可以將RGB圖像中預設區域的人臉,選擇為目標人臉。 考慮到具有人臉識別意圖的使用者通常會正對圖像採集設備的拍攝焦點或處於人群的正中位置,基於這種情況,本說明書實施例中,預設區域可以包括:RGB圖像的中心區域、或者RGB圖像拍攝時的焦點區域。相應的,可以將RGB圖像中心區域內的人臉,選擇為目標人臉;或者,可以將RGB圖像拍攝時的焦點區域內的人臉,選擇為目標人臉。 在步驟206中,確定目標人臉在深度圖像中對應的目標區域。 考慮到RGB圖像採集設備的攝影鏡頭和深度圖像採集設備的攝影鏡頭是預先標定好的,即兩者具有明確的空間座標變換關係,基於這種情況,本說明書實施例中,可以根據RGB圖像和其對應的深度圖像的空間座標變換關係,確定目標人臉在深度圖像上的座標(即目標區域)。 在步驟208中,根據目標區域內像素點的資訊,計算目標人臉到人臉圖像採集設備的距離D1。 由於深度圖像中每個像素都表示距離,因此本說明書實施例中,可以根據目標區域內像素點的資訊,計算目標人臉到人臉圖像採集設備的距離D1;具體的,可以計算目標區域內各像素點到人臉圖像採集設備的距離,將各像素點到人臉圖像採集設備的距離的平均值,確定為目標人臉到人臉圖像採集設備的距離D1。 在步驟210中,判斷深度圖像中是否存在距離人臉圖像採集設備為D2的人臉;若否,則執行步驟212;其中,D1與D2的差值小於預設閾值。 本說明書實施例中,如果深度圖像中存在距離人臉圖像採集設備為D2的人臉,則RGB圖像中存在干擾人臉;如果深度圖像中不存在距離人臉圖像採集設備為D2的人臉,則確定RGB圖像中不存在干擾人臉。 本說明書實施例中,人臉圖像採集設備指的是深度圖像採集設備。干擾人臉與目標人臉到深度圖像採集設備的距離相當或相差不多。 本說明書實施例中,深度圖像中距離人臉圖像採集設備為D2的人臉包括:輪廓完整清晰的人臉、或者輪廓不完整不清晰的人臉。 考慮到具有人臉識別意圖的使用者通常比較靠近圖像採集設備、並且在多人場景下具有人臉識別意圖的使用者通常只有一個,本說明書實施例中,通過判斷RGB圖像中是否有干擾人臉,來確定目標人臉是否為多人場景下最具人臉識別意圖的人臉;具體的,如果RGB圖像中存在干擾人臉,則表明目標人臉不是多人場景下最具人臉識別意圖的人臉;如果RGB圖像中不存在干擾人臉,則表明目標人臉時多人場景下最具人臉識別意圖的人臉。 考慮到對RGB圖像進行人臉檢測,有時會造成人臉的漏檢,例如RGB圖像的角落裡的人臉或RGB圖像中出現的半張人臉無法檢測出來,本說明書實施例中,採用對RGB圖像和該RGB圖像對應的深度圖像,可以避免上述漏檢的問題。 在步驟212中,基於目標人臉進行人臉識別。 本說明書實施例中,如果RGB圖像中不存在干擾人臉,則基於RGB圖像中的目標人臉進行人臉識別;如果RGB圖像中存在干擾人臉,則輸出提示訊息,該提示訊息用於提示RGB圖像中存在干擾人臉。 由上述實施例可見,該實施例中,在對包含多個人臉的RGB圖像進行人臉識別時,可以結合該RGB圖像對應的深度圖像,來確定該RGB圖像中用於人臉識別的人臉。相對於僅僅依據RGB圖像進行人臉識別,本說明書實施例中,由於深度圖像中包含的資訊比較豐富、且深度圖像可以反映該深度圖像中的各人臉到圖像採集設備的距離、且人臉到圖像採集設備的距離可以從一定程度上反映了使用者的人臉識別意願,因此本說明書實施例可以避免RGB圖像中人臉的漏檢,以及可以比較準確地確定出RGB圖像中用於人臉識別的人臉。 圖3是本說明書的一個實施例的人臉識別裝置的結構示意圖,如圖3所示,在一種軟體實施方式中,人臉識別裝置300,可以包括:獲取模組301、選擇模組302、判斷模組303和識別模組304,其中, 獲取模組301,用於獲取用於人臉識別的RGB圖像和對應的深度圖像,所述RGB圖像中包含至少一個人臉; 選擇模組302,用於從所述RGB圖像中選擇目標人臉; 判斷模組303,用於根據所述目標人臉和所述深度圖像,判斷所述RGB圖像中是否存在干擾人臉,所述干擾人臉到人臉圖像採集設備的距離與所述目標人臉到所述人臉圖像採集設備的距離的差值小於預設閾值; 識別模組304,用於在所述RGB圖像中不存在所述干擾人臉的情況下,基於所述目標人臉進行人臉識別。 由上述實施例可見,該實施例中,在對包含多個人臉的RGB圖像進行人臉識別時,可以結合該RGB圖像對應的深度圖像,來確定該RGB圖像中用於人臉識別的人臉。相對於僅僅依據RGB圖像進行人臉識別,本說明書實施例中,由於深度圖像中包含的資訊比較豐富、且深度圖像可以反映該深度圖像中的各人臉到圖像採集設備的距離、且人臉到圖像採集設備的距離可以從一定程度上反映了使用者的人臉識別意願,因此本說明書實施例可以避免RGB圖像中人臉的漏檢,以及可以比較準確地確定出RGB圖像中用於人臉識別的人臉。 可選地,作為一個實施例,所述選擇模組302,可以包括: 人臉選擇子模組,用於將所述RGB圖像中預設區域的人臉,選擇為目標人臉。 可選地,作為一個實施例,所述預設區域包括: 所述RGB圖像的中心區域、或者所述RGB圖像拍攝時的焦點區域。 可選地,作為一個實施例,所述判斷模組303,可以包括: 目標區域確定子模組,用於確定所述目標人臉在所述深度圖像中對應的目標區域; 距離計算子模組,用於根據所述目標區域內像素點的資訊,計算所述目標人臉到人臉圖像採集設備的距離D1; 判斷子模組,用於判斷所述深度圖像中是否存在距離所述人臉圖像採集設備為D2的人臉,所述D1與D2的差值小於所述預設閾值;其中, 如果所述深度圖像中存在距離所述人臉圖像採集設備為D2的人臉,則所述RGB圖像中存在干擾人臉;如果所述深度圖像中不存在距離所述人臉圖像採集設備為D2的人臉,則確定所述RGB圖像中不存在干擾人臉。 可選地,作為一個實施例,所述距離計算子模組,可以包括: 距離計算單元,用於計算所述目標區域內各像素點到人臉圖像採集設備的距離; 距離確定單元,用於將所述各像素點到人臉圖像採集設備的距離的平均值,確定為所述目標人臉到人臉圖像採集設備的距離D1。 可選地,作為一個實施例,所述人臉識別裝置300,還可以包括: 輸出模組,用於在所述RGB圖像中存在所述干擾人臉的情況下,輸出提示訊息,所述提示訊息用於提示所述RGB圖像中存在干擾人臉。 圖4是本說明書的一個實施例電子設備的結構示意圖,如圖4所示,在硬體層面,該電子設備包括處理器,可選地還包括內部匯流排、網路介面、記憶體。其中,記憶體可能包含記憶體,例如高速隨機存取記憶體(Random-Access Memory,RAM),也可能還包括非易失性記憶體(non-volatile memory),例如至少1個磁碟記憶體等。當然,該電子設備還可能包括其他業務所需要的硬體。 處理器、網路介面和記憶體可以通過內部匯流排相互連接,該內部匯流排可以是ISA(Industry Standard Architecture,工業標準架構)匯流排、PCI(Peripheral Component Interconnect,周邊組件互連標準)匯流排或EISA(Extended Industry Standard Architecture,延伸工業標準架構)匯流排等。所述匯流排可以分為位址匯流排、資料匯流排、控制匯流排等。為便於表示,圖4中僅用一個雙向箭頭表示,但並不表示僅有一根匯流排或一種類型的匯流排。 記憶體,用於存放程式。具體地,程式可以包括程式碼,所述程式碼包括電腦操作指令。記憶體可以包括記憶體和非易失性記憶體,並向處理器提供指令和資料。 處理器從非易失性記憶體中讀取對應的電腦程式到記憶體中然後運行,在邏輯層面上形成人臉識別裝置。處理器,執行記憶體所存放的程式,並具體用於執行以下操作: 獲取用於人臉識別的RGB圖像和對應的深度圖像,所述RGB圖像中包含至少一個人臉; 從所述RGB圖像中選擇目標人臉; 根據所述目標人臉和所述深度圖像,判斷所述RGB圖像中是否存在干擾人臉,所述干擾人臉到人臉圖像採集設備的距離與所述目標人臉到所述人臉圖像採集設備的距離的差值小於預設閾值; 如果所述RGB圖像中不存在所述干擾人臉,則基於所述目標人臉進行人臉識別。 本說明書實施例中,在對包含多個人臉的RGB圖像進行人臉識別時,可以結合該RGB圖像對應的深度圖像,來確定該RGB圖像中用於人臉識別的人臉。相對於僅僅依據RGB圖像進行人臉識別,本說明書實施例中,由於深度圖像中包含的資訊比較豐富、且深度圖像可以反映該深度圖像中的各人臉到圖像採集設備的距離、且人臉到圖像採集設備的距離可以從一定程度上反映了使用者的人臉識別意願,因此本說明書實施例可以避免RGB圖像中人臉的漏檢,以及可以比較準確地確定出RGB圖像中用於人臉識別的人臉。 可選地,作為一個實施例,所述從所述RGB圖像中選擇目標人臉,包括: 將所述RGB圖像中預設區域的人臉,選擇為目標人臉。 可選地,作為一個實施例,所述預設區域包括: 所述RGB圖像的中心區域、或者所述RGB圖像拍攝時的焦點區域。 可選地,作為一個實施例,所述根據所述目標人臉和所述深度圖像,判斷所述RGB圖像中是否存在干擾人臉,包括: 確定所述目標人臉在所述深度圖像中對應的目標區域; 根據所述目標區域內像素點的資訊,計算所述目標人臉到人臉圖像採集設備的距離D1; 判斷所述深度圖像中是否存在距離所述人臉圖像採集設備為D2的人臉,所述D1與D2的差值小於所述預設閾值; 如果所述深度圖像中存在距離所述人臉圖像採集設備為D2的人臉,則所述RGB圖像中存在干擾人臉;如果所述深度圖像中不存在距離所述人臉圖像採集設備為D2的人臉,則確定所述RGB圖像中不存在干擾人臉。 可選地,作為一個實施例,所述根據所述目標區域內像素點的資訊,計算所述目標人臉到人臉圖像採集設備的距離D1,包括: 計算所述目標區域內各像素點到人臉圖像採集設備的距離; 將所述各像素點到人臉圖像採集設備的距離的平均值,確定為所述目標人臉到人臉圖像採集設備的距離D1。 可選地,作為一個實施例,所述方法還包括: 如果所述RGB圖像中存在所述干擾人臉,則輸出提示訊息,所述提示訊息用於提示所述RGB圖像中存在干擾人臉。 上述如本說明書圖4所示實施例揭示的人臉識別裝置執行的方法可以應用於處理器中,或者由處理器實現。處理器可能是一種積體電路晶片,具有信號的處理能力。在實現過程中,上述方法的各步驟可以通過處理器中的硬體的集成邏輯電路或者軟體形式的指令完成。上述的處理器可以是通用處理器,包括中央處理器(Central Processing Unit,CPU)、網路處理器(Network Processor,NP)等;還可以是數位訊號處理器(Digital Signal Processor,DSP)、專用積體電路(Application Specific Integrated Circuit,ASIC)、場可程式設計閘陣列(Field-Programmable Gate Array,FPGA)或者其他可程式設計邏輯器件、分立門或者電晶體邏輯器件、分立硬體組件。可以實現或者執行本說明書實施例中的公開的各方法、步驟及邏輯方塊圖。通用處理器可以是微處理器或者該處理器也可以是任何常規的處理器等。結合本說明書實施例所公開的方法的步驟可以直接體現為硬體解碼處理器執行完成,或者用解碼處理器中的硬體及軟體模組組合執行完成。軟體模組可以位於隨機記憶體,快閃記憶體、唯讀記憶體,可程式設計唯讀記憶體或者電可讀寫可程式設計記憶體、暫存器等本領域成熟的儲存媒體中。該儲存媒體位於記憶體,處理器讀取記憶體中的資訊,結合其硬體完成上述方法的步驟。 該電子設備還可執行圖1的方法,並實現人臉識別裝置在圖1所示實施例的功能,本說明書實施例在此不再贅述。 本說明書實施例還提供了一種電腦可讀儲存媒體,該電腦可讀儲存媒體儲存一個或多個程式,該一個或多個程式包括指令,該指令當被包括多個應用程式的可擕式電子設備執行時,能夠使該可擕式電子設備執行圖1所示實施例的方法,並具體用於執行以下方法: 獲取用於人臉識別的RGB圖像和對應的深度圖像,所述RGB圖像中包含至少一個人臉; 從所述RGB圖像中選擇目標人臉; 根據所述目標人臉和所述深度圖像,判斷所述RGB圖像中是否存在干擾人臉,所述干擾人臉到人臉圖像採集設備的距離與所述目標人臉到所述人臉圖像採集設備的距離的差值小於預設閾值; 如果所述RGB圖像中不存在所述干擾人臉,則基於所述目標人臉進行人臉識別。 總之,以上所述僅為本說明書的較佳實施例而已,並非用於限定本說明書的保護範圍。凡在本說明書的精神和原則之內,所作的任何修改、等同替換、改進等,均應包含在本說明書的保護範圍之內。 上述實施例闡明的系統、裝置、模組或單元,具體可以由電腦晶片或實體實現,或者由具有某種功能的產品來實現。一種典型的實現設備為電腦。具體的,電腦例如可以為個人電腦、膝上型電腦、蜂巢式電話、相機電話、智慧型電話、個人數位助理、媒體播放機、導航設備、電子郵件設備、遊戲控制台、平板電腦、可穿戴設備或者這些設備中的任何設備的組合。 電腦可讀媒體包括永久性和非永久性、可移動和非可移動媒體可以由任何方法或技術來實現資訊儲存。資訊可以是電腦可讀指令、資料結構、程式的模組或其他資料。電腦的儲存媒體的例子包括,但不限於相變記憶體(PRAM)、靜態隨機存取記憶體(SRAM)、動態隨機存取記憶體(DRAM)、其他類型的隨機存取記憶體(RAM)、唯讀記憶體(ROM)、電可擦除可程式設計唯讀記憶體(EEPROM)、快閃記憶體或其他記憶體技術、唯讀光碟唯讀記憶體(CD-ROM)、數位多功能光碟(DVD)或其他光學儲存、磁盒式磁帶,磁帶磁片儲存或其他磁性存放裝置或任何其他非傳輸媒體,可用於儲存可以被計算設備存取的資訊。按照本文中的界定,電腦可讀媒體不包括暫存電腦可讀媒體(transitory media),如調變的資料信號和載波。 還需要說明的是,術語“包括”、“包含”或者其任何其他變體意在涵蓋非排他性的包含,從而使得包括一系列要素的過程、方法、商品或者設備不僅包括那些要素,而且還包括沒有明確列出的其他要素,或者是還包括為這種過程、方法、商品或者設備所固有的要素。在沒有更多限制的情況下,由語句“包括一個……”限定的要素,並不排除在包括所述要素的過程、方法、商品或者設備中還存在另外的相同要素。 本說明書中的各個實施例均採用遞進的方式描述,各個實施例之間相同相似的部分互相參見即可,每個實施例重點說明的都是與其他實施例的不同之處。尤其,對於系統實施例而言,由於其基本相似於方法實施例,所以描述的比較簡單,相關之處參見方法實施例的部分說明即可。In order to enable those skilled in the art to better understand the technical solutions in this specification, the following will clearly and completely describe the technical solutions in the embodiments of this specification in conjunction with the drawings in the embodiments of this specification. Obviously, the described The embodiments are only a part of the embodiments of this specification, rather than all the embodiments. Based on the embodiments in this specification, all other embodiments obtained by those of ordinary skill in the art without making progressive labor should fall within the protection scope of this specification. The embodiments of this specification provide a face recognition method and device. The following first introduces a face recognition method provided by an embodiment of this specification. It should be noted that the face recognition method provided in the embodiments of this specification is applicable to electronic devices. In practical applications, the electronic device can be a server, or the electronic device can also be a mobile phone, a tablet computer, a personal digital assistant, etc. The terminal device, or the electronic device may also be a computer device such as a notebook computer, a desktop computer, a desktop computer, etc., which is not limited in the embodiment of this specification. Fig. 1 is a flowchart of a face recognition method according to an embodiment of the present specification. As shown in Fig. 1, the method may include the following steps: step 102, step 104, step 106, and step 108, where: In step 102, an RGB image and a corresponding depth image for face recognition are acquired, where the RGB image contains at least one face. In the embodiments of this specification, the RGB image (color map) used for face recognition and the corresponding depth image are images taken for the same scene. The gray value of each pixel in the depth image can be used to characterize the distance from a certain point in the shooting scene to the depth image acquisition device. The device used to collect the depth image is called the depth image acquisition device, and the device used to collect the RGB color image is called the RGB image acquisition device. In step 104, the target face is selected from the RGB image. In the embodiment of this specification, the target face image is the face most likely to be used for face recognition in the RGB image. In the embodiment of this specification, face detection can be performed on the RGB image, the face contained therein is detected, and a face is selected as the target face. Specifically, a human face in a preset area in the RGB image can be selected as the target human face. Considering that the user with the intention of face recognition will usually be directly facing the shooting focus of the image acquisition device or in the middle of the crowd, based on this situation, in the embodiment of this specification, the preset area may include: the center of the RGB image Area, or focus area when RGB image is taken. Correspondingly, the face in the central area of the RGB image can be selected as the target face; or, the face in the focus area when the RGB image is taken can be selected as the target face. In step 106, judge whether there is an interfering face in the RGB image based on the target face and the depth image; if not, proceed to step 108; wherein, the distance between the interfering face and the face image acquisition device is the same as that of the target person The difference in the distance between the face and the face image acquisition device is less than the preset threshold. In the embodiments of this specification, the face image acquisition device refers to the depth image acquisition device. The distance between the interfering face and the target face to the depth image acquisition device is equal or similar. Considering that the user with the intention of face recognition is usually closer to the image capture device, and there is usually only one user with the intention of face recognition in a multi-person scene, based on this situation, in the embodiment of this specification, the RGB Whether there is an interfering face in the image, to determine whether the target face is the most intent of face recognition in a multi-person scene; specifically, if there is an interfering face in the RGB image, it indicates that the target face is not many The face with the most facial recognition intention in the human scene; if there is no interfering face in the RGB image, it indicates that the target face is the most intent face in the multi-person scene. Taking into account the face detection of RGB images, sometimes it will cause missed detection of human faces. For example, the face in the corner of the RGB image or half of the face in the RGB image cannot be detected. Based on this situation In the embodiment of this specification, the RGB image and the depth image corresponding to the RGB image are used to avoid the above-mentioned problem of missed detection. In step 108, face recognition is performed based on the target face. In the embodiment of this specification, if there is no interfering face in the RGB image, face recognition is performed based on the target face in the RGB image; if there is an interfering face in the RGB image, a prompt message is output. It is used to indicate the presence of interfering faces in the RGB image. In order to facilitate understanding, the technical solutions of the embodiments of the present specification are illustrated by taking the scenario of "paying by face scanning" as an example. "Pay with face recognition" is a payment method based on face recognition. It has become one of the main payment methods in offline consumption scenarios. It has the characteristics of convenient operation and good experience. With the development of face recognition technology, "face payment" does not require users to enter other identification information (such as mobile phone number, account number) to complete the payment behavior, that is, the user only needs to swipe the face to directly complete the payment behavior. For the above face brushing process, it has a risk problem: when there are multiple faces in the screen used to brush the face, it is difficult to confirm which user in the screen is willing to make the payment. At this time, it may appear In the case of wrongful deduction of money, if this happens, capital loss will occur, which will have a greater impact on the completeness of the "face payment". Taking into account that with the gradual development of camera lens hardware, offline payment scenes are usually equipped with depth image acquisition equipment, and the depth images collected by the depth image acquisition equipment can indicate the distance of each object to the camera. Based on this situation, in the embodiment of this specification, the RGB image and the corresponding depth image used for "face payment" can be acquired, the face in the RGB image can be detected, and the possible payment user face (ie Target face); After that, according to the selected face and depth image, determine whether there is an interfering face in the RGB image. If there is an interfering face in the RGB image, it is considered that there are multiple faces in the payment transaction that cannot be confirmed The user will be prompted to enter the relevant account information again for confirmation; if there is no interfering human face in the RGB image, the payment transaction is considered safer, and the recognition is based on the selected face. Payment is made after approval. It can be seen from the above embodiment that in this embodiment, when performing face recognition on an RGB image containing multiple human faces, the depth image corresponding to the RGB image can be combined to determine that the RGB image is used for the face. Recognized face. Compared with the face recognition based only on RGB images, in the embodiments of this specification, since the information contained in the depth image is richer, and the depth image can reflect the information of each face in the depth image to the image acquisition device The distance and the distance from the face to the image acquisition device can reflect the user’s face recognition willingness to a certain extent. Therefore, the embodiments of this specification can avoid the missed detection of the face in the RGB image, and can be more accurately determined Output the face used for face recognition in RGB image. Figure 2 is a flowchart of a face recognition method according to another embodiment of this specification. In this embodiment of this specification, the distance from the target face to the image acquisition device can be calculated first, and the calculated distance and depth image Determine whether there is an interference face in the RGB image. At this time, as shown in Figure 2, the method may include the following steps: In step 202, an RGB image and a corresponding depth image for face recognition are acquired, where the RGB image contains at least one face. In the embodiments of this specification, the RGB image (color map) used for face recognition and the corresponding depth image are images taken for the same scene. The gray value of each pixel in the depth image can be used to characterize the distance from a certain point in the shooting scene to the depth image acquisition device. The device used to collect the depth image is called the depth image acquisition device, and the device used to collect the RGB color image is called the RGB image acquisition device. In step 204, the target face is selected from the RGB image. In the embodiment of this specification, the target face image is the face most likely to be used for face recognition in the RGB image. In the embodiment of this specification, face detection can be performed on the RGB image, the face contained therein is detected, and a face is selected as the target face. Specifically, a human face in a preset area in the RGB image can be selected as the target human face. Considering that the user with the intention of face recognition will usually be directly facing the shooting focus of the image acquisition device or in the middle of the crowd, based on this situation, in the embodiment of this specification, the preset area may include: the center of the RGB image Area, or focus area when RGB image is taken. Correspondingly, the face in the central area of the RGB image can be selected as the target face; or, the face in the focus area when the RGB image is taken can be selected as the target face. In step 206, the target area corresponding to the target face in the depth image is determined. Considering that the photographic lens of the RGB image acquisition device and the photographic lens of the depth image acquisition device are pre-calibrated, that is, the two have a clear spatial coordinate transformation relationship. Based on this situation, in the embodiments of this specification, the RGB The spatial coordinate transformation relationship between the image and its corresponding depth image determines the coordinates of the target face on the depth image (that is, the target area). In step 208, the distance D1 from the target face to the face image acquisition device is calculated according to the information of the pixel points in the target area. Since each pixel in the depth image represents a distance, in the embodiment of this specification, the distance D1 from the target face to the face image acquisition device can be calculated according to the pixel information in the target area; specifically, the target can be calculated The distance from each pixel in the area to the face image acquisition device, and the average of the distance from each pixel to the face image acquisition device is determined as the distance D1 from the target face to the face image acquisition device. In step 210, it is determined whether there is a face D2 from the face image acquisition device in the depth image; if not, step 212 is executed; wherein the difference between D1 and D2 is less than a preset threshold. In the embodiments of this specification, if there is a face that is D2 from the face image acquisition device in the depth image, then there is an interfering face in the RGB image; if there is no face image acquisition device in the depth image, it is D2 face, it is determined that there is no interfering face in the RGB image. In the embodiments of this specification, the face image acquisition device refers to the depth image acquisition device. The distance between the interfering face and the target face to the depth image acquisition device is equal or similar. In the embodiment of this specification, the face whose distance is D2 from the face image acquisition device in the depth image includes: a face with a complete and clear outline, or a face with an incomplete and unclear outline. Considering that the user with the intention of face recognition is usually closer to the image acquisition device, and there is usually only one user with the intention of face recognition in a multi-person scene, in the embodiment of this specification, it is determined whether there is Interfering face to determine whether the target face is the most intended face in a multi-person scene; specifically, if there is an interfering face in the RGB image, it indicates that the target face is not the most in a multi-person scene. Face recognition intent; if there is no interfering face in the RGB image, it indicates that the target face is the most intent to face recognition in a multi-person scene. Considering that face detection is performed on RGB images, sometimes it may cause missed detection of human faces. For example, the face in the corner of the RGB image or half of the face in the RGB image cannot be detected. The embodiment of this specification In the RGB image and the depth image corresponding to the RGB image, the above-mentioned missed detection problem can be avoided. In step 212, face recognition is performed based on the target face. In the embodiment of this specification, if there is no interfering face in the RGB image, face recognition is performed based on the target face in the RGB image; if there is an interfering face in the RGB image, a prompt message is output. It is used to indicate the presence of interfering faces in the RGB image. It can be seen from the above embodiment that in this embodiment, when performing face recognition on an RGB image containing multiple human faces, the depth image corresponding to the RGB image can be combined to determine that the RGB image is used for the face. Recognized face. Compared with the face recognition based only on RGB images, in the embodiments of this specification, since the information contained in the depth image is richer, and the depth image can reflect the information of each face in the depth image to the image acquisition device The distance and the distance from the face to the image acquisition device can reflect the user’s face recognition willingness to a certain extent. Therefore, the embodiments of this specification can avoid the missed detection of the face in the RGB image, and can be more accurately determined Output the face used for face recognition in RGB image. FIG. 3 is a schematic structural diagram of a face recognition device according to an embodiment of this specification. As shown in FIG. 3, in a software implementation, the face recognition device 300 may include: an acquisition module 301, a selection module 302, The judgment module 303 and the identification module 304, in which, The acquisition module 301 is configured to acquire an RGB image and a corresponding depth image for face recognition, where the RGB image contains at least one face; The selection module 302 is used to select a target face from the RGB image; The judging module 303 is used to judge whether there is an interfering face in the RGB image based on the target face and the depth image, and the distance between the interfering face and the face image collection device is the same as that of the The difference in the distance between the target face and the face image acquisition device is less than a preset threshold; The recognition module 304 is configured to perform face recognition based on the target face when the interfering face does not exist in the RGB image. It can be seen from the above embodiment that in this embodiment, when performing face recognition on an RGB image containing multiple human faces, the depth image corresponding to the RGB image can be combined to determine that the RGB image is used for the face. Recognized face. Compared with the face recognition based only on RGB images, in the embodiments of this specification, since the information contained in the depth image is richer, and the depth image can reflect the information of each face in the depth image to the image acquisition device The distance and the distance from the face to the image acquisition device can reflect the user’s face recognition willingness to a certain extent. Therefore, the embodiments of this specification can avoid the missed detection of the face in the RGB image, and can be more accurately determined Output the face used for face recognition in RGB image. Optionally, as an embodiment, the selection module 302 may include: The face selection submodule is used to select a face in a preset area in the RGB image as a target face. Optionally, as an embodiment, the preset area includes: The central area of the RGB image or the focal area when the RGB image is taken. Optionally, as an embodiment, the judgment module 303 may include: A target area determining sub-module, configured to determine the target area corresponding to the target face in the depth image; The distance calculation sub-module is used to calculate the distance D1 from the target face to the face image acquisition device according to the information of the pixels in the target area; The judging submodule is used to judge whether there is a face D2 from the face image acquisition device in the depth image, and the difference between D1 and D2 is less than the preset threshold; wherein, If there is a face that is D2 from the face image acquisition device in the depth image, there is an interfering face in the RGB image; if there is no face image in the depth image If the image collection device is a D2 face, it is determined that there is no interfering face in the RGB image. Optionally, as an embodiment, the distance calculation submodule may include: A distance calculation unit, configured to calculate the distance from each pixel in the target area to the face image acquisition device; The distance determining unit is configured to determine the average value of the distances from each pixel point to the face image acquisition device as the distance D1 from the target face to the face image acquisition device. Optionally, as an embodiment, the face recognition apparatus 300 may further include: The output module is configured to output a prompt message when the interfering human face exists in the RGB image, and the prompt message is used to prompt the interfering human face in the RGB image. Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the specification. As shown in Fig. 4, at the hardware level, the electronic device includes a processor, and optionally an internal bus, a network interface, and a memory. Among them, the memory may include memory, such as high-speed random-access memory (Random-Access Memory, RAM), and may also include non-volatile memory, such as at least one magnetic disk memory. Wait. Of course, the electronic equipment may also include hardware required by other businesses. The processor, network interface, and memory can be connected to each other through an internal bus, which can be an ISA (Industry Standard Architecture) bus or a PCI (Peripheral Component Interconnect) bus Or EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of presentation, only one double-headed arrow is used to indicate in FIG. 4, but it does not mean that there is only one busbar or one type of busbar. Memory, used to store programs. Specifically, the program may include program code, and the program code includes computer operation instructions. The memory may include memory and non-volatile memory, and provide instructions and data to the processor. The processor reads the corresponding computer program from the non-volatile memory to the memory and then runs it to form a face recognition device on the logical level. The processor executes the programs stored in the memory and is specifically used to perform the following operations: Acquiring an RGB image used for face recognition and a corresponding depth image, where the RGB image contains at least one face; Selecting a target face from the RGB image; According to the target face and the depth image, it is determined whether there is an interfering face in the RGB image, and the distance from the interfering face to the face image acquisition device is the same as the distance from the target face to the person The difference in the distance of the face image acquisition device is less than a preset threshold; If the interfering face does not exist in the RGB image, face recognition is performed based on the target face. In the embodiment of the present specification, when performing face recognition on an RGB image containing multiple human faces, the depth image corresponding to the RGB image can be combined to determine the human face used for face recognition in the RGB image. Compared with the face recognition based only on RGB images, in the embodiments of this specification, since the information contained in the depth image is richer, and the depth image can reflect the information of each face in the depth image to the image acquisition device The distance and the distance from the face to the image acquisition device can reflect the user’s face recognition willingness to a certain extent. Therefore, the embodiments of this specification can avoid the missed detection of the face in the RGB image, and can be more accurately determined Output the face used for face recognition in RGB image. Optionally, as an embodiment, the selecting a target human face from the RGB image includes: The human face in the preset area in the RGB image is selected as the target human face. Optionally, as an embodiment, the preset area includes: The central area of the RGB image or the focal area when the RGB image is taken. Optionally, as an embodiment, the judging whether there is an interfering human face in the RGB image based on the target human face and the depth image includes: Determining a target area corresponding to the target face in the depth image; Calculate the distance D1 from the target face to the face image acquisition device according to the pixel information in the target area; Determining whether there is a face D2 from the face image acquisition device in the depth image, and the difference between D1 and D2 is less than the preset threshold; If there is a face that is D2 from the face image acquisition device in the depth image, there is an interfering face in the RGB image; if there is no face image in the depth image If the image collection device is a D2 face, it is determined that there is no interfering face in the RGB image. Optionally, as an embodiment, the calculating the distance D1 from the target face to the face image acquisition device according to the pixel information in the target area includes: Calculating the distance from each pixel in the target area to the face image acquisition device; The average value of the distance from each pixel to the face image collection device is determined as the distance D1 from the target face to the face image collection device. Optionally, as an embodiment, the method further includes: If the interfering human face exists in the RGB image, a prompt message is output, and the prompt message is used to prompt the interfering human face in the RGB image. The above-mentioned method executed by the face recognition apparatus disclosed in the embodiment shown in FIG. 4 of this specification may be applied to or implemented by the processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, the steps of the above method can be completed by hardware integrated logic circuits in the processor or instructions in the form of software. The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (Network Processor, NP), etc.; it can also be a digital signal processor (DSP), a dedicated Integrated circuit (Application Specific Integrated Circuit, ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of this specification can be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like. The steps of the method disclosed in the embodiments of this specification can be directly embodied as being executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the field such as random memory, flash memory, read-only memory, programmable read-only memory, or electrically readable, writable and programmable memory, register. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware. The electronic device can also execute the method in FIG. 1 and realize the functions of the embodiment of the face recognition apparatus shown in FIG. 1, which will not be repeated in the embodiment of this specification. The embodiment of this specification also provides a computer-readable storage medium, the computer-readable storage medium stores one or more programs, and the one or more programs include instructions. When the instructions are included in a portable electronic device that includes multiple application programs When the device is executed, the portable electronic device can be made to execute the method of the embodiment shown in FIG. 1, and is specifically used to execute the following methods: Acquiring an RGB image used for face recognition and a corresponding depth image, where the RGB image contains at least one face; Selecting a target face from the RGB image; According to the target face and the depth image, it is determined whether there is an interfering face in the RGB image, and the distance from the interfering face to the face image acquisition device is the same as the distance from the target face to the person The difference in the distance of the face image acquisition device is less than a preset threshold; If the interfering face does not exist in the RGB image, face recognition is performed based on the target face. In short, the above descriptions are only preferred embodiments of this specification, and are not intended to limit the protection scope of this specification. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this specification shall be included in the protection scope of this specification. The systems, devices, modules or units explained in the above embodiments may be implemented by computer chips or entities, or implemented by products with certain functions. A typical implementation device is a computer. Specifically, the computer can be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, and a wearable. Device or any combination of these devices. Computer-readable media includes permanent and non-permanent, removable and non-removable media, and information storage can be realized by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), and other types of random access memory (RAM) , Read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only CD-ROM (CD-ROM), digital multi-function Optical discs (DVD) or other optical storage, magnetic cassettes, magnetic tape storage or other magnetic storage devices, or any other non-transmission media, can be used to store information that can be accessed by computing devices. According to the definition in this article, computer-readable media does not include transitory media, such as modulated data signals and carrier waves. It should also be noted that the terms "include", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, product or equipment including a series of elements not only includes those elements, but also includes Other elements that are not explicitly listed, or include elements inherent to this process, method, commodity, or equipment. If there are no more restrictions, the element defined by the sentence "including a..." does not exclude the existence of other identical elements in the process, method, commodity, or equipment that includes the element. The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, as for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for related parts, please refer to the part of the description of the method embodiment.

300‧‧‧人臉識別裝置 301‧‧‧獲取模組 302‧‧‧選擇模組 303‧‧‧判斷模組 304‧‧‧識別模組300‧‧‧Face recognition device 301‧‧‧Get Module 302‧‧‧Select Module 303‧‧‧Judgment Module 304‧‧‧Identification Module

為了更清楚地說明本說明書實施例或現有技術中的技術方案,下面將對實施例或現有技術描述中所需要使用的圖式作簡單地介紹,顯而易見地,下面描述中的圖式僅僅是本說明書中記載的一些實施例,對於本領域普通技術人員來講,在不付出進步性勞動性的前提下,還可以根據這些圖式獲得其他的圖式。 圖1是本說明書的一個實施例的人臉識別方法的流程圖; 圖2是本說明書的另一個實施例的人臉識別方法的流程圖; 圖3是本說明書的一個實施例的人臉識別裝置的結構示意圖; 圖4是本說明書的一個實施例的電子設備的結構示意圖。In order to more clearly explain the technical solutions in the embodiments of this specification or the prior art, the following will briefly introduce the drawings that need to be used in the embodiments or the description of the prior art. Obviously, the drawings in the following description are merely the present For some of the embodiments described in the specification, for those of ordinary skill in the art, other schemes can be obtained based on these schemes without making progressive labor. FIG. 1 is a flowchart of a face recognition method according to an embodiment of this specification; 2 is a flowchart of a face recognition method according to another embodiment of this specification; FIG. 3 is a schematic structural diagram of a face recognition device according to an embodiment of this specification; Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of this specification.

Claims (9)

一種人臉識別方法,所述方法包括:獲取用於人臉識別的RGB圖像和對應的深度圖像,所述RGB圖像中包含至少一個人臉;所述深度圖像通過深度圖像設備採集得到;從所述RGB圖像中選擇目標人臉;根據所述目標人臉在所述深度圖像中對應的目標區域內的像素點的資訊,計算所述目標人臉到人臉圖像採集設備的距離D1;若所述深度圖像中不存在到所述人臉圖像採集設備的距離為D2的人臉,則確定所述RGB圖像中不存在干擾人臉;其中,所述D1與D2的差值小於預設閾值;如果所述RGB圖像中不存在所述干擾人臉,則基於所述目標人臉進行人臉識別。 A face recognition method, the method comprising: acquiring an RGB image for face recognition and a corresponding depth image, the RGB image contains at least one face; the depth image is collected by a depth image device Obtain; select the target face from the RGB image; calculate the target face to face image collection according to the pixel information of the target face in the target area corresponding to the depth image The distance D1 of the device; if there is no face with a distance of D2 to the face image collection device in the depth image, it is determined that there is no interfering face in the RGB image; wherein, the D1 The difference between D2 and D2 is less than a preset threshold; if the interfering face does not exist in the RGB image, face recognition is performed based on the target face. 根據申請專利範圍第1項所述的方法,所述從所述RGB圖像中選擇目標人臉,包括:將所述RGB圖像中預設區域的人臉,選擇為目標人臉。 According to the method described in item 1 of the scope of patent application, the selecting a target human face from the RGB image includes: selecting a human face in a preset area in the RGB image as the target human face. 根據申請專利範圍第2項所述的方法,所述預設區域包括:所述RGB圖像的中心區域、或者所述RGB圖像拍攝時 的焦點區域。 According to the method described in item 2 of the scope of patent application, the preset area includes: the central area of the RGB image, or when the RGB image is taken The focus area. 根據申請專利範圍第1項所述的方法,所述根據所述目標人臉在所述深度圖像中對應的目標區域內的像素點的資訊,計算所述目標人臉到人臉圖像採集設備的距離D1,包括:計算所述目標區域內各像素點到人臉圖像採集設備的距離;將所述各像素點到人臉圖像採集設備的距離的平均值,確定為所述目標人臉到人臉圖像採集設備的距離D1。 According to the method described in item 1 of the scope of patent application, the calculation of the target face to the face image collection based on the pixel information of the target face in the target area corresponding to the depth image The distance D1 of the device includes: calculating the distance from each pixel point in the target area to the face image collection device; determining the average value of the distance between each pixel point and the face image collection device as the target The distance D1 from the face to the face image acquisition device. 根據申請專利範圍第1項所述的方法,所述方法還包括:如果所述RGB圖像中存在所述干擾人臉,則輸出提示訊息,所述提示訊息用於提示所述RGB圖像中存在干擾人臉。 According to the method described in item 1 of the scope of patent application, the method further includes: if the interfering human face exists in the RGB image, outputting a prompt message, the prompt message being used to prompt the RGB image There is interference with human faces. 一種人臉識別裝置,所述裝置包括:獲取模組,用於獲取用於人臉識別的RGB圖像和對應的深度圖像,所述RGB圖像中包含至少一個人臉;所述深度圖像通過深度圖像設備採集得到;選擇模組,用於從所述RGB圖像中選擇目標人臉;計算模組,用於根據所述目標人臉在所述深度圖像中對應的目標區域內的像素點的資訊,計算所述目標人臉到 人臉圖像採集設備的距離D1;判斷模組,用於若所述深度圖像中不存在到所述人臉圖像採集設備的距離為D2的人臉,則確定所述RGB圖像中不存在干擾人臉;其中,所述D1與D2的差值小於預設閾值;識別模組,用於在所述RGB圖像中不存在所述干擾人臉的情況下,基於所述目標人臉進行人臉識別。 A face recognition device, the device comprising: an acquisition module for acquiring an RGB image used for face recognition and a corresponding depth image, the RGB image contains at least one face; the depth image Obtained by the depth image equipment; a selection module, used to select a target face from the RGB image; a calculation module, used according to the target face in the corresponding target area in the depth image Pixel information, calculate the target face to The distance D1 of the face image collection device; a judgment module for determining whether there is a face whose distance D2 from the face image collection device is D2 in the depth image There is no interfering face; wherein, the difference between D1 and D2 is less than a preset threshold; the recognition module is used to determine the basis of the target person when the interfering face does not exist in the RGB image Face recognition. 根據申請專利範圍第6項所述的裝置,所述選擇模組,包括:人臉選擇子模組,用於將所述RGB圖像中預設區域的人臉,選擇為目標人臉。 According to the device described in item 6 of the scope of patent application, the selection module includes: a face selection sub-module for selecting a face in a preset area in the RGB image as a target face. 一種電子設備,包括:處理器;以及被安排成儲存電腦可執行指令的記憶體,所述可執行指令在被執行時使所述處理器執行以下操作:獲取用於人臉識別的RGB圖像和對應的深度圖像,所述RGB圖像中包含至少一個人臉;所述深度圖像通過深度圖像設備採集得到;從所述RGB圖像中選擇目標人臉;根據所述目標人臉在所述深度圖像中對應的目標區域內的像素點的資訊,計算所述目標人臉到人臉圖像採集設備的距離D1; 若所述深度圖像中不存在到所述人臉圖像採集設備的距離為D2的人臉,則確定所述RGB圖像中不存在干擾人臉;其中,所述D1與D2的差值小於預設閾值;如果所述RGB圖像中不存在所述干擾人臉,則基於所述目標人臉進行人臉識別。 An electronic device, comprising: a processor; and a memory arranged to store computer-executable instructions, which when executed, cause the processor to perform the following operations: acquiring an RGB image for face recognition And a corresponding depth image, the RGB image contains at least one face; the depth image is collected by a depth image device; a target face is selected from the RGB image; according to the target face Calculate the distance D1 from the target face to the face image acquisition device based on the pixel information in the corresponding target area in the depth image; If there is no face with a distance of D2 from the face image acquisition device in the depth image, it is determined that there is no interfering face in the RGB image; wherein, the difference between D1 and D2 Less than a preset threshold; if the interfering face does not exist in the RGB image, face recognition is performed based on the target face. 一種電腦儲存媒體,所述電腦可讀儲存媒體儲存一個或多個程式,所述一個或多個程式當被包括多個應用程式的電子設備執行時,使得所述電子設備執行以下操作:獲取用於人臉識別的RGB圖像和對應的深度圖像,所述RGB圖像中包含至少一個人臉;所述深度圖像通過深度圖像設備採集得到;從所述RGB圖像中選擇目標人臉;根據所述目標人臉在所述深度圖像中對應的目標區域內的像素點的資訊,計算所述目標人臉到人臉圖像採集設備的距離D1;若所述深度圖像中不存在到所述人臉圖像採集設備的距離為D2的人臉,則確定所述RGB圖像中不存在干擾人臉;其中,所述D1與D2的差值小於預設閾值;如果所述RGB圖像中不存在所述干擾人臉,則基於所述目標人臉進行人臉識別。 A computer storage medium, the computer-readable storage medium stores one or more programs, and when the one or more programs are executed by an electronic device including multiple application programs, the electronic device performs the following operations: An RGB image for face recognition and a corresponding depth image, the RGB image contains at least one face; the depth image is collected by a depth image device; the target face is selected from the RGB image Calculate the distance D1 from the target face to the face image acquisition device according to the pixel information of the target face in the target area corresponding to the depth image; if the depth image is not If there is a face with a distance of D2 from the face image collection device, it is determined that there is no interfering face in the RGB image; wherein the difference between D1 and D2 is less than a preset threshold; if the If the interfering face does not exist in the RGB image, face recognition is performed based on the target face.
TW108121633A 2018-08-24 2019-06-21 Face recognition method and device TWI716008B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810972167.2 2018-08-24
CN201810972167.2A CN109190539B (en) 2018-08-24 2018-08-24 Face recognition method and device

Publications (2)

Publication Number Publication Date
TW202009785A TW202009785A (en) 2020-03-01
TWI716008B true TWI716008B (en) 2021-01-11

Family

ID=64919537

Family Applications (1)

Application Number Title Priority Date Filing Date
TW108121633A TWI716008B (en) 2018-08-24 2019-06-21 Face recognition method and device

Country Status (3)

Country Link
CN (2) CN109190539B (en)
TW (1) TWI716008B (en)
WO (1) WO2020038140A1 (en)

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109190539B (en) * 2018-08-24 2020-07-07 阿里巴巴集团控股有限公司 Face recognition method and device
CN109905596A (en) * 2019-02-13 2019-06-18 深圳市云之梦科技有限公司 Photographic method, device, computer equipment and storage medium
CN110930547A (en) * 2019-02-28 2020-03-27 上海商汤临港智能科技有限公司 Vehicle door unlocking method, vehicle door unlocking device, vehicle door unlocking system, electronic equipment and storage medium
CN111860069A (en) * 2019-04-30 2020-10-30 百度时代网络技术(北京)有限公司 Image processing method and system
CN110533426A (en) * 2019-08-02 2019-12-03 深圳蚂里奥技术有限公司 A kind of method of payment and system
CN110991239A (en) * 2019-10-30 2020-04-10 珠海格力电器股份有限公司 Identity verification method, device, equipment and computer readable storage medium
CN111414858B (en) * 2020-03-19 2023-12-19 北京迈格威科技有限公司 Face recognition method, target image determining device and electronic system
CN111462227A (en) * 2020-03-27 2020-07-28 海信集团有限公司 Indoor personnel positioning device and method
CN111583333A (en) * 2020-05-19 2020-08-25 常州节卡智能装备有限公司 Temperature measurement method and device based on visual guidance, electronic equipment and storage medium
CN112150448B (en) * 2020-09-28 2023-09-26 杭州海康威视数字技术股份有限公司 Image processing method, device and equipment and storage medium
CN112580553A (en) * 2020-12-25 2021-03-30 深圳市商汤科技有限公司 Switch control method, device, computer equipment and storage medium
CN112733650B (en) * 2020-12-29 2024-05-07 深圳云天励飞技术股份有限公司 Target face detection method and device, terminal equipment and storage medium
CN112818874A (en) * 2021-02-03 2021-05-18 东莞埃科思科技有限公司 Image processing method, device, equipment and storage medium
CN112926498B (en) * 2021-03-20 2024-05-24 杭州知存智能科技有限公司 Living body detection method and device based on multichannel fusion and depth information local dynamic generation
CN113409056B (en) * 2021-06-30 2022-11-08 深圳市商汤科技有限公司 Payment method and device, local identification equipment, face payment system and equipment
CN113850165B (en) * 2021-09-13 2024-07-19 支付宝(杭州)信息技术有限公司 Face recognition method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101303724A (en) * 2007-05-10 2008-11-12 中国银联股份有限公司 Authentication authorization method and system
CN102610035A (en) * 2012-04-05 2012-07-25 广州广电运通金融电子股份有限公司 Financial self-service device and anti-peeping system and anti-peeping method thereof
CN103353935A (en) * 2013-07-19 2013-10-16 电子科技大学 3D dynamic gesture identification method for intelligent home system
TWI604332B (en) * 2017-03-24 2017-11-01 緯創資通股份有限公司 Method, system, and computer-readable recording medium for long-distance person identification

Family Cites Families (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040042643A1 (en) * 2002-08-28 2004-03-04 Symtron Technology, Inc. Instant face recognition system
CN101211484A (en) * 2006-12-25 2008-07-02 成都三泰电子实业股份有限公司 Method and device for preventing peep of cipher when withdrawing at ATM
CN101661557B (en) * 2009-09-22 2012-05-02 中国科学院上海应用物理研究所 Face recognition system and face recognition method based on intelligent card
US8810712B2 (en) * 2012-01-20 2014-08-19 Htc Corporation Camera system and auto focus method
US9712738B2 (en) * 2012-04-17 2017-07-18 E-Vision Smart Optics, Inc. Systems, devices, and methods for managing camera focus
KR20140046341A (en) * 2012-10-10 2014-04-18 노틸러스효성 주식회사 A security system for atm using face recognition and the method of using the same
CN103795864B (en) * 2014-01-29 2016-09-28 华为技术有限公司 The system of selection of mobile terminal front camera and rear camera and mobile terminal
CN107493435B (en) * 2015-03-05 2020-06-26 Oppo广东移动通信有限公司 Shooting method, terminal and related medium product
CN105260732A (en) * 2015-11-26 2016-01-20 小米科技有限责任公司 Image processing method and device
TW201727537A (en) * 2016-01-22 2017-08-01 鴻海精密工業股份有限公司 Face recognition system and face recognition method
CN105791685B (en) * 2016-02-29 2019-03-12 Oppo广东移动通信有限公司 Control method, control device and electronic device
CN106339673A (en) * 2016-08-19 2017-01-18 中山大学 ATM identity authentication method based on face recognition
CN107703962A (en) * 2017-08-26 2018-02-16 上海瞬动科技有限公司合肥分公司 A kind of unmanned plane group picture image pickup method
CN107657219B (en) * 2017-09-12 2021-06-15 Oppo广东移动通信有限公司 Face detection method and related product
CN107844744A (en) * 2017-10-09 2018-03-27 平安科技(深圳)有限公司 With reference to the face identification method, device and storage medium of depth information
CN107918726A (en) * 2017-10-18 2018-04-17 深圳市汉普电子技术开发有限公司 Apart from inducing method, equipment and storage medium
CN107862274A (en) * 2017-10-31 2018-03-30 广东欧珀移动通信有限公司 U.S. face method, apparatus, electronic equipment and computer-readable recording medium
CN107977650B (en) * 2017-12-21 2019-08-23 北京华捷艾米科技有限公司 Method for detecting human face and device
CN108230465B (en) * 2018-01-26 2020-05-15 深圳一卡通新技术有限公司 Mobile terminal-based gate quick passing control method
CN109190539B (en) * 2018-08-24 2020-07-07 阿里巴巴集团控股有限公司 Face recognition method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101303724A (en) * 2007-05-10 2008-11-12 中国银联股份有限公司 Authentication authorization method and system
CN102610035A (en) * 2012-04-05 2012-07-25 广州广电运通金融电子股份有限公司 Financial self-service device and anti-peeping system and anti-peeping method thereof
CN103353935A (en) * 2013-07-19 2013-10-16 电子科技大学 3D dynamic gesture identification method for intelligent home system
TWI604332B (en) * 2017-03-24 2017-11-01 緯創資通股份有限公司 Method, system, and computer-readable recording medium for long-distance person identification

Also Published As

Publication number Publication date
WO2020038140A1 (en) 2020-02-27
TW202009785A (en) 2020-03-01
CN109190539B (en) 2020-07-07
CN109190539A (en) 2019-01-11
CN111832535A (en) 2020-10-27

Similar Documents

Publication Publication Date Title
TWI716008B (en) Face recognition method and device
TWI686757B (en) Resource transfer method, fund payment method, device and electronic equipment
TWI701605B (en) Living body detection method, device and computer readable storage medium
US10740912B2 (en) Detection of humans in images using depth information
JP2022539910A (en) Electronic device screen area defect inspection method and apparatus
TWI717834B (en) Comparison method, device and electronic equipment based on multi-frame facial images
TW202006595A (en) Face recognition method and terminal device
CN109086734B (en) Method and device for positioning pupil image in human eye image
TWI750651B (en) Method, device and electronic equipment for protecting privacy information based on adversarial samples
WO2020051016A1 (en) Method, apparatus, and system for resource transfer
TW202121268A (en) Risk prediction method and device, risk prediction model training method and device and electronic equipment
CN112333356B (en) Certificate image acquisition method, device and equipment
US11036967B2 (en) Method and device for face selection, recognition and comparison
CN109344824A (en) A kind of line of text method for detecting area, device, medium and electronic equipment
CN112634201A (en) Target detection method and device and electronic equipment
JP2022519398A (en) Image processing methods, equipment and electronic devices
CN111274602A (en) Image characteristic information replacement method, device, equipment and medium
TWI736919B (en) Method, device and electronic equipment for verification and determination of verification mode
CN111860285B (en) User registration method, device, electronic equipment and storage medium
WO2023179523A1 (en) Positioning method and apparatus, and electronic device
CN109101947B (en) Portrait identification method, portrait identification device and terminal equipment
CN113850103A (en) Information processing method, device, equipment and storage medium