WO2022213348A1 - 检测口罩人脸识别方法、装置及计算机存储介质 - Google Patents

检测口罩人脸识别方法、装置及计算机存储介质 Download PDF

Info

Publication number
WO2022213348A1
WO2022213348A1 PCT/CN2021/086113 CN2021086113W WO2022213348A1 WO 2022213348 A1 WO2022213348 A1 WO 2022213348A1 CN 2021086113 W CN2021086113 W CN 2021086113W WO 2022213348 A1 WO2022213348 A1 WO 2022213348A1
Authority
WO
WIPO (PCT)
Prior art keywords
face
image
square
mask
area
Prior art date
Application number
PCT/CN2021/086113
Other languages
English (en)
French (fr)
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 鸿富锦精密工业(武汉)有限公司
Priority to CN202180000809.2A priority Critical patent/CN115529836A/zh
Priority to PCT/CN2021/086113 priority patent/WO2022213348A1/zh
Priority to US17/555,656 priority patent/US20220327862A1/en
Publication of WO2022213348A1 publication Critical patent/WO2022213348A1/zh

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/172Classification, e.g. identification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/22Image preprocessing by selection of a specific region containing or referencing a pattern; Locating or processing of specific regions to guide the detection or recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/32Normalisation of the pattern dimensions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/774Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting

