WO2020143330A1 - 一种人脸图像的捕捉方法、计算机可读存储介质及终端设备 - Google Patents
一种人脸图像的捕捉方法、计算机可读存储介质及终端设备 Download PDFInfo
- Publication number
- WO2020143330A1 WO2020143330A1 PCT/CN2019/118648 CN2019118648W WO2020143330A1 WO 2020143330 A1 WO2020143330 A1 WO 2020143330A1 CN 2019118648 W CN2019118648 W CN 2019118648W WO 2020143330 A1 WO2020143330 A1 WO 2020143330A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- image
- face
- voice
- area
- pixel
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
Definitions
- the present application relates to the field of image processing technology, and in particular, to a method for capturing a face image, a computer-readable storage medium, and a terminal device.
- Face recognition is one of the important applications of computer vision technology.
- This technology is a kind of biometric technology based on human facial feature information for identity recognition. Use the camera to collect images or video streams containing human faces, and automatically detect and track human faces in the images, and then perform facial recognition on the detected human faces.
- the face capturing method is to manually adjust the camera's photographing position manually so that the face is within the effective shooting range of the camera, but the camera cannot automatically capture the face image, and the user experience is poor.
- One of the purposes of the embodiments of the present application is to provide a method for capturing a face image, a computer-readable storage medium, and a terminal device, and aims to solve the problem that a face image cannot be automatically captured by a camera.
- the first aspect of the embodiments of the present application provides a method for capturing a face image, which may include:
- the face target is the area ratio of all the face images in the image to be detected The largest face image
- the vector direction connecting the second pixel point to the first pixel point is used as a search direction, and the camera is controlled to capture a face optimized image corresponding to the face target according to the search direction.
- a second aspect of the embodiments of the present application provides a device for capturing a face image, which may include:
- An acquisition unit used to acquire the image to be detected through the camera
- a recognition unit configured to recognize all face images from the image to be detected, and determine face targets from all the face images, the face targets being all the faces in the image to be detected The face image with the largest area in the image;
- a determining unit configured to determine that the center pixel of the face object is recorded as a first pixel, and determine that the center pixel of the image to be detected is recorded as a second pixel;
- the capturing unit is configured to use a vector direction connecting the second pixel to the first pixel as a search direction, and control the camera to optimize the face image corresponding to the face target according to the search direction To capture.
- a third aspect of the embodiments of the present application provides a computer-readable storage medium that stores computer-readable instructions.
- the computer-readable instructions When executed by a processor, the following steps are implemented:
- the face target is the area ratio of all the face images in the image to be detected The largest face image
- the vector direction connecting the second pixel point to the first pixel point is used as a search direction, and the camera is controlled to capture a face optimized image corresponding to the face target according to the search direction.
- a fourth aspect of the embodiments of the present application provides a terminal device, including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, and the processor executes the The computer-readable instructions implement the following steps:
- the face target is the area ratio of all the face images in the image to be detected The largest face image
- the vector direction connecting the second pixel point to the first pixel point is used as a search direction, and the camera is controlled to capture a face optimized image corresponding to the face target according to the search direction.
- a camera is used to obtain images to be detected, all face images are identified from the images to be detected, and face targets are determined from all the face images, and the face targets are those in the image to be detected.
- the face image with the largest area ratio among all face images through the above method, first determine the face target to be captured; then determine the center pixel point of the face target as the first pixel point, determine the The center pixel of the detected image is recorded as the second pixel, the vector direction connecting the second pixel to the first pixel is used as the search direction, and the camera is controlled to target the person according to the search direction
- the face-optimized image corresponding to the face target is captured.
- the search direction can be determined more accurately, and then the face image can be automatically captured through the camera.
- FIG. 1 is a schematic diagram of an implementation process of a method for capturing a face image provided by an embodiment of the present application
- FIG. 2 is a schematic diagram of an implementation process of a method for capturing a face image according to another embodiment of the present application
- FIG. 3 is a schematic diagram of a face image capturing device provided by an embodiment of the present application.
- FIG. 4 is a schematic diagram of a terminal device provided by an embodiment of the present application.
- the term “if” may be interpreted as “when” or “once” or “in response to determination” or “in response to detection” depending on the context .
- the phrase “if determined” or “if [described condition or event] is detected” can be interpreted in the context to mean “once determined” or “in response to a determination” or “once detected [described condition or event ]” or “In response to detection of [the described condition or event]”.
- FIG. 1 is a schematic diagram of an implementation process of a method for capturing a face image provided by an embodiment of the present application. As shown in the figure, the method may include the following steps:
- step S101 an image to be detected is acquired through a camera.
- the obtained image to be detected may contain face images and other biological images, or other object images, or may contain multiple face images, so first determine which face is the object to be captured, that is, determine Face target.
- Step S102 Identify all face images from the image to be detected, and determine a face target from all the face images.
- the face target is all the face images in the image to be detected The face image with the largest area ratio.
- face recognition is realized by recognizing human facial features, that is, recognizing human facial features such as eyes, nose, and mouth, and then recognizing human faces.
- the image to be detected may not include the facial features of the person, but includes the cheeks of the person. The cheek closest to the camera is probably the face target.
- the recognition of all face images from the image to be detected includes:
- S11 Determine whether the RGB value of each pixel in the image to be detected is within a preset range.
- the RGB range is preset according to the skin color of the person, that is, the preset range, and then the RGB value of each pixel in the image to be detected is judged to determine whether it falls within the preset range, that is, whether the RGB value of the pixel is consistent Characteristics of human skin color. Then, the image to be detected is binarized (that is, the RGB values of the pixels whose RGB values are within the preset range are set to the first preset value, and the RGB values of the pixels whose RGB values are not within the preset range are set to The second preset value), identify the pixels that match the human skin color.
- a pixel that matches the skin color of a person does not necessarily mean that the pixel is a pixel of a human cheek image, so it is necessary to further determine whether the image to be detected contains a human cheek.
- S13 Perform a search on the connected area of the binary image to obtain at least one connected area.
- G A region G in the complex plane, if any simple closed curve is made in it, and the interior of the closed curve always belongs to G, it is called G as a single connected region. If an area is not a single connected area, it is called a multi-connected area. The search of the connected area is a relatively mature existing technology, and there are many methods that can be implemented, which will not be repeated here.
- the third preset value can be determined in advance based on actual experience.
- the determining the face target from all face images includes:
- S21 Calculate the area of each face image to obtain a first area, and calculate the area of the image to be detected to obtain a second area.
- Calculating the area may be calculating the number of pixels included in the face image.
- Calculating the area ratio may be calculating the total number of pixels included in the image to be detected, and then dividing the number of pixels in the face image by the total number to the area percentage.
- the face image corresponding to the largest area ratio among all the calculated area ratios is recorded as a face target.
- face image A may be the face closest to the camera, then face image A may be recorded as a face target.
- step S103 it is determined that the center pixel of the face object is recorded as the first pixel, and it is determined that the center pixel of the image to be detected is recorded as the second pixel.
- the center pixel point of the face target is the pixel point at the center position in the area occupied by the face target
- the center pixel point of the image to be detected is the pixel point at the center position of the image to be detected.
- step S103 is executed to determine that the center pixel of the face target is recorded as The first pixel, and determine the center pixel of the image to be detected as the second pixel.
- Step S104 using the vector direction connecting the second pixel point to the first pixel point as a search direction, and controlling the camera to capture a face optimized image corresponding to the face target according to the search direction .
- the search direction is Control the camera along The direction captures the face-optimized image corresponding to the face target.
- the face-optimized image refers to an optimized image in which the face target becomes the maximum value.
- the face target can be completely displayed in the face-optimized image. If only some face targets can be displayed in a certain image to be detected, continue to control the camera to capture in the search direction until the complete face targets can be displayed in the captured image.
- a camera is used to obtain images to be detected, all face images are identified from the images to be detected, and face targets are determined from all the face images, and the face targets are those in the image to be detected.
- the face image with the largest area ratio among all face images through the above method, first determine the face target to be captured; then determine the center pixel point of the face target as the first pixel point, determine the The center pixel of the detected image is recorded as the second pixel, the vector direction connecting the second pixel to the first pixel is used as the search direction, and the camera is controlled to target the person according to the search direction
- the face-optimized image corresponding to the face target is captured.
- the search direction can be determined more accurately, and then the face image can be automatically captured through the camera.
- FIG. 2 is a schematic diagram of an implementation process of a method for capturing a face image according to another embodiment of the present application. As shown in the figure, the method may include the following steps:
- step S201 an image to be detected is acquired through a camera.
- Step S202 Identify all the face images from the image to be detected, and determine the face target from all the face images.
- Steps S201-S202 are the same as steps S101-S102. For details, please refer to the description of steps S101-S102, which will not be repeated here.
- the user can use the method in steps S101-S104 to automatically capture the face target through the camera, and also can control the camera by voice, and the camera automatically captures according to the user's voice instruction.
- the specific method is as follows.
- Step S203 if a user's voice instruction is received, a voice waveform corresponding to the voice instruction is generated.
- the horizontal axis of the speech waveform can represent time
- the vertical axis can represent the wave value, that is, the amplitude of the sound.
- Step S204 Divide the voice waveform into at least one voice band, and separately recognize the voice corresponding to each voice band to obtain the Chinese characters corresponding to each voice band.
- the dividing the voice waveform into at least one voice band includes:
- the wave value corresponding to the silent moment is less than the fourth preset value, and the wave value corresponding to the voice moment is greater than or equal to the fourth preset value.
- the continuous voice moments are marked as voice bands, which contain at least two voice moments.
- time 1-3 is the voice time, which is a continuous voice time, so the waveform corresponding to time 1-3 is marked as the voice band; time 4 and 6 are the silent time, time 5 It is a voice moment. Since the voice band should contain at least two voice moments, the waveform corresponding to the fifth moment cannot be marked as a voice band.
- the recognizing the voice corresponding to each voice band separately to obtain the Chinese characters corresponding to each voice band includes:
- the wave value corresponding to the wave value normalization processing at each time in the voice band A is 1, 0, 1, 1, respectively, and the voice codes are combined into the voice band A according to the time sequence
- the corresponding speech code is 1011, and the Chinese character matching 1011 in the preset coding table is "left".
- the voice instructions may not be clear, so the resulting voice coding may not be completely correct, as long as the Chinese character with the highest matching degree with the voice coding is found in the preset coding.
- the speech code is 1011.
- the Chinese characters corresponding to 1010 are "left” and the Chinese characters corresponding to 1100 are "right", but there are no Chinese characters corresponding to 1011.
- 1010 and 1011 have the highest matching degree, so the Chinese character "left” corresponding to 1010 can be determined as the Chinese character corresponding to 1011.
- step S205 the recognized Chinese characters are combined into sentences in chronological order, and a control instruction matching the sentence is searched in a preset instruction library.
- the sentence After determining the sentence corresponding to the voice instruction, the sentence should also be converted into a control instruction that can be recognized by the processor of the camera.
- the sentence can be natural speech
- the control instruction is machine language.
- Step S206 after finding a control instruction matching the sentence, controlling the camera to capture a face optimization image corresponding to the face target according to the control instruction.
- the camera can automatically capture the face-optimized image corresponding to the face target, and can also capture the face image corresponding to the face target according to the user's voice instruction. In this way, when the automatic capture of the camera is not timely or the result of the automatic capture does not meet the requirements, the face-optimized image that meets the requirements can be captured by manually controlling the camera. Through the above method, a more accurate face optimized image can be captured.
- a camera is used to acquire images to be detected, all facial images are identified from the images to be detected, and facial targets are determined from all facial images.
- the facial targets to be captured are first Confirm; then accept the user's voice command, and control the camera to automatically capture the face target according to the voice command.
- a voice waveform corresponding to the voice command is generated, the voice waveform is divided into at least one voice band, and the voice corresponding to each voice band is separately recognized to obtain the Chinese characters corresponding to each voice band, in chronological order Combine the recognized Chinese characters into a sentence, and search for a control instruction matching the sentence in a preset instruction library, and after finding a control instruction matching the sentence, control the camera to capture the camera according to the control instruction Describe the face target.
- the face target can be automatically captured more accurately.
- FIG. 3 is a schematic diagram of a face image capturing device provided by an embodiment of the present application. For convenience of description, only parts related to the embodiment of the present application are shown.
- the face image capturing device shown in FIG. 3 may be a software unit, a hardware unit, or a combination of software and hardware built into an existing terminal device, or may be integrated into the terminal device as an independent pendant. It can exist as an independent terminal device.
- the face image capturing device 3 includes:
- the obtaining unit 31 is configured to obtain an image to be detected through a camera.
- the recognition unit 32 is configured to recognize all face images from the image to be detected, and determine face targets from all the face images, and the face targets are all people in the image to be detected The face image with the largest area in the face image.
- the determining unit 33 is configured to determine that the center pixel of the face object is recorded as the first pixel, and determine that the center pixel of the image to be detected is recorded as the second pixel.
- the capturing unit 34 is configured to use a vector direction connecting the second pixel point to the first pixel point as a search direction, and control the camera to optimize the face corresponding to the face target according to the search direction The image is captured.
- the identification unit 32 includes:
- the first determination module is used to separately determine whether the RGB value of each pixel in the image to be detected is within a preset range.
- a setting module configured to set the RGB value of the pixel point whose RGB value is within the preset range to the first preset value, and set the RGB value of the pixel point whose RGB value is not within the preset range to the second preset value, to obtain The binary image of the image to be detected.
- a search module is used to search the binary image for connected regions to obtain at least one connected region.
- the second judgment module is used to judge whether the connected area contains holes.
- the third determining module is configured to determine whether the area of the connected area is greater than a third preset value if the connected area does not include holes.
- the first marking module is configured to mark the connected area as a face image if the area of the connected area is greater than a third preset value.
- the identification unit 32 further includes:
- the first calculation module is used to calculate the area of each face image to obtain the first area, and calculate the area of the image to be detected to obtain the second area.
- the second calculation module is used to calculate the area ratio of each first area to the second area respectively.
- the second labeling module is used to record the face image corresponding to the largest area ratio among all the calculated area ratios as a face target.
- the device 3 further includes:
- the receiving unit 35 is configured to generate a voice waveform corresponding to the voice instruction if the user's voice instruction is received before determining that the central pixel of the face target is recorded as the first pixel.
- the dividing unit 36 is configured to divide the voice waveform into at least one voice band, and separately recognize the voice corresponding to each voice band to obtain the Chinese characters corresponding to each voice band.
- the searching unit 37 is configured to combine the recognized Chinese characters into sentences in chronological order, and search for a control instruction matching the sentence in a preset instruction library.
- the control unit 38 is configured to, after finding a control instruction matching the sentence, control the camera to capture a face optimization image corresponding to the face target according to the control instruction.
- the determining unit 33 is further configured to execute the step of determining that the central pixel of the face object is recorded as the first pixel if the user's voice instruction is not received.
- the dividing unit 36 includes:
- the determining module is configured to determine a silent moment and a speech moment in the voice waveform, the wave value corresponding to the silent moment is less than a fourth preset value, and the wave value corresponding to the voice moment is greater than or equal to the fourth preset value.
- the third marking module is used to mark consecutive voice moments as voice bands, and the voice band includes at least two voice moments.
- the dividing unit 36 further includes:
- the normalization module is used to obtain the wave value corresponding to each voice moment in the voice band and perform normalization processing on the wave value.
- the combination module is used to search for the speech code corresponding to the normalized wave value, and combine the speech codes corresponding to each wave value into the speech code corresponding to the speech band in chronological order.
- the searching module is configured to search for a Chinese character matching a voice code corresponding to the voice band in a preset coding table to obtain a Chinese character corresponding to the voice band.
- the terminal device 4 of this embodiment includes: a processor 40, a memory 41, and computer-readable instructions 42 stored in the memory 41 and executable on the processor 40.
- the processor 40 executes the computer-readable instructions 42, the steps in the above embodiments of the method for capturing face images are implemented.
- the terminal device 4 may be a computing device such as a desktop computer, a notebook, a palmtop computer and a cloud server.
- the terminal device may include, but is not limited to, the processor 40 and the memory 41.
- FIG. 4 is only an example of the terminal device 4 and does not constitute a limitation on the terminal device 4, and may include more or less components than the illustration, or a combination of certain components or different components.
- the terminal device may further include an input and output device, a network access device, a bus, and the like.
- the so-called processor 40 can be a central processing unit (Central Processing Unit, CPU), or other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), Ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
- the general-purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
- the memory 41 may be an internal storage unit of the terminal device 4, such as a hard disk or a memory of the terminal device 4.
- the memory 41 may also be an external storage device of the terminal device 4, such as a plug-in hard disk equipped on the terminal device 4, a smart memory card (Smart, Media, Card, SMC), and a secure digital (SD) Cards, flash cards, etc.
- the memory 41 may include both an internal storage unit of the terminal device 4 and an external storage device.
- the memory 41 is used to store the computer-readable instructions and other programs and data required by the terminal device.
- the memory 41 can also be used to temporarily store data that has been or will be output.
- the disclosed device/terminal device and method may be implemented in other ways.
- the device/terminal device embodiments described above are only schematic.
- the division of the module or unit is only a logical function division, and in actual implementation, there may be another division manner, such as multiple units Or components can be combined or integrated into another system, or some features can be ignored or not implemented.
- the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
- the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
- each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
- the above integrated unit can be implemented in the form of hardware or software function unit.
- the integrated module/unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium.
- the present application implements all or part of the processes in the methods of the above embodiments, and can also be completed by instructing relevant hardware through computer-readable instructions, which can be stored in a computer-readable storage medium
- the computer readable instructions include computer program code
- the computer program code may be in the form of source code, object code, executable file, or some intermediate form.
- the computer-readable medium may include any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM, Read-Only Memory) , Random Access Memory (RAM, Random Access Memory), electrical carrier signals, telecommunications signals and software distribution media, etc.
- ROM Read-Only Memory
- RAM Random Access Memory
- electrical carrier signals telecommunications signals and software distribution media, etc.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Life Sciences & Earth Sciences (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Artificial Intelligence (AREA)
- Image Processing (AREA)
- Studio Devices (AREA)
Abstract
一种图像处理技术领域的人脸图像的捕捉方法、计算机可读存储介质及终端设备,包括:通过摄像头获取待检测图像(S101);从所述待检测图像中识别出所有的人脸图像,并从所有的人脸图像中确定人脸目标,所述人脸目标为所述待检测图像中的所有的人脸图像中面积占比最大的人脸图像(S102);确定所述人脸目标的中心像素点记为第一像素点,并确定所述待检测图像的中心像素点记为第二像素点(S103);将所述第二像素点到所述第一像素点连线的矢量方向作为搜索方向,并控制所述摄像头按照所述搜索方向对所述人脸目标对应的人脸优化图像进行捕获(S104)。通过上述方法,能够实现通过摄像头自动捕捉人脸图像。
Description
本申请要求于2019年01月18日提交中国专利局、申请号为201910017037.8、发明名称为“人脸图像的捕捉方法、计算机可读存储介质及终端设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及图像处理技术领域,尤其涉及一种人脸图像的捕捉方法、计算机可读存储介质及终端设备。
随着计算机视觉技术的快速发展,计算机视觉技术的应用也越来越广泛。人脸识别是计算机视觉技术的一个重要应用之一,这项技术是基于人的脸部特征信息进行身份识别的一种生物识别技术。用摄像头采集含有人脸的图像或视频流,并自动在图像中检测和跟踪人脸,进而对检测到的人脸进行脸部识别。
目前,人脸捕捉方法是通过人工手动调整摄像头的拍照位置,以使人脸处于摄像头的有效拍摄范围内,而无法通过摄像头自动捕捉人脸图像,用户体验较差。
本申请实施例的目的之一在于:提供一种人脸图像的捕捉方法、计算机可读存储介质及终端设备,旨在解决无法通过摄像头自动捕捉人脸图像的问题。
为解决上述技术问题,本申请实施例采用的技术方案是:
本申请实施例的第一方面,提供了人脸图像的捕捉方法,可以包括:
通过摄像头获取待检测图像;
从所述待检测图像中识别出所有的人脸图像,并从所有的人脸图像中确定人脸目标,所述人脸目标为所述待检测图像中的所有的人脸图像中面积占比最大的人脸图像;
确定所述人脸目标的中心像素点记为第一像素点,并确定所述待检测图像的中心像素点记为第二像素点;
将所述第二像素点到所述第一像素点连线的矢量方向作为搜索方向,并控制所述摄像头按照所述搜索方向对所述人脸目标对应的人脸优化图像进行捕获。
本申请实施例的第二方面,提供了人脸图像的捕捉装置,可以包括:
获取单元,用于通过摄像头获取待检测图像;
识别单元,用于从所述待检测图像中识别出所有的人脸图像,并从所有的人脸图像中确定人脸目标,所述人脸目标为所述待检测图像中的所有的人脸图像中面积占比最大的人脸图像;
确定单元,用于确定所述人脸目标的中心像素点记为第一像素点,并确定所述待检测图像的中心像素点记为第二像素点;
捕获单元,用于将所述第二像素点到所述第一像素点连线的矢量方向作为搜索方向,并控制所述摄像头按照所述搜索方向对所述人脸目标对应的人脸优化图像进行捕获。
本申请实施例的第三方面,提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可读指令,所述计算机可读指令被处理器执行时实现如下步骤:
通过摄像头获取待检测图像;
从所述待检测图像中识别出所有的人脸图像,并从所有的人脸图像中确定人脸目标,所述人脸目标为所述待检测图像中的所有的人脸图像中面积占比最大的人脸图像;
确定所述人脸目标的中心像素点记为第一像素点,并确定所述待检测图像的中心像素点记为第二像素点;
将所述第二像素点到所述第一像素点连线的矢量方向作为搜索方向,并控制所述摄像头按照所述搜索方向对所述人脸目标对应的人脸优化图像进行捕获。
本申请实施例的第四方面,提供了一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:
通过摄像头获取待检测图像;
从所述待检测图像中识别出所有的人脸图像,并从所有的人脸图像中确定人脸目标,所述人脸目标为所述待检测图像中的所有的人脸图像中面积占比最大的人脸图像;
确定所述人脸目标的中心像素点记为第一像素点,并确定所述待检测图像的中心像素点记为第二像素点;
将所述第二像素点到所述第一像素点连线的矢量方向作为搜索方向,并控制所述摄像头按照所述搜索方向对所述人脸目标对应的人脸优化图像进行捕获。
本申请实施例通过摄像头获取待检测图像,从待检测图像中识别出所有的人脸图像,并从所有的人脸图像中确定人脸目标,所述人脸目标为所述待检测图像中的所有的人脸图 像中面积占比最大的人脸图像,通过上述方法,先对要捕捉的人脸目标进行确定;然后确定人脸目标的中心像素点记为第一像素点,确定所述待检测图像的中心像素点记为第二像素点,将所述第二像素点到所述第一像素点连线的矢量方向作为搜索方向,并控制所述摄像头按照所述搜索方向对所述人脸目标对应的人脸优化图像进行捕获,通过上述方法,能够较准确地确定搜索方向,进而能够实现通过摄像头自动捕捉人脸图像。
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例提供的人脸图像的捕捉方法的实现流程示意图;
图2是本申请又一实施例提供的人脸图像的捕捉方法的实现流程示意图;
图3是本申请实施例提供的人脸图像的捕捉装置的示意图;
图4是本申请实施例提供的终端设备的示意图。
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。
应当理解,当在本说明书和所附权利要求书中使用时,术语“包括”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。
还应当理解,在此本申请说明书中所使用的术语仅仅是出于描述特定实施例的目的而并不意在限制本申请。如在本申请说明书和所附权利要求书中所使用的那样,除非上下文清楚地指明其它情况,否则单数形式的“一”、“一个”及“该”意在包括复数形式。
还应当进一步理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。
如在本说明书和所附权利要求书中所使用的那样,术语“如果”可以依据上下文被解释为“当...时”或“一旦”或“响应于确定”或“响应于检测到”。类似地,短语“如果确 定”或“如果检测到[所描述条件或事件]”可以依据上下文被解释为意指“一旦确定”或“响应于确定”或“一旦检测到[所描述条件或事件]”或“响应于检测到[所描述条件或事件]”。
为了说明本申请所述的技术方案,下面通过具体实施例来进行说明。
图1是本申请实施例提供的人脸图像的捕捉方法的实现流程示意图,如图所示,所述方法可以包括以下步骤:
步骤S101,通过摄像头获取待检测图像。
在实际应用中,获得的待检测图像中可能包含人脸图像和其它生物图像,或其它物体图像,也可能包含有多个人脸图像,所以首先要判断哪个人脸是需要捕捉的对象,即确定人脸目标。
步骤S102,从所述待检测图像中识别出所有的人脸图像,并从所有的人脸图像中确定人脸目标,所述人脸目标为所述待检测图像中的所有的人脸图像中面积占比最大的人脸图像。
通常,人脸识别是通过识别人的面部特征实现的,即识别人的眼睛、鼻子、嘴等面部特征,进而识别出人脸。但是在实际应用中,当人与摄像头距离过近时,待检测图像中可能未包含人的面部特征,但是包含了人的脸颊。而距离摄像头最近的这个脸颊很有可能就是人脸目标。
在一个实施例中,所述从所述待检测图像中识别出所有的人脸图像,包括:
S11,分别判断所述待检测图像中每个像素点的RGB值是否在预设范围内。
S12,将RGB值在预设范围内的像素点的RGB值设置为第一预设值,并将RGB值不在预设范围内像素点的RGB值设置为第二预设值,得到所述待检测图像的二值图像。
根据人的肤色预先设定RGB范围,即预设范围,然后对待检测图像中的每个像素点的RGB值进行判断,判断是否落入预设范围内,即判断该像素点的RGB值是否符合人的肤色特征。再然后,对待检测图像进行二值化处理(即将RGB值在预设范围内的像素点的RGB值设置为第一预设值,并将RGB值不在预设范围内像素点的RGB值设置为第二预设值),将符合人肤色的像素点识别出来。
但是符合人肤色的像素点不一定就说明该像素点就是人脸颊图像的一个像素点,所以还需要进一步判断,待检测图像中是否包含人的脸颊。
S13,对所述二值图像进行连通区域的搜索,得到至少一个连通区域。
复平面上的一个区域G,如果在其中任做一条简单闭曲线,而闭曲线的内部总属于G,就称G为单连通区域。一个区域如果不是单连通区域,就称为多连通区域。连通区域的搜索是比较成熟的现有技术,有很多方法可以实现,在此不做赘述。
S14,判断所述连通区域中是否包含孔洞。
因为人的脸颊的RGB值是比较均匀的,不会出现突兀的RGB差值,所以如果连通区域中出现孔洞,则说明该连通区域不是脸颊区域。
S15,若所述连通区域中不包含孔洞,则判断所述连通区域的面积是否大于第三预设值。
S16,若所述连通区域的面积大于第三预设值,则将所述连通区域标记为人脸图像。
当连通区域面积过小时,这个区域可能不是人脸颊区域。第三预设值可以根据实际经验提前确定。
在一个实施例中,所述从所有的人脸图像中确定人脸目标,包括:
S21,分别计算每个人脸图像的面积得到第一面积,并计算所述待检测图像的面积得到第二面积。
S22,分别计算每个第一面积与所述第二面积的面积比值。
计算面积,可以是计算人脸图像所包含的像素点的个数。计算面积比值,可以是计算待检测图像中包含的像素点的总个数,再将人脸图像的像素点的个数除以总个数的到面积百分比。
S23,将计算得到的所有面积比值中最大的面积比值对应的人脸图像记为人脸目标。
示例性的,假设获得了两个人脸图像A和B,其中A对应的面积比值为50%,B对应的面积比值为20%,说明待检测图像中人脸图像A所占的面积较大,进一步说明人脸图像A对应的人脸可能是最接近摄像头的人脸,那么可以将人脸图像A记为人脸目标。
步骤S103,确定所述人脸目标的中心像素点记为第一像素点,并确定所述待检测图像的中心像素点记为第二像素点。
人脸目标的中心像素点为人脸目标所占区域中位于中心位置的像素点,待检测图像的中心像素点为待检测图像中心位置处的像素点。
在一个实施例中,在确定所述人脸目标的中心像素点记为第一像素点之前,还需要判断是否接收到用户的语音指令,若接收到用户的语音指令,则根据用户的语音指令控制摄像头捕捉人脸目标对应的人脸优化图像(具体内容详见图2实施例中的描述);若未接收到用户的语音指令,则执行步骤S103,确定人脸目标的中心像素点记为第一像素点,并确定待检测图像的中心像素点记为第二像素点。
步骤S104,将所述第二像素点到所述第一像素点连线的矢量方向作为搜索方向,并控制所述摄像头按照所述搜索方向对所述人脸目标对应的人脸优化图像进行捕获。
其中,人脸优化图像是指人脸目标成为最大值的一个优化后的图像,换句话说,在人脸优化图像中能够完全的显示人脸目标。如果在某个待检测图像中只能显示部分人脸目标,则继续控制摄像头按照搜索方向进行捕获,直到捕获到的图像中能够显示完整的人脸目标。
本申请实施例通过摄像头获取待检测图像,从待检测图像中识别出所有的人脸图像,并从所有的人脸图像中确定人脸目标,所述人脸目标为所述待检测图像中的所有的人脸图像中面积占比最大的人脸图像,通过上述方法,先对要捕捉的人脸目标进行确定;然后确定人脸目标的中心像素点记为第一像素点,确定所述待检测图像的中心像素点记为第二像素点,将所述第二像素点到所述第一像素点连线的矢量方向作为搜索方向,并控制所述摄像头按照所述搜索方向对所述人脸目标对应的人脸优化图像进行捕获,通过上述方法,能够较准确地确定搜索方向,进而能够实现通过摄像头自动捕捉人脸图像。
参见图2,图2是本申请又一实施例提供的人脸图像的捕捉方法的实现流程示意图,如图所示,所述方法可以包括以下步骤:
步骤S201,通过摄像头获取待检测图像。
步骤S202,从所述待检测图像中识别出所有的人脸图像,并从所有的人脸图像中确定人脸目标。
步骤S201-S202与步骤S101-S102相同,具体可参见步骤S101-S102的描述,在此不再赘述。
在实际应用中,用户可以利用步骤S101-S104中的方法通过摄像头自动捕捉人脸目标,还可以对摄像头进行语音控制,摄像头根据用户的语音指令进行自动捕捉。具体的方法如下所示。
步骤S203,若接收到用户的语音指令,则生成所述语音指令对应的语音波形。
在实际应用中,语音波形中横轴可以表示时间,纵轴可以表示波值,即声音的幅值。
步骤S204,将所述语音波形划分为至少一个语音波段,并分别对每个语音波段对应的语音进行识别,得到每个语音波段对应的汉字。
在一个实施例中,所述将所述语音波形划分为至少一个语音波段,包括:
确定所述语音波形中的静音时刻和语音时刻,所述静音时刻对应的波值小于第四预设值,所述语音时刻对应的波值大于或等于第四预设值。
将连续的语音时刻标记为语音波段,所述语音波段包含至少两个语音时刻。
示例性的,假设第1时刻对应的波值为5,第2时刻对应的波值为6,第3时刻对应的波值为7,第4时刻对应的波值为1,第5时刻对应的波值为6,第6时刻对应的波值为2;假设第四预设值为3。那么根据上述实施例的描述,第1-3时刻为语音时刻,为连续的语音时刻,所以将第1-3时刻对应的波形标记为语音波段;第4、6时刻为静音时刻,第5时刻为语音时刻,由于语音波段中应包含至少两个语音时刻,所以第5时刻对应的波形不能被标记为语音波段。
在一个实施例中,所述分别对每个语音波段对应的语音进行识别,得到每个语音波段对应的汉字,包括:
获取所述语音波段中每个语音时刻对应的波值,并对所述波值进行归一化处理。
查找所述归一化处理后的波值对应的语音编码,并按照时间顺序将各个波值对应的语音编码组合成所述语音波段对应的语音编码。
在预设编码表中查找与所述语音波段对应的语音编码匹配的汉字,得到所述语音波段对应的汉字。
示例性的,假设语音波段A中每个时刻对应的波值归一化处理后的波值对应的语音编码分别为1、0、1、1,按照时间顺将各语音编码组合成语音波段A对应的语音编码为1011,在预设编码表中查找与1011匹配的汉字为“左”。
在实际应用中,语音指令可能会不太清楚,所以得到的语音编码可能不完全正确,只要在预设编码中查找到与语音编码匹配度最高的汉字即可。示例性的,语音编码为1011,在预设编码表中有1010对应的汉字为“左”,1100对应的汉字为“右”,但是没有1011对应的汉字,那么在1010和1100这两个语音编码中1010与1011的匹配度最高,所以可以将1010对应的汉字“左”确定为1011对应的汉字。
步骤S205,按照时间顺序将识别出的汉字组合成语句,并在预设指令库中查找与所述语句匹配的控制指令。
在确定出语音指令对应的语句后,还应该将语句转换为可供摄像头的处理器识别的控制指令。换句话说,语句可以是自然语音,而控制指令则为机器语言。
步骤S206,在查找到与所述语句匹配的控制指令后,根据所述控制指令控制所述摄像头捕捉所述人脸目标对应的人脸优化图像。
在实际中,摄像头可以根据对人脸目标对应的人脸优化图像进行自动捕捉,还可以根据用户的语音指令对人脸目标对应的人脸图像进行捕捉。这样,当摄像头自动捕捉不及时或自动捕捉的结果不符合要求时,能够通过人工控制摄像头捕捉到满足要求的人脸优化图像。通过上述方法,能够捕捉到更准确的人脸优化图像。
本申请实施例通过摄像头获取待检测图像,从待检测图像中识别出所有的人脸图像,并从所有的人脸图像中确定人脸目标,通过上述方法,先对要捕捉的人脸目标进行确定;然后接受用户的语音指令,根据语音指令控制摄像头对人脸目标进行自动捕获。具体的,生成所述语音指令对应的语音波形,将所述语音波形划分为至少一个语音波段,并分别对每个语音波段对应的语音进行识别,得到每个语音波段对应的汉字,按照时间顺序将识别出的汉字组合成语句,并在预设指令库中查找与所述语句匹配的控制指令,在查找到与所述语句匹配的控制指令后,根据所述控制指令控制所述摄像头捕捉所述人脸目标。通过上述方法,能够较准确地对人脸目标进行自动捕捉。
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
图3是本申请实施例提供的人脸图像的捕捉装置的示意图,为了便于说明,仅示出与本申请实施例相关的部分。
图3所示的人脸图像的捕捉装置可以是内置于现有的终端设备内的软件单元、硬件单元、或软硬结合的单元,也可以作为独立的挂件集成到所述终端设备中,还可以作为独立的终端设备存在。
所述人脸图像的捕捉装置3包括:
获取单元31,用于通过摄像头获取待检测图像。
识别单元32,用于从所述待检测图像中识别出所有的人脸图像,并从所有的人脸图像中确定人脸目标,所述人脸目标为所述待检测图像中的所有的人脸图像中面积占比最大的人脸图像。
确定单元33,用于确定所述人脸目标的中心像素点记为第一像素点,并确定所述待检测图像的中心像素点记为第二像素点。
捕获单元34,用于将所述第二像素点到所述第一像素点连线的矢量方向作为搜索方向,并控制所述摄像头按照所述搜索方向对所述人脸目标对应的人脸优化图像进行捕获。
可选的,所述识别单元32包括:
第一判断模块,用于分别判断所述待检测图像中每个像素点的RGB值是否在预设范围内。
设置模块,用于将RGB值在预设范围内的像素点的RGB值设置为第一预设值,并将RGB值不在预设范围内像素点的RGB值设置为第二预设值,得到所述待检测图像的二值图像。
搜索模块,用于对所述二值图像进行连通区域的搜索,得到至少一个连通区域。
第二判断模块,用于判断所述连通区域中是否包含孔洞。
第三判断模块,用于若所述连通区域中不包含孔洞,则判断所述连通区域的面积是否大于第三预设值。
第一标记模块,用于若所述连通区域的面积大于第三预设值,则将所述连通区域标记为人脸图像。
可选的,所述识别单元32还包括:
第一计算模块,用于分别计算每个人脸图像的面积得到第一面积,并计算所述待检测图像的面积得到第二面积。
第二计算模块,用于分别计算每个第一面积与所述第二面积的面积比值。
第二标记模块,用于将计算得到的所有面积比值中最大的面积比值对应的人脸图像记为人脸目标。
可选的,所述装置3还包括:
接收单元35,用于在确定所述人脸目标的中心像素点记为第一像素点之前,若接收到用户的语音指令,则生成所述语音指令对应的语音波形。
划分单元36,用于将所述语音波形划分为至少一个语音波段,并分别对每个语音波段对应的语音进行识别,得到每个语音波段对应的汉字。
查找单元37,用于按照时间顺序将识别出的汉字组合成语句,并在预设指令库中查找与所述语句匹配的控制指令。
控制单元38,用于在查找到与所述语句匹配的控制指令后,根据所述控制指令控制所述摄像头捕捉所述人脸目标对应的人脸优化图像。
确定单元33,还用于若未接收到用户的语音指令,则执行所述确定所述人脸目标的中心像素点记为第一像素点的步骤。
可选的,所述划分单元36包括:
确定模块,用于确定所述语音波形中的静音时刻和语音时刻,所述静音时刻对应的波值小于第四预设值,所述语音时刻对应的波值大于或等于第四预设值。
第三标记模块,用于将连续的语音时刻标记为语音波段,所述语音波段包含至少两个语音时刻。
可选的,所述划分单元36还包括:
归一化模块,用于获取所述语音波段中每个语音时刻对应的波值,并对所述波值进行归一化处理。
组合模块,用于查找所述归一化处理后的波值对应的语音编码,并按照时间顺序将各 个波值对应的语音编码组合成所述语音波段对应的语音编码。
查找模块,用于在预设编码表中查找与所述语音波段对应的语音编码匹配的汉字,得到所述语音波段对应的汉字。
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
图4是本申请实施例提供的终端设备的示意图。如图4所示,该实施例的终端设备4包括:处理器40、存储器41以及存储在所述存储器41中并可在所述处理器40上运行的计算机可读指令42。所述处理器40执行所述计算机可读指令42时实现上述各个人脸图像的捕捉方法实施例中的步骤。
所述终端设备4可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。所述终端设备可包括,但不仅限于,处理器40、存储器41。本领域技术人员可以理解,图4仅仅是终端设备4的示例,并不构成对终端设备4的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述终端设备还可以包括输入输出设备、网络接入设备、总线等。
所称处理器40可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
所述存储器41可以是所述终端设备4的内部存储单元,例如终端设备4的硬盘或内存。所述存储器41也可以是所述终端设备4的外部存储设备,例如所述终端设备4上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器41还可以既包括所述终端设备4的内部存储单元也包括外部存储设备。所述存储器41用于存储所述计算机可读指令以及所述终端 设备所需的其他程序和数据。所述存储器41还可以用于暂时地存储已经输出或者将要输出的数据。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
在本申请所提供的实施例中,应该理解到,所揭露的装置/终端设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/终端设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,也可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一计算机可读存储介质中,该计算机可读指令在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机可读指令包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质等。需要说明的是,所述计算机可读介质包含的内容可以根据司法管辖区内立法和专 利实践的要求进行适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读介质不包括是电载波信号和电信信号。
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。
Claims (20)
- 一种人脸图像的捕捉方法,其特征在于,包括:通过摄像头获取待检测图像;从所述待检测图像中识别出所有的人脸图像,并从所有的人脸图像中确定人脸目标,所述人脸目标为所述待检测图像中的所有的人脸图像中面积占比最大的人脸图像;确定所述人脸目标的中心像素点记为第一像素点,并确定所述待检测图像的中心像素点记为第二像素点;将所述第二像素点到所述第一像素点连线的矢量方向作为搜索方向,并控制所述摄像头按照所述搜索方向对所述人脸目标对应的人脸优化图像进行捕获。
- 如权利要求1所述的人脸图像的捕捉方法,其特征在于,所述从所述待检测图像中识别出所有的人脸图像,包括:分别判断所述待检测图像中每个像素点的RGB值是否在预设范围内;将RGB值在预设范围内的像素点的RGB值设置为第一预设值,并将RGB值不在预设范围内像素点的RGB值设置为第二预设值,得到所述待检测图像的二值图像;对所述二值图像进行连通区域的搜索,得到至少一个连通区域;判断所述连通区域中是否包含孔洞;若所述连通区域中不包含孔洞,则判断所述连通区域的面积是否大于第三预设值;若所述连通区域的面积大于第三预设值,则将所述连通区域标记为人脸图像。
- 如权利要求1所述的人脸图像的捕捉方法,其特征在于,所述从所有的人脸图像中确定人脸目标,包括:分别计算每个人脸图像的面积得到第一面积,并计算所述待检测图像的面积得到第二面积;分别计算每个第一面积与所述第二面积的面积比值;将计算得到的所有面积比值中最大的面积比值对应的人脸图像记为人脸目标。
- 如权利要求1所述的人脸图像的捕捉方法,其特征在于,所述确定所述人脸目标的中心像素点记为第一像素点之前,还包括:若接收到用户的语音指令,则生成所述语音指令对应的语音波形;将所述语音波形划分为至少一个语音波段,并分别对每个语音波段对应的语音进行识别,得到每个语音波段对应的汉字;按照时间顺序将识别出的汉字组合成语句,并在预设指令库中查找与所述语句匹配的控制指令;在查找到与所述语句匹配的控制指令后,根据所述控制指令控制所述摄像头捕捉所述人脸目标对应的人脸优化图像;若未接收到用户的语音指令,则执行所述确定所述人脸目标的中心像素点记为第一像素点的步骤。
- 如权利要求4所述的人脸图像的捕捉方法,其特征在于,所述将所述语音波形划分为至少一个语音波段,包括:确定所述语音波形中的静音时刻和语音时刻,所述静音时刻对应的波值小于第四预设值,所述语音时刻对应的波值大于或等于第四预设值;将连续的语音时刻标记为语音波段,所述语音波段包含至少两个语音时刻。
- 如权利要求5所述的人脸图像的捕捉方法,其特征在于,所述分别对每个语音波段对应的语音进行识别,得到每个语音波段对应的汉字,包括:获取所述语音波段中每个语音时刻对应的波值,并对所述波值进行归一化处理;查找所述归一化处理后的波值对应的语音编码,并按照时间顺序将各个波值对应的语音编码组合成所述语音波段对应的语音编码;在预设编码表中查找与所述语音波段对应的语音编码匹配的汉字,得到所述语音波段对应的汉字。
- 一种人脸图像的捕捉装置,其特征在于,包括:获取单元,用于通过摄像头获取待检测图像;识别单元,用于从所述待检测图像中识别出所有的人脸图像,并从所有的人脸图像中确定人脸目标,所述人脸目标为所述待检测图像中的所有的人脸图像中面积占比最大的人脸图像;确定单元,用于确定所述人脸目标的中心像素点记为第一像素点,并确定所述待检测图像的中心像素点记为第二像素点;捕获单元,用于将所述第二像素点到所述第一像素点连线的矢量方向作为搜索方向,并控制所述摄像头按照所述搜索方向对所述人脸目标对应的人脸优化图像进行捕获。
- 如权利要求7所述的人脸图像的捕捉装置,其特征在于,所述识别单元包括:第一判断模块,用于分别判断所述待检测图像中每个像素点的RGB值是否在预设范围内;设置模块,用于将RGB值在预设范围内的像素点的RGB值设置为第一预设值,并将RGB值不在预设范围内像素点的RGB值设置为第二预设值,得到所述待检测图像的二值图像;搜索模块,用于对所述二值图像进行连通区域的搜索,得到至少一个连通区域;第二判断模块,用于判断所述连通区域中是否包含孔洞;第三判断模块,用于若所述连通区域中不包含孔洞,则判断所述连通区域的面积是否大于第三预设值;第一标记模块,用于若所述连通区域的面积大于第三预设值,则将所述连通区域标记为人脸图像。
- 如权利要求7所述的人脸图像的捕捉装置,其特征在于,所述识别单元还包括:第一计算模块,用于分别计算每个人脸图像的面积得到第一面积,并计算所述待检测图像的面积得到第二面积;第二计算模块,用于分别计算每个第一面积与所述第二面积的面积比值;第二标记模块,用于将计算得到的所有面积比值中最大的面积比值对应的人脸图像记为人脸目标。
- 如权利要求7所述的人脸图像的捕捉装置,其特征在于,所述装置还包括:接收单元,用于在确定所述人脸目标的中心像素点记为第一像素点之前,若接收到用户的语音指令,则生成所述语音指令对应的语音波形;划分单元,用于将所述语音波形划分为至少一个语音波段,并分别对每个语音波段对应的语音进行识别,得到每个语音波段对应的汉字;查找单元,用于按照时间顺序将识别出的汉字组合成语句,并在预设指令库中查找与所述语句匹配的控制指令;控制单元,用于在查找到与所述语句匹配的控制指令后,根据所述控制指令控制所述摄像头捕捉所述人脸目标对应的人脸优化图像;确定单元,还用于若未接收到用户的语音指令,则执行所述确定所述人脸目标的中心像素点记为第一像素点的步骤。
- 如权利要求10所述的人脸图像的捕捉装置,其特征在于,所述划分单元包括:确定模块,用于确定所述语音波形中的静音时刻和语音时刻,所述静音时刻对应的波值小于第四预设值,所述语音时刻对应的波值大于或等于第四预设值;第三标记模块,用于将连续的语音时刻标记为语音波段,所述语音波段包含至少两个语音时刻。
- 如权利要求11所述的人脸图像的捕捉装置,其特征在于,所述划分单元还包括:归一化模块,用于获取所述语音波段中每个语音时刻对应的波值,并对所述波值进行归一化处理;组合模块,用于查找所述归一化处理后的波值对应的语音编码,并按照时间顺序将各个波值对应的语音编码组合成所述语音波段对应的语音编码;查找模块,用于在预设编码表中查找与所述语音波段对应的语音编码匹配的汉字,得到所述语音波段对应的汉字。
- 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可读指令,其特征在于,所述计算机可读指令被处理器执行时实现如下步骤:通过摄像头获取待检测图像;从所述待检测图像中识别出所有的人脸图像,并从所有的人脸图像中确定人脸目标,所述人脸目标为所述待检测图像中的所有的人脸图像中面积占比最大的人脸图像;确定所述人脸目标的中心像素点记为第一像素点,并确定所述待检测图像的中心像素点记为第二像素点;将所述第二像素点到所述第一像素点连线的矢量方向作为搜索方向,并控制所述摄像头按照所述搜索方向对所述人脸目标对应的人脸优化图像进行捕获。
- 如权利要求13所述的计算机可读存储介质,其特征在于,所述从所述待检测图像中识别出所有的人脸图像,包括:分别判断所述待检测图像中每个像素点的RGB值是否在预设范围内;将RGB值在预设范围内的像素点的RGB值设置为第一预设值,并将RGB值不在预设范围内像素点的RGB值设置为第二预设值,得到所述待检测图像的二值图像;对所述二值图像进行连通区域的搜索,得到至少一个连通区域;判断所述连通区域中是否包含孔洞;若所述连通区域中不包含孔洞,则判断所述连通区域的面积是否大于第三预设值;若所述连通区域的面积大于第三预设值,则将所述连通区域标记为人脸图像。
- 一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,其特征在于,所述处理器执行所述计算机可读指令时实现如下步骤:通过摄像头获取待检测图像;从所述待检测图像中识别出所有的人脸图像,并从所有的人脸图像中确定人脸目标,所述人脸目标为所述待检测图像中的所有的人脸图像中面积占比最大的人脸图像;确定所述人脸目标的中心像素点记为第一像素点,并确定所述待检测图像的中心像素点记为第二像素点;将所述第二像素点到所述第一像素点连线的矢量方向作为搜索方向,并控制所述摄像头按照所述搜索方向对所述人脸目标对应的人脸优化图像进行捕获。
- 如权利要求15所述的终端设备,其特征在于,所述从所述待检测图像中识别出所有的人脸图像,包括:分别判断所述待检测图像中每个像素点的RGB值是否在预设范围内;将RGB值在预设范围内的像素点的RGB值设置为第一预设值,并将RGB值不在预设范围内像素点的RGB值设置为第二预设值,得到所述待检测图像的二值图像;对所述二值图像进行连通区域的搜索,得到至少一个连通区域;判断所述连通区域中是否包含孔洞;若所述连通区域中不包含孔洞,则判断所述连通区域的面积是否大于第三预设值;若所述连通区域的面积大于第三预设值,则将所述连通区域标记为人脸图像。
- 如权利要求15所述的终端设备,其特征在于,所述从所有的人脸图像中确定人脸目标,包括:分别计算每个人脸图像的面积得到第一面积,并计算所述待检测图像的面积得到第二面积;分别计算每个第一面积与所述第二面积的面积比值;将计算得到的所有面积比值中最大的面积比值对应的人脸图像记为人脸目标。
- 如权利要求15所述的终端设备,其特征在于,所述确定所述人脸目标的中心像素点记为第一像素点之前,还包括:若接收到用户的语音指令,则生成所述语音指令对应的语音波形;将所述语音波形划分为至少一个语音波段,并分别对每个语音波段对应的语音进行识别,得到每个语音波段对应的汉字;按照时间顺序将识别出的汉字组合成语句,并在预设指令库中查找与所述语句匹配的控制指令;在查找到与所述语句匹配的控制指令后,根据所述控制指令控制所述摄像头捕捉所述人脸目标对应的人脸优化图像;若未接收到用户的语音指令,则执行所述确定所述人脸目标的中心像素点记为第一像素点的步骤。
- 如权利要求18所述的终端设备,其特征在于,所述将所述语音波形划分为至少一个语音波段,包括:确定所述语音波形中的静音时刻和语音时刻,所述静音时刻对应的波值小于第四预设值,所述语音时刻对应的波值大于或等于第四预设值;将连续的语音时刻标记为语音波段,所述语音波段包含至少两个语音时刻。
- 如权利要求19所述的终端设备,其特征在于,所述分别对每个语音波段对应 的语音进行识别,得到每个语音波段对应的汉字,包括:获取所述语音波段中每个语音时刻对应的波值,并对所述波值进行归一化处理;查找所述归一化处理后的波值对应的语音编码,并按照时间顺序将各个波值对应的语音编码组合成所述语音波段对应的语音编码;在预设编码表中查找与所述语音波段对应的语音编码匹配的汉字,得到所述语音波段对应的汉字。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910017037.8 | 2019-01-08 | ||
| CN201910017037.8A CN109858384B (zh) | 2019-01-08 | 2019-01-08 | 人脸图像的捕捉方法、计算机可读存储介质及终端设备 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2020143330A1 true WO2020143330A1 (zh) | 2020-07-16 |
Family
ID=66894236
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2019/118648 Ceased WO2020143330A1 (zh) | 2019-01-08 | 2019-11-15 | 一种人脸图像的捕捉方法、计算机可读存储介质及终端设备 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN109858384B (zh) |
| WO (1) | WO2020143330A1 (zh) |
Cited By (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112034892A (zh) * | 2020-09-09 | 2020-12-04 | 南京森林警察学院 | 麻醉式打击类警用智能化旋翼无人机及其控制方法及系统 |
| CN112200002A (zh) * | 2020-09-11 | 2021-01-08 | 深圳市优必选科技股份有限公司 | 一种体温测量方法、装置、终端设备及存储介质 |
| CN112686907A (zh) * | 2020-12-25 | 2021-04-20 | 联想(北京)有限公司 | 一种图像处理方法、设备及装置 |
| CN112764352A (zh) * | 2020-12-21 | 2021-05-07 | 深圳创维-Rgb电子有限公司 | 一种家居环境调节方法、装置、服务器及存储介质 |
| CN112967247A (zh) * | 2021-03-02 | 2021-06-15 | 大家智合(北京)网络科技股份有限公司 | 一种确定出血位的方法、装置、设备及存储介质 |
| CN117412180A (zh) * | 2023-12-15 | 2024-01-16 | 杭州三信网络技术有限公司 | 一种基于多相机联动目标监测的焊机和目标监测方法 |
| CN117549330A (zh) * | 2024-01-11 | 2024-02-13 | 四川省铁路建设有限公司 | 一种施工安全监测机器人系统及控制方法 |
Families Citing this family (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109858384B (zh) * | 2019-01-08 | 2023-10-27 | 平安科技(深圳)有限公司 | 人脸图像的捕捉方法、计算机可读存储介质及终端设备 |
| CN110488876A (zh) * | 2019-08-20 | 2019-11-22 | 斯威方德(深圳)智能科技有限公司 | 宠物喂食的方法、装置、存储介质以及计算机设备 |
| CN111583485A (zh) * | 2020-04-16 | 2020-08-25 | 北京澎思科技有限公司 | 小区门禁系统、门禁控制方法和装置、门禁单元及介质 |
| CN112036375B (zh) * | 2020-10-01 | 2024-05-07 | 奥比中光科技集团股份有限公司 | 一种检测红外图像与深度图像的方法、装置及人脸识别系统 |
| CN112395960A (zh) * | 2020-10-30 | 2021-02-23 | 四川天翼网络服务有限公司 | 一种基于高斯金字塔的图像最大人脸识别方法及系统 |
| CN116721500A (zh) * | 2023-06-27 | 2023-09-08 | 北京奥康达体育科技有限公司 | 一种室外智能体质测试系统 |
| CN120075599B (zh) * | 2023-11-20 | 2026-01-09 | 荣耀终端股份有限公司 | 人像捕捉方法、人像捕捉装置、电子设备及存储介质 |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20040131236A1 (en) * | 2002-12-30 | 2004-07-08 | Canon Kabushiki Kaisha | Method and apparatus for processing an image |
| CN107563979A (zh) * | 2017-08-31 | 2018-01-09 | 广东欧珀移动通信有限公司 | 图像处理方法、装置、计算机可读存储介质和计算机设备 |
| CN107590461A (zh) * | 2017-09-12 | 2018-01-16 | 广东欧珀移动通信有限公司 | 人脸识别方法及相关产品 |
| CN109858384A (zh) * | 2019-01-08 | 2019-06-07 | 平安科技(深圳)有限公司 | 人脸图像的捕捉方法、计算机可读存储介质及终端设备 |
Family Cites Families (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5159361A (en) * | 1989-03-09 | 1992-10-27 | Par Technology Corporation | Method and apparatus for obtaining the topography of an object |
| US8879801B2 (en) * | 2011-10-03 | 2014-11-04 | Qualcomm Incorporated | Image-based head position tracking method and system |
| US10169684B1 (en) * | 2015-10-01 | 2019-01-01 | Intellivision Technologies Corp. | Methods and systems for recognizing objects based on one or more stored training images |
| CN105898136A (zh) * | 2015-11-17 | 2016-08-24 | 乐视致新电子科技(天津)有限公司 | 摄像视角调节方法、系统及电视 |
| CN105718887A (zh) * | 2016-01-21 | 2016-06-29 | 惠州Tcl移动通信有限公司 | 基于移动终端摄像头实现动态捕捉人脸摄像的方法及系统 |
| CN106775424A (zh) * | 2017-01-13 | 2017-05-31 | 维沃移动通信有限公司 | 一种截屏处理方法及移动终端 |
| CN107193383B (zh) * | 2017-06-13 | 2020-04-07 | 华南师范大学 | 一种基于人脸朝向约束的二级视线追踪方法 |
-
2019
- 2019-01-08 CN CN201910017037.8A patent/CN109858384B/zh active Active
- 2019-11-15 WO PCT/CN2019/118648 patent/WO2020143330A1/zh not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20040131236A1 (en) * | 2002-12-30 | 2004-07-08 | Canon Kabushiki Kaisha | Method and apparatus for processing an image |
| CN107563979A (zh) * | 2017-08-31 | 2018-01-09 | 广东欧珀移动通信有限公司 | 图像处理方法、装置、计算机可读存储介质和计算机设备 |
| CN107590461A (zh) * | 2017-09-12 | 2018-01-16 | 广东欧珀移动通信有限公司 | 人脸识别方法及相关产品 |
| CN109858384A (zh) * | 2019-01-08 | 2019-06-07 | 平安科技(深圳)有限公司 | 人脸图像的捕捉方法、计算机可读存储介质及终端设备 |
Cited By (12)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112034892A (zh) * | 2020-09-09 | 2020-12-04 | 南京森林警察学院 | 麻醉式打击类警用智能化旋翼无人机及其控制方法及系统 |
| CN112034892B (zh) * | 2020-09-09 | 2024-04-12 | 南京森林警察学院 | 麻醉式打击类警用智能化旋翼无人机及其控制方法及系统 |
| CN112200002A (zh) * | 2020-09-11 | 2021-01-08 | 深圳市优必选科技股份有限公司 | 一种体温测量方法、装置、终端设备及存储介质 |
| CN112200002B (zh) * | 2020-09-11 | 2023-12-01 | 深圳市优必选科技股份有限公司 | 一种体温测量方法、装置、终端设备及存储介质 |
| CN112764352A (zh) * | 2020-12-21 | 2021-05-07 | 深圳创维-Rgb电子有限公司 | 一种家居环境调节方法、装置、服务器及存储介质 |
| CN112686907A (zh) * | 2020-12-25 | 2021-04-20 | 联想(北京)有限公司 | 一种图像处理方法、设备及装置 |
| CN112967247A (zh) * | 2021-03-02 | 2021-06-15 | 大家智合(北京)网络科技股份有限公司 | 一种确定出血位的方法、装置、设备及存储介质 |
| CN112967247B (zh) * | 2021-03-02 | 2023-11-17 | 大家智合(北京)网络科技股份有限公司 | 一种确定出血位的方法、装置、设备及存储介质 |
| CN117412180A (zh) * | 2023-12-15 | 2024-01-16 | 杭州三信网络技术有限公司 | 一种基于多相机联动目标监测的焊机和目标监测方法 |
| CN117412180B (zh) * | 2023-12-15 | 2024-03-15 | 杭州三信网络技术有限公司 | 一种基于多相机联动目标监测的焊机和目标监测方法 |
| CN117549330A (zh) * | 2024-01-11 | 2024-02-13 | 四川省铁路建设有限公司 | 一种施工安全监测机器人系统及控制方法 |
| CN117549330B (zh) * | 2024-01-11 | 2024-03-22 | 四川省铁路建设有限公司 | 一种施工安全监测机器人系统及控制方法 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN109858384B (zh) | 2023-10-27 |
| CN109858384A (zh) | 2019-06-07 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2020143330A1 (zh) | 一种人脸图像的捕捉方法、计算机可读存储介质及终端设备 | |
| CN109376596B (zh) | 人脸匹配方法、装置、设备及存储介质 | |
| CN113343826B (zh) | 人脸活体检测模型的训练方法、人脸活体检测方法及装置 | |
| CN109359575B (zh) | 人脸检测方法、业务处理方法、装置、终端及介质 | |
| CN108765278B (zh) | 一种图像处理方法、移动终端及计算机可读存储介质 | |
| CN110852310B (zh) | 三维人脸识别方法、装置、终端设备及计算机可读介质 | |
| WO2022174605A1 (zh) | 一种手势识别方法、手势识别装置及智能设备 | |
| CN107944020A (zh) | 人脸图像查找方法及装置、计算机装置和存储介质 | |
| WO2021004180A1 (zh) | 一种纹理特征提取方法、纹理特征提取装置及终端设备 | |
| WO2022082999A1 (zh) | 一种物体识别方法、装置、终端设备及存储介质 | |
| WO2022127112A1 (zh) | 跨模态人脸识别方法、装置、设备及存储介质 | |
| WO2020024484A1 (zh) | 用于输出数据的方法和装置 | |
| CN105160318A (zh) | 基于面部表情的测谎方法及系统 | |
| WO2022160202A1 (zh) | 佩戴口罩的检测方法、装置、终端设备及可读存储介质 | |
| WO2022127111A1 (zh) | 跨模态人脸识别方法、装置、设备及存储介质 | |
| CN108197250A (zh) | 图片检索方法、电子设备及存储介质 | |
| CN113298158B (zh) | 数据检测方法、装置、设备及存储介质 | |
| CN114612987A (zh) | 一种表情识别方法及装置 | |
| CN107506738A (zh) | 特征提取方法、图像识别方法、装置及电子设备 | |
| CN114783070A (zh) | 活体检测模型的训练方法、装置、电子设备及存储介质 | |
| CN114913540A (zh) | 一种手势识别方法及装置、电子设备 | |
| KR20210008075A (ko) | 시각 검색 방법, 장치, 컴퓨터 기기 및 저장 매체 (video search method and apparatus, computer device, and storage medium) | |
| CN110781770A (zh) | 基于人脸识别的活体检测方法、装置及设备 | |
| CN112287945A (zh) | 碎屏确定方法、装置、计算机设备及计算机可读存储介质 | |
| WO2020119058A1 (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: 19908528 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 19.11.2022) |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 19908528 Country of ref document: EP Kind code of ref document: A1 |