Definitions

  • the present application relates to image processing technology, and in particular, to a face recognition method, device and computer storage medium for detecting masks.
  • the present application proposes a face recognition method for detecting masks, which reduces the probability of misjudgment and improves the accuracy of judgment by removing unnecessary information and focusing on key areas.
  • a face recognition method for detecting masks comprising:
  • the step of preprocessing the face region includes:
  • Coordinate correction is performed on the selection range of the face area, and a square face image area is obtained by amplification;
  • the training steps of the face recognition model include:
  • the step of preprocessing the face sample image wearing a mask includes:
  • Coordinate correction is performed on the selection range of the face region, and the obtained square face image region is amplified
  • the step of intercepting the square face image area includes:
  • the step of performing image scaling on the square face image area includes:
  • the face sample image is divided into a training set and a test set, the training set is used for training the face recognition model, and the test set is used to test the recognition accuracy of the face recognition model Rate.
  • the coordinate correction includes compensating for the height of the face region.
  • a face recognition device proposed by an embodiment of the present application includes a processor and a memory, the memory stores several computer-readable instructions, and the processor is configured to implement the above when executing the computer-readable instructions stored in the memory Steps to detect face recognition method of face mask.
  • a computer storage medium proposed by an embodiment of the present application is used to store computer-readable instructions, and when the instructions are executed, the steps of the above-mentioned method for detecting face recognition of masks are performed.
  • the face recognition method, device and computer storage medium for detecting masks of the present application realize high-accuracy recognition of people wearing masks by optimizing the training model for recognizing masks and focusing on analyzing key areas.
  • the beneficial effect of the invention further improves the application scope of face recognition.
  • FIG. 1 is a flowchart of a method for detecting face recognition of masks in an embodiment of the application
  • Fig. 2 is a flow chart of preprocessing the face region in the face recognition method for detecting masks shown in Fig. 1;
  • Fig. 3 is a flow chart of the training steps of the face recognition model in the face recognition method for detecting masks shown in Fig. 1;
  • FIG. 4 is a flow chart of the steps of preprocessing the face sample image wearing a mask in the face recognition method for detecting a mask shown in FIG. 1;
  • Fig. 5 is the comparison diagram of the face region of the face image to be recognized and the square face image in the face recognition method for detecting masks shown in Fig. 1;
  • FIG. 6 is a schematic diagram of a face recognition device according to an embodiment of the present application.
  • a face recognition method for detecting masks including:
  • S12 Perform face detection on the face image to be recognized to determine the face area
  • S14 Use the face recognition model to perform face recognition on the first image, and output the recognition result.
  • the method proposed in the present application adds step S13 to the conventional face recognition method, and preprocesses the face area to obtain a square image.
  • the face recognition model in S14 can be trained by YOLOv3, where the input of YOLOv3 requires a square image, so the preprocessing step effectively optimizes the use of the model, reduces the number of steps while maintaining the quality of the image, and thus maintains the quality of model recognition.
  • YOLO (you only look once) is an object detection algorithm based on a single end-to-end network, which realizes the output from the input of the original image to the output of the position and category of the object, with fast operation speed and low background false detection rate. , the advantages of strong versatility.
  • the steps of preprocessing the face region include:
  • S23 Perform image scaling on the square face image area to obtain a square face image, and the image specification of the square face image meets the input requirements of the YOLO framework.
  • the face area is optimized and expanded into a square face image area with a resolution rate to meet the input requirements of the YOLOv3 framework.
  • the training steps of the face recognition model include:
  • S34 Configure the YOLO framework, and use the labeled second image to train the YOLO framework to obtain a face recognition model.
  • Steps S31 to S34 are the process of training YOLOv3 through face sample images. Due to the targeted labeling work for the masks in the face sample images, the final face recognition model has the function of identifying the mask part. For the input image, the mask part can be marked. During the training process, as many images as possible wearing masks of various colors and shapes should be collected for training to achieve better recognition results.
  • the steps of preprocessing the face sample image wearing a mask include:
  • S41 Perform face detection on the image to be processed to determine the face area
  • S44 Perform image scaling on the square face area to obtain a square face image, and the specifications of the square face image meet the input requirements of the YOLO framework.
  • Steps S42 to S44 are consistent with steps S21 to S23, and are the same method of image processing for different face images or face regions respectively.
  • the step of intercepting a square face image area includes:
  • a region of interest (ROI, region of interest) function can be used to color and intercept a square face image region.
  • the region of interest function is a commonly used function in vision algorithms, and usually selects a region from a wider image range as the focus of subsequent image analysis.
  • the region of interest function has the advantages of reducing processing time and increasing calculation accuracy.
  • the step of performing image scaling on a square face image area includes:
  • the Resize function is a function in OpenCV dedicated to adjusting the size of an image.
  • the cv2.resize function is used to perform image scaling on a square face image area, in order to obtain a square image area with a resolution of 416*416.
  • the resolution of 416*416 conforms to the width and height of the input image of the YOLOv3 algorithm.
  • a square rather than a rectangular image area is obtained through preprocessing, so that when the YOLOv3 algorithm is used, there will be no stretching deformation due to image scaling, the image will not be distorted, and more face details can be preserved. Therefore, it can have a higher face recognition accuracy.
  • the face sample images can be divided into a training set and a test set, the training set is used for training the face recognition model, and the test set is used for testing the recognition accuracy of the face recognition model.
  • the 80%/20% rule is used to divide the face sample images, 80% is the training set, and 20% is the test set, so as to make full use of the limited samples.
  • the coordinate correction may include compensating for the height of the face region.
  • the face region 200 is a rectangular inner circle
  • the square face image region 300 after the preprocessing and compensation algorithm is a square outer circle.
  • the value of the face compensation coefficient can be set according to actual requirements, and is not limited to 0.1.
  • FIG. 6 is a schematic diagram of a hardware structure of a face recognition apparatus 100 provided by an embodiment of the present application.
  • the face recognition apparatus 100 may include a processor 1001 , a memory 1002 , a communication bus 1003 , and a camera 1004 .
  • the camera 1004 may be a CMOS or CCD camera.
  • Memory 1002 is used to store one or more computer programs 1005 .
  • One or more computer programs 1005 are configured to be executed by the processor 1001 .
  • the one or more computer programs 1005 may include instructions, and the above-mentioned instructions may be used to implement the above-mentioned face recognition method for detecting a mask in the face recognition apparatus 100 .
  • the structure illustrated in this embodiment does not constitute a specific limitation on the face recognition apparatus 100 .
  • the face recognition apparatus 100 may include more or less components than shown, or combine some components, or separate some components, or arrange different components.
  • the processor 1001 may include one or more processing units, for example, the processor 1001 may include an application processor (application processor, AP), a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP) ), controller, video codec, DSP, CPU, baseband processor, and/or neural-network processing unit (NPU), etc. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
  • application processor application processor, AP
  • graphics processor graphics processor
  • image signal processor image signal processor
  • ISP image signal processor
  • controller video codec
  • DSP digital signal processor
  • CPU central processing unit
  • baseband processor baseband processor
  • NPU neural-network processing unit
  • the processor 1001 may also be provided with a memory for storing instructions and data.
  • the memory in processor 1001 is cache memory. This memory may hold instructions or data that have just been used or recycled by the processor 1001 . If the processor 1001 needs to use the instruction or data again, it can be called directly from this memory. Repeated access is avoided, and the waiting time of the processor 1001 is reduced, thereby improving the efficiency of the system.
  • the processor 1001 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous transceiver (universal asynchronous transmitter) receiver/transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, SIM interface, and/or USB interface, etc.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transceiver
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • memory 1002 may include high-speed random access memory, and may also include non-volatile memory such as hard disk, internal memory, plug-in hard disk, Smart Media Card (SMC), Secure Digital (Secure) Digital, SD) card, flash card (Flash Card), at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.
  • non-volatile memory such as hard disk, internal memory, plug-in hard disk, Smart Media Card (SMC), Secure Digital (Secure) Digital, SD) card, flash card (Flash Card), at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.
  • This embodiment also provides a computer storage medium, where computer instructions are stored in the computer storage medium, and when the computer instructions are executed on the electronic device, the electronic device is made to execute the above-mentioned related method steps to realize the detection of the face mask and the face in the above-mentioned embodiment. recognition methods.
  • the present invention implements all or part of the processes in the methods of the above embodiments, and can also be completed by instructing relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program is processed When the device is executed, the steps of the foregoing method embodiments may be implemented.
  • the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file or some intermediate form, and the like.
  • the computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, removable hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory) , Random Access Memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable media may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction, for example, in some jurisdictions, according to legislation and patent practice, the computer-readable media Electric carrier signals and telecommunication signals are not included.
  • each functional unit in each embodiment of the present invention may be integrated in the same processing unit, or each unit may exist physically alone, or two or more units may be integrated in the same unit.
  • the above-mentioned integrated units can be implemented in the form of hardware, or can be implemented in the form of hardware plus software function modules.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computing Systems (AREA)
  • Databases & Information Systems (AREA)
  • Evolutionary Computation (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Image Analysis (AREA)

Abstract

一种检测口罩人脸识别方法、装置及计算机存储介质,属于图像处理领域。检测口罩人脸识别方法包括:获取待识别人脸图像(S11);对待识别人脸图像进行人脸检测,确定人脸区域(S12);对人脸区域进行预处理,得到正方形的第一图像(S13);使用人脸识别模型对第一图像进行人脸识别,并输出识别结果(S14)。通过对人脸检测结果进行预处理,得到正方形的人脸区域,优化了人脸识别的处理流程,可提高人脸识别的准确率。

Description

检测口罩人脸识别方法、装置及计算机存储介质 技术领域
本申请涉及图像处理技术,尤其涉及检测口罩人脸识别方法、装置及计算机存储介质。
背景技术
随着计算机技术的高速发展,人脸识别技术也得到了越来越多的重视,同时得到了越来越广泛的应用,例如监控系统、考勤记录、教育考试等需要验明身份的场合。
然而近年来,Covid-19新冠肺炎在全球范围内持续的肆虐为社会活动带来了严重的经济、财产、生命安全损失和威胁。戴口罩作为简单、有效、低成本的防疫措施,预计会在未来较长时间内被长期采用,因此各应用场景对人脸识别技术提出了新的技术要求,例如,在特定场合下对未戴口罩者进行提醒、人脸识别过程中对戴口罩者与未戴口罩者进行不同数据库的比对等。
发明内容
有鉴于此,本申请提出一种检测口罩人脸识别方法,通过清除不必要信息、聚焦关键区域的方式,降低误判的概率,提高了判别的准确率。
一种检测口罩人脸识别方法,包括:
获取待识别人脸图像;
对所述待识别人脸图像进行人脸检测,确定人脸区域;
对所述人脸区域进行预处理,得到正方形的第一图像;
使用人脸识别模型对所述第一图像进行人脸识别,并输出识别结果。
在至少一个实施方式中,所述对所述人脸区域进行预处理的步骤,包括:
对所述人脸区域的选取范围进行坐标修正,扩增得到正方形的人脸图像区域;
从所述待识别人脸图像中截取所述正方形的人脸图像区域;
对所述正方形的人脸图像区域进行图像缩放,得到正方形的人脸图像,所述正方形的人脸图像的图像规格符合YOLO框架的输入要求。
在至少一个实施方式中,所述人脸识别模型的训练步骤,包括:
获取戴口罩的人脸样本图像;
对所述戴口罩的人脸样本图像进行预处理,得到正方形的第二图像;
使用标注工具对所述第二图像中的口罩部分进行标注;
配置YOLO框架,并使用标注后的所述第二图像训练所述YOLO框架,得到所述人脸识别模型。
在至少一个实施方式中,所述对所述戴口罩的人脸样本图像进行预处理的步骤,包括:
对所述戴口罩的人脸样本图像进行人脸检测,确定人脸区域;
对所述人脸区域的选取范围进行坐标修正,扩增得到的正方形的人脸图像区域;
从所述戴口罩的人脸样本图像截取所述正方形的人脸图像区域;
对所述正方形的人脸图像区域进行图像缩放,得到正方形的人脸图像,所述正方形的人脸图像的规格符合所述YOLO框架的输入要求。
在至少一个实施方式中,所述截取所述正方形人脸图像区域的步骤,包括:
使用OpenCV的感兴趣区域函数截取所述正方形的人脸图像区域。
在至少一个实施方式中,所述对所述正方形的人脸图像区域进行图像缩放的步骤,包括:
使用OpenCV的cv2.resize函数对所述正方形人脸图像区域进行图像缩放。
在至少一个实施方式中,所述人脸样本图像划分为训练集与测试集,所 述训练集用于所述人脸识别模型的训练,所述测试集用于测试人脸识别模型的识别准确率。
在至少一个实施方式中,所述坐标修正包括对人脸区域的高度进行补偿。
本申请实施例提出的一种人脸识别装置,所述装置包括处理器及存储器,所述存储器存储有若干计算机可读指令,所述处理器用于执行存储器中存储的计算机可读指令时实现上述检测口罩人脸识别方法的步骤。
本申请实施例提出的一种计算机存储介质,用于存储计算机可读取的指令,所述指令被执行时执行上述检测口罩人脸识别方法的步骤。
相较于现有技术,本申请的检测口罩人脸识别方法、装置及计算机存储介质,通过优化训练识别口罩的模型,重点分析关键区域的方式,实现了对佩戴口罩的人进行高准确率识别的有益效果,进而提高了进行人脸识别的应用场合范围。
附图说明
本申请的上述和/或附加的方面和优点从结合下面附图对实施例的描述中将变得明显和容易理解,其中:
图1为本申请一实施例中检测口罩人脸识别方法的流程图;
图2为图1所示的检测口罩人脸识别方法中对人脸区域进行预处理的流程图;
图3为图1所示的检测口罩人脸识别方法中人脸识别模型的训练步骤流程图;
图4为图1所示的检测口罩人脸识别方法中对戴口罩的人脸样本图像进行预处理的步骤流程图;
图5为图1所示的检测口罩人脸识别方法中待识别人脸图像的人脸区域与正方形人脸图像的对比图;
图6为本申请一实施例中人脸识别装置的示意图。
主要元件符号说明
人脸识别装置              100
处理器                    1001
存储器                    1002
通信总线                  1003
摄像头                    1004
计算机程序                1005
人脸区域                  200
正方形的人脸图像区域      300
如下具体实施方式将结合上述附图进一步说明本申请。
具体实施方式
为了能够更清楚地理解本发明的上述目的、特征和优点,下面结合附图和具体实施方式对本发明进行详细描述。需要说明的是,在不冲突的情况下,本申请的实施方式及实施方式中的特征可以相互组合。
在下面的描述中阐述了很多具体细节以便于充分理解本发明,所描述的实施方式仅仅是本发明一部分实施方式,而不是全部的实施方式。
除非另有定义,本文所使用的所有的技术和科学术语与属于本发明的技术领域的技术人员通常理解的含义相同。本文中在本发明的说明书中所使用的术语只是为了描述具体的实施方式的目的,不是旨在于限制本发明。
请参阅图1,一种检测口罩人脸识别方法,包括:
S11:获取待识别人脸图像;
S12:对待识别人脸图像进行人脸检测,确定人脸区域;
S13:对人脸区域进行预处理,得到正方形的第一图像;
S14:使用人脸识别模型对第一图像进行人脸识别,并输出识别结果。
本申请提出的方法,在常规的人脸识别方法中增加了步骤S13,对人脸 区域进行预处理,进而得到正方形图像。S14中的人脸识别模型可以通过YOLOv3训练得到,其中YOLOv3的输入要求为正方形图像,因此预处理步骤有效优化了模型的使用,减少步骤数的同时保持了图像的质量,进而保持了模型识别的准确率。YOLO(you only look once)是一种对象检测算法,其基于一个单独的end-to-end网络,实现从原始图像的输入到物体位置和类别的输出,具有运算速度快、背景误检率低、通用性强的优点。
请参阅图2,于一实施例中,对人脸区域进行预处理的步骤,包括:
S21:对人脸区域的选取范围进行坐标修正,扩增得到正方形的人脸图像区域;
S22:从待识别人脸图像中截取正方形的人脸图像区域;
S23:对正方形的人脸图像区域进行图像缩放,得到正方形的人脸图像,正方形的人脸图像的图像规格符合YOLO框架的输入要求。
本实施例通过坐标修正,将人脸区域优化、扩增为分别率为正方形人脸图像区域,以配合YOLOv3框架的输入要求。坐标修正的具体方式可以为,将矩形的人脸区域坐标记为x1、x2、y1与y2,其中x1为左下坐标,x2为左上坐标,y1为右下坐标,y2为右上坐标,因此该区域的高h=y2-y1,宽w=x2-x1。新的区域的框选范围为正方形,正方形人脸图像区域的坐标为,x1_new=int(x1+(w*0.5-h*0.5)),x2_new=int(x1+(w*0.5+h*0.5)),y1,y2。
请参阅图3,于一实施例中,人脸识别模型的训练步骤,包括:
S31:获取戴口罩的人脸样本图像;
S32:对戴口罩的人脸样本图像进行预处理,得到正方形的第二图像;
S33:使用标注工具对第二图像中的口罩部分进行标注;
S34:配置YOLO框架,并使用标注后的第二图像训练YOLO框架,得到人脸识别模型。
步骤S31至S34是通过人脸样本图像对YOLOv3进行训练的过程。由于针对人脸样本图像中的口罩进行了针对性的标注工作,最终得到的人脸识别模型具有对口罩部分进行识别的功能,对于输入的图像,可以将口罩部分进 行标注。在训练过程中,应当尽量多的收集佩戴有各类不同颜色、不同形状口罩的图像用于训练,以达到更好的识别效果。
请参阅图4,于一实施例中,对戴口罩的人脸样本图像进行预处理的步骤,包括:
S41:对待处理图像进行人脸检测,确定人脸区域;
S42:对人脸区域的选取范围进行坐标修正,扩增得到的正方形的人脸图像区域;
S43:从戴口罩的人脸样本图像中截取正方形的人脸图像区域;
S44:对正方形的人脸区域进行图像缩放,得到正方形的人脸图像,正方形的人脸图像的规格符合YOLO框架的输入要求。
步骤S42至S44与步骤S21至S23一致,是分别针对不同的人脸图像或人脸区域进行图像处理的相同方法。
于一实施例中,截取正方形人脸图像区域的步骤,包括:
使用OpenCV的感兴趣区域函数截取正方形的人脸图像区域。
本实施例中,可以采用感兴趣区域函数(ROI,region of interest)对正方形人脸图像区域进行上色并截取。感兴趣区域函数是视觉算法中常用的一个函数,通常从更广的图像范围中选定一个区域,作为后续图像分析的重点。感兴趣区域函数具有减少处理时间、增加演算精度的优点。
于一实施例中,对正方形的人脸图像区域进行图像缩放的步骤,包括:
使用OpenCV的cv2.resize函数对正方形人脸图像区域进行图像缩放。
Resize函数是OpenCV中专用于对图像的大小进行调节的函数。本实施例中利用cv2.resize函数,将正方形人脸图像区域进行图像缩放,目的是得到分辨率为416*416的正方形图像区域。416*416的分辨率符合YOLOv3算法输入影像的宽度和高度。本申请中,通过预处理得到的是正方形而非矩形的图像区域,这样在使用YOLOv3算法时不会因为图像缩放而产生拉伸变形,图像不会失真,能够保留下更多的人脸细节,也因此能够有更高的人脸识别准确率。
于一实施例中,可以将人脸样本图像划分为训练集与测试集,训练集用于人脸识别模型的训练,测试集用于测试人脸识别模型的识别准确率。通常利用80%/20%规则将人脸样本图像进行划分,80%为训练集,20%为测试集,以对有限的样本实现充分的利用。
于一实施例中,坐标修正可以包括对人脸区域的高度进行补偿。为了避免在人脸侦测时有部分人脸未被选取,因此对人脸区域进行补偿,本实施例采用了人脸补偿系数可以为0.1的补偿算法,补偿后的图像高度为offset_h=int(0.1*h)。计算过程为x1_offset=x1_new-offset_h,y1_offset=y1-offset_h,经过补偿之后的正方形人脸区域最终坐标为:左上坐标(x1_offset,y1_offset),右下坐标(x2_new+offset_h,y2+offset_h)。如图5所示,人脸区域200为矩形的内圈,经过预处理及补偿算法之后的正方形的人脸图像区域300为正方形的外圈。
于本实施例中,人脸补偿系数的值可以根据实际需求进行设定,并不局限于0.1。
请参阅图6,本申请实施例提出的人脸识别装置100的硬件结构示意图。如图6所示,人脸识别装置100可以包括处理器1001、存储器1002、通信总线1003、摄像头1004。摄像头1004可以是CMOS或者CCD摄像头。存储器1002用于存储一个或多个计算机程序1005。一个或多个计算机程序1005被配置为被该处理器1001执行。该一个或多个计算机程序1005可以包括指令,上述指令可以用于实现在人脸识别装置100中执行上述检测口罩人脸识别方法。
可以理解的是,本实施例示意的结构并不构成对人脸识别装置100的具体限定。在另一些实施例中,人脸识别装置100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。
处理器1001可以包括一个或多个处理单元,例如:处理器1001可以包括应用处理器(application processor,AP),图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频 编解码器,DSP,CPU,基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
处理器1001还可以设置有存储器,用于存储指令和数据。在一些实施例中,处理器1001中的存储器为高速缓冲存储器。该存储器可以保存处理器1001刚用过或循环使用的指令或数据。如果处理器1001需要再次使用该指令或数据,可从该存储器中直接调用。避免了重复存取,减少了处理器1001的等待时间,因而提高了系统的效率。
在一些实施例中,处理器1001可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,SIM接口,和/或USB接口等。
在一些实施例中,存储器1002可以包括高速随机存取存储器,还可以包括非易失性存储器,例如硬盘、内存、插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)、至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。
本实施例还提供一种计算机存储介质,该计算机存储介质中存储有计算机指令,当该计算机指令在电子设备上运行时,使得电子设备执行上述相关方法步骤实现上述实施例中的检测口罩人脸识别方法。
本发明实现上述实施例方法中的全部或部分流程,也可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,所述计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算 机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质等。需要说明的是,所述计算机可读介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读介质不包括电载波信号和电信信号。
在本发明所提供的几个实施例中,应该理解到,所揭露的计算机装置和方法,可以通过其它的方式实现。例如,以上所描述的计算机装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
另外,在本发明各个实施例中的各功能单元可以集成在相同处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在相同单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能模块的形式实现。
对于本领域技术人员而言,显然本发明不限于上述示范性实施例的细节,而且在不背离本发明的精神或基本特征的情况下,能够以其他的具体形式实现本发明。因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的。此外,显然“包括”一词不排除其他单元或步骤,单数不排除复数。计算机装置权利要求中陈述的多个单元或计算机装置也可以由同一个单元或计算机装置通过软件或者硬件来实现。第一,第二等词语用来表示名称,而并不表示任何特定的顺序。
最后应说明的是,以上实施例仅用以说明本发明的技术方案而非限制,尽管参照较佳实施例对本发明进行了详细说明,本领域的普通技术人员应当理解,可以对本发明的技术方案进行修改或等同替换,而不脱离本发明技术方案的精神和范围。

Claims (10)

  1. 一种检测口罩人脸识别方法,其特征在于,包括:
    获取待识别人脸图像;
    对所述待识别人脸图像进行人脸检测,确定人脸区域;
    对所述人脸区域进行预处理,得到正方形的第一图像;
    使用人脸识别模型对所述第一图像进行人脸识别,并输出识别结果。
  2. 根据权利要求1所述的检测口罩人脸识别方法,其特征在于,所述对所述人脸区域进行预处理的步骤,包括:
    对所述人脸区域的选取范围进行坐标修正,扩增得到正方形的人脸图像区域;
    从所述待识别人脸图像中截取所述正方形的人脸图像区域;
    对所述正方形的人脸图像区域进行图像缩放,得到正方形的人脸图像,所述正方形的人脸图像的图像规格符合YOLO框架的输入要求。
  3. 根据权利要求1所述的检测口罩人脸识别方法,其特征在于,所述人脸识别模型的训练步骤,包括:
    获取戴口罩的人脸样本图像;
    对所述戴口罩的人脸样本图像进行预处理,得到正方形的第二图像;
    使用标注工具对所述第二图像中的口罩部分进行标注;
    配置YOLO框架,并使用标注后的所述第二图像训练所述YOLO框架,得到所述人脸识别模型。
  4. 根据权利要求3所述的检测口罩人脸识别方法,其特征在于,所述对所述戴口罩的人脸样本图像进行预处理的步骤,包括:
    对所述戴口罩的人脸样本图像进行人脸检测,确定人脸区域;
    对所述人脸区域的选取范围进行坐标修正,扩增得到正方形的人脸图像区域;
    对是戴口罩的人脸样本图像中截取所述正方形的人脸图像区域;
    对所述正方形的人脸图像区域进行图像缩放,得到正方形的人脸图像,所述正方形的人脸图像的规格符合所述YOLO框架的输入要求。
  5. 根据权利要求2或4所述的检测口罩人脸识别方法,其特征在于,所述截取所述正方形人脸图像区域的步骤,包括:
    使用OpenCV的感兴趣区域函数截取所述正方形的人脸图像区域。
  6. 根据权利要求2或4所述的检测口罩人脸识别方法,其特征在于,所述对所述正方形的人脸图像区域进行图像缩放的步骤,包括:
    使用OpenCV的cv2.resize函数对所述正方形人脸图像区域进行图像缩放。
  7. 根据权利要求3所述的检测口罩人脸识别方法,其特征在于,所述人脸样本图像划分为训练集与测试集,所述训练集用于所述人脸识别模型的训练,所述测试集用于测试人脸识别模型的识别准确率。
  8. 根据权利要求4所述的检测口罩人脸识别方法,其特征在于,所述坐标修正包括对人脸区域的高度进行补偿。
  9. 一种人脸识别装置,所述装置包括处理器及存储器,所述存储器存储有若干计算机可读指令,其特征在于,所述处理器用于执行存储器中存储的计算机可读指令时实现权利要求1至8任一项所述的检测口罩人脸识别方法的步骤。
  10. 一种计算机存储介质,用于存储计算机可读取的指令,其特征在于,所述指令被执行时执行权利要求1至8任一项所述的检测口罩人脸识别方法的步骤。
PCT/CN2021/086113 2021-04-09 2021-04-09 检测口罩人脸识别方法、装置及计算机存储介质 WO2022213348A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
CN202180000809.2A CN115529836A (zh) 2021-04-09 2021-04-09 检测口罩人脸识别方法、装置及计算机存储介质
PCT/CN2021/086113 WO2022213348A1 (zh) 2021-04-09 2021-04-09 检测口罩人脸识别方法、装置及计算机存储介质
US17/555,656 US20220327862A1 (en) 2021-04-09 2021-12-20 Method for detecting whether a face is masked, masked-face recognition device, and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/086113 WO2022213348A1 (zh) 2021-04-09 2021-04-09 检测口罩人脸识别方法、装置及计算机存储介质

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/555,656 Continuation-In-Part US20220327862A1 (en) 2021-04-09 2021-12-20 Method for detecting whether a face is masked, masked-face recognition device, and computer storage medium

Publications (1)

Publication Number Publication Date
WO2022213348A1 true WO2022213348A1 (zh) 2022-10-13

Family

ID=83510858

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/086113 WO2022213348A1 (zh) 2021-04-09 2021-04-09 检测口罩人脸识别方法、装置及计算机存储介质

Country Status (3)

Country Link
US (1) US20220327862A1 (zh)
CN (1) CN115529836A (zh)
WO (1) WO2022213348A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116092166A (zh) * 2023-03-06 2023-05-09 深圳市慧为智能科技股份有限公司 口罩人脸识别方法、装置、计算机设备及存储介质

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111062429A (zh) * 2019-12-12 2020-04-24 上海点泽智能科技有限公司 基于深度学习的厨师帽和口罩佩戴的检测方法
US20200180560A1 (en) * 2018-12-10 2020-06-11 Toyota Jidosha Kabushiki Kaisha Vehicle unlocking device and vehicle equipped therewith, unlocking system, and recording medium stored with program
CN111860160A (zh) * 2020-06-16 2020-10-30 北京华电天仁电力控制技术有限公司 一种室内检测口罩佩戴的方法
CN111931661A (zh) * 2020-08-12 2020-11-13 桂林电子科技大学 一种基于卷积神经网络的实时口罩佩戴检测方法
CN112085010A (zh) * 2020-10-28 2020-12-15 成都信息工程大学 一种基于图像识别的口罩检测和部署系统及方法
TW202046169A (zh) * 2019-06-06 2020-12-16 大陸商鴻富錦精密工業(武漢)有限公司 電子裝置及人臉識別方法
CN112232199A (zh) * 2020-10-15 2021-01-15 燕山大学 基于深度学习的佩戴口罩检测方法
CN112381987A (zh) * 2020-11-10 2021-02-19 中国人民解放军国防科技大学 基于人脸识别的智能门禁防疫系统
CN112417974A (zh) * 2020-10-23 2021-02-26 西安科锐盛创新科技有限公司 一种公共卫生监控方法

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210390840A1 (en) * 2020-06-11 2021-12-16 3D Industries Limited Self-supervised social distance detector
US11594335B2 (en) * 2020-12-02 2023-02-28 Optum, Inc. Augmented reality virus transmission risk detector

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200180560A1 (en) * 2018-12-10 2020-06-11 Toyota Jidosha Kabushiki Kaisha Vehicle unlocking device and vehicle equipped therewith, unlocking system, and recording medium stored with program
TW202046169A (zh) * 2019-06-06 2020-12-16 大陸商鴻富錦精密工業(武漢)有限公司 電子裝置及人臉識別方法
CN111062429A (zh) * 2019-12-12 2020-04-24 上海点泽智能科技有限公司 基于深度学习的厨师帽和口罩佩戴的检测方法
CN111860160A (zh) * 2020-06-16 2020-10-30 北京华电天仁电力控制技术有限公司 一种室内检测口罩佩戴的方法
CN111931661A (zh) * 2020-08-12 2020-11-13 桂林电子科技大学 一种基于卷积神经网络的实时口罩佩戴检测方法
CN112232199A (zh) * 2020-10-15 2021-01-15 燕山大学 基于深度学习的佩戴口罩检测方法
CN112417974A (zh) * 2020-10-23 2021-02-26 西安科锐盛创新科技有限公司 一种公共卫生监控方法
CN112085010A (zh) * 2020-10-28 2020-12-15 成都信息工程大学 一种基于图像识别的口罩检测和部署系统及方法
CN112381987A (zh) * 2020-11-10 2021-02-19 中国人民解放军国防科技大学 基于人脸识别的智能门禁防疫系统

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116092166A (zh) * 2023-03-06 2023-05-09 深圳市慧为智能科技股份有限公司 口罩人脸识别方法、装置、计算机设备及存储介质
CN116092166B (zh) * 2023-03-06 2023-06-20 深圳市慧为智能科技股份有限公司 口罩人脸识别方法、装置、计算机设备及存储介质

Also Published As

Publication number Publication date
CN115529836A (zh) 2022-12-27
US20220327862A1 (en) 2022-10-13

Similar Documents

Publication Publication Date Title
CN110084135B (zh) 人脸识别方法、装置、计算机设备及存储介质
WO2020147257A1 (zh) 一种人脸识别方法和装置
WO2021027135A1 (zh) 细胞检测模型训练方法、装置、计算机设备及存储介质
WO2022041396A1 (zh) 一种基于眼表特征的新冠肺炎(covid-19)疾病患者风险筛查深度学习系统
CN110287862B (zh) 基于深度学习的防偷拍检测方法
CN111967319B (zh) 基于红外和可见光的活体检测方法、装置、设备和存储介质
CN112507988B (zh) 一种图像处理方法、装置、存储介质及电子设备
WO2023045183A1 (zh) 图像处理
US11315360B2 (en) Live facial recognition system and method
CN112784835B (zh) 圆形印章的真实性识别方法、装置、电子设备及存储介质
US20220327861A1 (en) Method for recognizing masked faces, device for recognizing masked faces, and computer storage medium
CN111639629A (zh) 一种基于图像处理的猪只体重测量方法、装置及存储介质
WO2022135574A1 (zh) 肤色检测方法、装置、移动终端和存储介质
WO2021164466A1 (zh) 用户信息分析方法及系统
CN115131714A (zh) 视频图像智能检测分析方法及系统
WO2022213348A1 (zh) 检测口罩人脸识别方法、装置及计算机存储介质
WO2021189770A1 (zh) 基于人工智能的图像增强处理方法、装置、设备及介质
CN111242074A (zh) 一种基于图像处理的证件照背景替换方法
CN110674729A (zh) 基于热能估算的人数识别方法、计算机装置及计算机可读存储介质
CN111666911A (zh) 一种微表情数据的扩充方法及装置
CN114298985B (zh) 缺陷检测方法、装置、设备及存储介质
Zhang et al. Hand gesture detection and segmentation based on difference background image with complex background
CN111222446B (zh) 人脸识别方法、人脸识别装置及移动终端
CN110321782B (zh) 一种检测人体特征信号的系统
CN112565674A (zh) 一种可远程视频监控和控制的展厅中控系统

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21935577

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21935577

Country of ref document: EP

Kind code of ref document: A1