WO2021169501A1 - Living body video picture processing method and apparatus, computer device, and storage medium - Google Patents

Living body video picture processing method and apparatus, computer device, and storage medium Download PDF

Info

Publication number
WO2021169501A1
WO2021169501A1 PCT/CN2020/136434 CN2020136434W WO2021169501A1 WO 2021169501 A1 WO2021169501 A1 WO 2021169501A1 CN 2020136434 W CN2020136434 W CN 2020136434W WO 2021169501 A1 WO2021169501 A1 WO 2021169501A1
Authority
WO
WIPO (PCT)
Prior art keywords
picture
target picture
live video
pictures
video data
Prior art date
Application number
PCT/CN2020/136434
Other languages
French (fr)
Chinese (zh)
Inventor
张国辉
马爱国
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2021169501A1 publication Critical patent/WO2021169501A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/40Scenes; Scene-specific elements in video content
    • G06V20/46Extracting features or characteristics from the video content, e.g. video fingerprints, representative shots or key frames
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/20Processor architectures; Processor configuration, e.g. pipelining
    • 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/40Spoof detection, e.g. liveness detection
    • G06V40/45Detection of the body part being alive
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/231Content storage operation, e.g. caching movies for short term storage, replicating data over plural servers, prioritizing data for deletion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs
    • H04N21/23418Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs involving operations for analysing video streams, e.g. detecting features or characteristics
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • H04N21/234309Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements by transcoding between formats or standards, e.g. from MPEG-2 to MPEG-4 or from Quicktime to Realvideo

Definitions

  • a method for processing live video pictures comprising:
  • the above-mentioned live video picture processing method, device, computer equipment and storage medium receive live video detection requests and save the live video to the memory; calculate the number of pictures contained in the live video to be detected, and remove the live video
  • the frame pictures at the beginning and the end of the picture sequence are extracted at equal distances to obtain the target picture, and then the target picture is detected according to the reference frame in the video compression technology to ensure that the obtained target picture contains the complete information in the original live video.
  • decode the target picture after frame decimation detection to finally obtain the decoded target picture and output it to the underlying interface.
  • the computer device 110 receives the live video image processing request, obtains the test script corresponding to the live video image processing identifier in the computer device 110 according to the live video image processing identifier, and then executes the test script using the live video image processing tool to perform a test on the terminal 120 The application is tested, and the live video image processing result corresponding to the test script is obtained.
  • Figure 2 is a schematic diagram of the internal structure of a computer device in an embodiment.
  • the computer device includes a processor, a non-volatile storage medium, a memory, and a network interface connected through a system bus.
  • the non-volatile storage medium of the computer device stores an operating system, a database, and a computer program.
  • the database can store control information sequences.
  • the processor can realize a live video image.
  • the processor of the computer equipment is used to provide calculation and control capabilities, and supports the operation of the entire computer equipment.
  • Computer readable instructions may be stored in the memory of the computer device, and when the computer readable instructions are executed by the processor, the processor can make the processor execute a method for processing live video images.
  • Saving the original live video data packet to the memory for operation can improve the processing speed of the original live video data, because the speed of direct manipulation of the data in the memory is much higher than that of downloading the original live video data to the disk for operation. It is to improve the processing speed of the original live video data.
  • Step S306 decimating the pictures in the original live video data packet according to the number of pictures in the original live video data packet to obtain a target picture;
  • the equidistant extraction operation is also to prevent picture fraud, for example, the above 90 pictures
  • Step S410 Obtain picture angle information of the decoded target picture, and perform a picture rotation operation according to the picture angle information to adjust the decoded target picture to a picture with a normal angle;
  • Step S412 Feed back the decoded target picture to the bottom layer interface.
  • the picture frame extraction unit 806 is configured to extract frames from the pictures in the original live video data packet according to the number of pictures calculated by the original live video data packet calculation unit to obtain a target picture;

Abstract

A living body video picture processing method and apparatus, a computer device, and a storage medium, relating to living body detection of a biometric identification technology in the technical field of artificial intelligence. The method comprises: receiving a detection request of a living body video and storing the living body video into a memory (S302); obtaining an original living body video data packet, and calculating the number of pictures in the original living body video data packet (S304); performing frame extraction on the pictures in the original living body video data packet according to the number of the pictures in the original living body video data packet, so as to obtain a target picture (S306); decoding the target picture to obtain the decoded target picture (S308); and feeding back the decoded target picture to an underlying interface (S310). By directly operating in the memory, the intermediate processing links are reduced, the living body video arrangement processing performance is improved, the processing speeds of living body video detection and decoding are increased, and the performance loss of a GPU is reduced.

Description

活体视频图片处理方法、装置、计算机设备和存储介质Living body video picture processing method, device, computer equipment and storage medium
本申请要求于2020年02月26日提交中国专利局、申请号为202010119603.9,发明名称为“活体视频图片处理方法、装置、计算机设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on February 26, 2020, the application number is 202010119603.9, and the invention title is "live video image processing methods, devices, computer equipment, and storage media". The entire content is approved The reference is incorporated in this application.
技术领域Technical field
本申请涉及生物识别技术领域,特别是涉及活体检测中视频图片处理方法、装置和可读存储介质。This application relates to the field of biometrics technology, and in particular to methods, devices and readable storage media for processing video images in living body detection.
背景技术Background technique
人像识别作为一项成熟的生物识别技术,目前已经广泛应用于金融、教育、公安、社会服务、电子商务等领域。然而,人脸很容易用视频或照片进行复制后进行欺骗性识别,使得安全性存在问题。视频活体检测是目前应对这种安全问题的主要解决方案。As a mature biometric technology, portrait recognition has been widely used in finance, education, public security, social services, e-commerce and other fields. However, human faces can easily be deceptively recognized after being copied from videos or photos, which makes security problems. Video live detection is currently the main solution to this security problem.
现有技术视频活体检测中需要将视频解码出图片和声音,而活体检测仅需要对解码出来的图片进行检测,对解码出来的声音并不检测。在对图片检测活体置信度时,一般并不对所有视频图片进行检测,而只对大约3~6秒左右的视频进行检测,以视频码率25帧/秒计算,视频活体检测的视频总帧数大约在100帧左右,一般使用CPU解码并格式转换一张图片需要耗时20~40毫秒左右,100帧图片则需要2000~4000毫秒左右,耗时长并且浪费操作系统的资源。发明人意识到如果将视频下载到本地磁盘进行处理,又势必会增加磁盘于内存之间的IO访问量,降低处理速度。In the prior art video liveness detection, the video needs to be decoded into pictures and sounds, while the liveness detection only needs to detect the decoded pictures, and does not detect the decoded sounds. When detecting live body confidence in pictures, generally not all video pictures are tested, but only about 3~6 seconds of video. Calculated at a video bit rate of 25 frames per second, the total number of video frames for video live body detection It is about 100 frames. Generally, it takes about 20-40 milliseconds to decode and format a picture using the CPU, and about 2000-4000 milliseconds for a 100-frame picture, which takes a long time and wastes operating system resources. The inventor realizes that if the video is downloaded to a local disk for processing, it will inevitably increase the amount of IO access between the disk and the memory and reduce the processing speed.
此外,发明人意识到常规的视频活体检测解码器多为处理文件格式的视频,无法直接检测内存视频数据。并且,部分活体检测的视频来源于手机、平板电脑等移动终端设备,拍摄角度不同,视频活体检测解码需要对图像进行旋转操作,也需要耗费CPU的资源和处理时间。以上情况均会导致视频活体检测效率降低,用户体验不好。In addition, the inventor realizes that conventional video live detection decoders mostly process video in file formats, and cannot directly detect video data in the memory. In addition, part of the live body detection videos come from mobile terminal devices such as mobile phones and tablet computers, and the shooting angles are different. The video live body detection decoding needs to rotate the image, and also consumes CPU resources and processing time. The above situations will lead to a reduction in the efficiency of video live detection and a poor user experience.
因此,有必要对现有技术进行改进以期获得更好的用户体验。Therefore, it is necessary to improve the existing technology in order to obtain a better user experience.
技术问题technical problem
基于此,有必要针对存在的问题,提供一种活体检测中视频图片的处理方法、装置和可读存储介质,以改善现有视频活体检测的效率。Based on this, it is necessary to provide a method, device, and readable storage medium for processing video pictures in living body detection to improve the efficiency of existing video living body detection in response to the existing problems.
一种活体视频图片处理方法,所述方法包括:A method for processing live video pictures, the method comprising:
接收活体视频的检测请求并保存所述活体视频到内存;Receiving the detection request of the live video and saving the live video to the memory;
获取原始活体视频数据包,并计算出所述原始活体视频数据包中的图片数量;Acquiring an original live video data packet, and calculating the number of pictures in the original live video data packet;
根据所述原始活体视频数据包中的图片数量对所述原始活体视频数据包中的图片进行抽帧,以获得目标图片;Extracting frames from pictures in the original live video data packet according to the number of pictures in the original live video data packet to obtain a target picture;
对所述目标图片进行解码得到解码目标图片;Decode the target picture to obtain a decoded target picture;
将所述解码目标图片反馈给底层接口。Feed back the decoded target picture to the bottom layer interface.
一种活体视频图片处理装置,所述活体视频图片处理装置包括:A living body video picture processing device, the living body video picture processing device includes:
接收单元,用于接收活体视频的检测请求并将所述活体视频保存到内存;The receiving unit is configured to receive the detection request of the live video and save the live video to the memory;
原始活体视频数据包计算单元,用于计算出原始活体视频数据包中的图片数量;The original live video data packet calculation unit is used to calculate the number of pictures in the original live video data packet;
图片抽帧单元,用于根据所述原始活体视频数据包计算单元计算出来的图片数量,对所述原始活体视频数据包中的图片进行抽帧,以获取目标图片;The picture frame extraction unit is configured to extract frames from the pictures in the original live video data packet according to the number of pictures calculated by the original live video data packet calculation unit to obtain a target picture;
图片解码单元,用于将所述图片抽帧单元抽取的目标图片进行解码还原,以得到解码目标图片,并将所述解码目标图片反馈给底层接口。The picture decoding unit is configured to decode and restore the target picture extracted by the picture frame extraction unit to obtain the decoded target picture, and feed back the decoded target picture to the underlying interface.
一种计算机设备,包括存储器和处理器,所述存储器中存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行如下步骤:A computer device includes a memory and a processor. The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor executes the following steps:
接收活体视频的检测请求并保存所述活体视频到内存;Receiving the detection request of the live video and saving the live video to the memory;
获取原始活体视频数据包,并计算出所述原始活体视频数据包中的图片数量;Acquiring an original live video data packet, and calculating the number of pictures in the original live video data packet;
根据所述原始活体视频数据包中的图片数量对所述原始活体视频数据包中的图片进行抽帧,以获得目标图片;Extracting frames from pictures in the original live video data packet according to the number of pictures in the original live video data packet to obtain a target picture;
对所述目标图片进行解码得到解码目标图片;Decode the target picture to obtain a decoded target picture;
将所述解码目标图片反馈给底层接口。Feed back the decoded target picture to the bottom layer interface.
一种存储有计算机可读指令的存储介质,所述计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行如下步骤:A storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the following steps:
接收活体视频的检测请求并保存所述活体视频到内存;Receiving the detection request of the live video and saving the live video to the memory;
获取原始活体视频数据包,并计算出所述原始活体视频数据包中的图片数量;Acquiring an original live video data packet, and calculating the number of pictures in the original live video data packet;
根据所述原始活体视频数据包中的图片数量对所述原始活体视频数据包中的图片进行抽帧,以获得目标图片;Extracting frames from pictures in the original live video data packet according to the number of pictures in the original live video data packet to obtain a target picture;
对所述目标图片进行解码得到解码目标图片;Decode the target picture to obtain a decoded target picture;
将所述解码目标图片反馈给底层接口。Feed back the decoded target picture to the bottom layer interface.
上述活体视频图片处理方法、装置、计算机设备和存储介质,通过接收活体视频检测的请求,并将活体视频保存到内存;对需要检测的活体视频计算出其中所包含的图片数量,去掉活体视频中图片序列首尾的帧图片,再等距离抽取帧图片来得到目标图片,再对目标图片根据视频压缩技术中参考帧对其进行检测,以确保得到的目标图片包含了原始活体视频中的完整信息,最后将抽帧检测后的目标图片进行解码,以最终得到解码目标图片输出给底层接口。通过在内存中直接进行图片抽帧、解码的操作,避免了将活体视频下载到磁盘中进行操作,减少了磁盘的IO(Input and Output输入和输出)操作,直接在内存中的操作减少了中间处理环节,提高了活体视频整理处理性能,进而提高了活体视频检测解码视频的处理速度,节省了GPU的性能损耗。另外,在将解码目标图片输出到底层接口前,还可以对解码目标图片进行图片角度信息的处理,将非正常视角的图片进行角度旋转处理,得到正常视角的图片输出到底层接口,进一步减轻了底层SDK(Soft Development Kit软件开发工具包)的处理压力,提高活体视频检测的精度。The above-mentioned live video picture processing method, device, computer equipment and storage medium receive live video detection requests and save the live video to the memory; calculate the number of pictures contained in the live video to be detected, and remove the live video The frame pictures at the beginning and the end of the picture sequence are extracted at equal distances to obtain the target picture, and then the target picture is detected according to the reference frame in the video compression technology to ensure that the obtained target picture contains the complete information in the original live video. Finally, decode the target picture after frame decimation detection to finally obtain the decoded target picture and output it to the underlying interface. By directly performing picture frame extraction and decoding operations in the memory, the operation of downloading live videos to the disk is avoided, the IO (Input and Output) operations of the disk are reduced, and the operation directly in the memory reduces the number of intermediate operations. The processing link improves the processing performance of live video sorting, thereby increasing the processing speed of live video detection and decoding video, and saves GPU performance loss. In addition, before outputting the decoded target picture to the bottom interface, the decoded target picture can also be processed with the angle information of the picture, and the picture with the abnormal view angle can be rotated to obtain the picture with the normal view and output to the bottom interface, which further reduces The processing pressure of the underlying SDK (Soft Development Kit) improves the accuracy of live video detection.
技术解决方案Technical solutions
在此处键入技术解决方案描述段落。Type a paragraph describing the technical solution here.
有益效果Beneficial effect
在此处键入有益效果描述段落。Type a paragraph describing the beneficial effect here.
附图说明Description of the drawings
图1为一个实施例中提供的活体视频图片处理方法的实施环境图;FIG. 1 is an implementation environment diagram of a method for processing live video images provided in an embodiment;
图2为一个实施例中计算机设备的内部结构框图;Figure 2 is a block diagram of the internal structure of a computer device in an embodiment;
图3为一个实施例中活体视频图片处理方法的流程图;Fig. 3 is a flowchart of a method for processing live video images in an embodiment;
图4为另一个实施例中活体视频图片处理方法的流程图;FIG. 4 is a flowchart of a method for processing live video images in another embodiment;
图5为一个实施例中根据原始活体视频数据包中的图片数量对图片进行抽帧以获得目标图片的流程图;FIG. 5 is a flowchart of decimating a picture to obtain a target picture according to the number of pictures in the original live video data packet in an embodiment;
图6为一个实施例中对目标图片进行解码得到解码目标图片的流程图;Fig. 6 is a flowchart of decoding a target picture to obtain a decoded target picture in an embodiment;
图7为一个实施例中活体视频图片处理装置的结构框图;FIG. 7 is a structural block diagram of a living body video image processing device in an embodiment;
图8为另一个实施例中活体视频图片处理装置的结构框图;FIG. 8 is a structural block diagram of a living body video image processing device in another embodiment;
图9为一个实施例中图片抽帧单元的结构框图;FIG. 9 is a structural block diagram of a picture frame extraction unit in an embodiment;
图10为一个实施例中图片解码单元的结构框图。Fig. 10 is a structural block diagram of a picture decoding unit in an embodiment.
本发明的最佳实施方式The best mode of the present invention
在此处键入本发明的最佳实施方式描述段落。Type here a paragraph describing the best mode of the present invention.
本发明的实施方式Embodiments of the present invention
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solutions, and advantages of this application clearer and clearer, the following further describes the application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present application, and are not used to limit the present application.
图1为一个实施例中提供的活体视频图片处理方法的实施环境图,如图1所示,在该实施环境中,包括计算机设备110以及终端120。FIG. 1 is an implementation environment diagram of a method for processing live video images provided in an embodiment. As shown in FIG. 1, the implementation environment includes a computer device 110 and a terminal 120.
计算机设备110为活体视频图片处理设备,例如为测试人员使用的电脑等计算机设备,计算机设备110上安装有活体视频图片处理工具。终端120上安装有需要进行活体视频图片处理的应用,当需要进行活体视频图片处理时,测试人员可以在终端120发出活体视频图片处理请求,该活体视频图片处理请求中携带有活体视频图片处理标识,计算机设备110接收该活体视频图片处理请求,根据活体视频图片处理标识获取计算机设备110中与活体视频图片处理标识对应的测试脚本,然后利用活体视频图片处理工具执行该测试脚本,对终端120上的应用进行测试,并获取测试脚本对应的活体视频图片处理结果。The computer device 110 is a living body video image processing device, for example, a computer device used by a tester, and a living body video image processing tool is installed on the computer device 110. The terminal 120 is installed with an application that needs to process live video pictures. When the live video picture needs to be processed, the tester can send a live video picture processing request at the terminal 120, and the live video picture processing request carries a live video picture processing identifier. , The computer device 110 receives the live video image processing request, obtains the test script corresponding to the live video image processing identifier in the computer device 110 according to the live video image processing identifier, and then executes the test script using the live video image processing tool to perform a test on the terminal 120 The application is tested, and the live video image processing result corresponding to the test script is obtained.
需要说明的是,终端120以及计算机设备110可为智能手机、平板电脑、笔记本电脑、台式计算机、服务器等,但并不局限于此。计算机设备110以及终端120可以通过蓝牙、USB(Universal Serial Bus,通用串行总线)或者其他通讯连接方式进行连接,本申请在此不做限制。It should be noted that the terminal 120 and the computer device 110 may be a smart phone, a tablet computer, a notebook computer, a desktop computer, a server, etc., but are not limited thereto. The computer equipment 110 and the terminal 120 can be connected via Bluetooth, USB (Universal Serial Bus, Universal Serial Bus) or other communication connection methods for connection, this application is not limited here.
图2为一个实施例中计算机设备的内部结构示意图。如图2所示,该计算机设备包括通过系统总线连接的处理器、非易失性存储介质、存储器和网络接口。其中,该计算机设备的非易失性存储介质存储有操作系统、数据库和计算机程序,数据库中可存储有控件信息序列,该计算机程序被处理器执行时,可使得处理器实现一种活体视频图片处理方法。该计算机设备的处理器用于提供计算和控制能力,支撑整个计算机设备的运行。该计算机设备的存储器中可存储有计算机可读指令,该计算机可读指令被处理器执行时,可使得处理器执行一种活体视频图片处理方法。该计算机设备的网络接口用于与终端连接通信。本领域技术人员可以理解,图2中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Figure 2 is a schematic diagram of the internal structure of a computer device in an embodiment. As shown in Figure 2, the computer device includes a processor, a non-volatile storage medium, a memory, and a network interface connected through a system bus. Among them, the non-volatile storage medium of the computer device stores an operating system, a database, and a computer program. The database can store control information sequences. When the computer program is executed by the processor, the processor can realize a live video image. Approach. The processor of the computer equipment is used to provide calculation and control capabilities, and supports the operation of the entire computer equipment. Computer readable instructions may be stored in the memory of the computer device, and when the computer readable instructions are executed by the processor, the processor can make the processor execute a method for processing live video images. The network interface of the computer device is used to connect and communicate with the terminal. Those skilled in the art can understand that the structure shown in FIG. 2 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may Including more or fewer parts than shown in the figure, or combining some parts, or having a different arrangement of parts.
如图3所示,在一个实施例中,提出了一种方法,该方法可以应用于上述的计算机设备110中,具体可以包括以下步骤S302~S310:As shown in FIG. 3, in an embodiment, a method is proposed, which can be applied to the above-mentioned computer device 110, and specifically may include the following steps S302 to S310:
步骤S302,接收活体视频的检测请求并保存所述活体视频到内存;Step S302, receiving the detection request of the live video and saving the live video to the memory;
在本实施例中,接收活体视频的检测请求一般由计算机设备来完成,本实施例中采用后台服务器来完成,当然,此处采用后台服务器来完成并非限定于服务器来完成,如前所述的其他计算机设备也可以承担。在视频活体检测技术中,后台服务器承担着视频解码运算工作,将视频活体检测器设置在后台服务器端,在视频活体检测器接收到活体视频的检测请求后,视频活体检测器会获取到原始活体视频数据包,将原始活体视频数据包保存到内存中。将原始活体视频数据包保存到内存中进行操作,能够提高对原始活体视频数据的处理速度,因为在内存中对数据的直接操作速度远高于将原始活体视频数据下载到磁盘中进行操作,这是为了提高对原始活体视频数据处理的速度。In this embodiment, the detection request for receiving the live video is generally completed by a computer device. In this embodiment, a background server is used to complete. Of course, the use of a background server here is not limited to the server. As mentioned above Other computer equipment can also be undertaken. In the video in vivo detection technology, the background server is responsible for the video decoding operation work, and the video in vivo detector is set on the back-end server. After the video in vivo detector receives the detection request of the in vivo video, the video in vivo detector will obtain the original living body Video data packet, save the original live video data packet to the memory. Saving the original live video data packet to the memory for operation can improve the processing speed of the original live video data, because the speed of direct manipulation of the data in the memory is much higher than that of downloading the original live video data to the disk for operation. It is to improve the processing speed of the original live video data.
在一些实施例中,也可以将原始活体视频数据包保存到非易失性存储介质中进行处理。In some embodiments, the original live video data packet may also be saved in a non-volatile storage medium for processing.
步骤S304,获取原始活体视频数据包,并计算出所述原始活体视频数据包中的图片数量;Step S304: Obtain the original live video data packet, and calculate the number of pictures in the original live video data packet;
在本申请实施例中,视频解码器获取到原始活体视频数据包后,首先需要计算出原始活体视频数据包中所包含的帧图片的数量。在视频活体检测技术中,所需要检测的数量大概为3~6秒左右的视频数据,可根据不同的视频码率来进行确定。比如,3~6秒左右的视频中包含90幅帧图片,本实施例中将视频中包含的帧图片简称为图片,视频解码器获得原始活体视频数据包中的图片为90幅。In the embodiment of the present application, after the video decoder obtains the original live video data packet, it first needs to calculate the number of frame pictures included in the original live video data packet. In the video live detection technology, the amount of video data that needs to be detected is about 3 to 6 seconds, which can be determined according to different video bit rates. For example, a video of about 3 to 6 seconds contains 90 frame pictures. In this embodiment, the frame pictures included in the video are referred to as pictures for short, and the video decoder obtains 90 pictures in the original live video data packet.
步骤S306,根据所述原始活体视频数据包中的图片数量对所述原始活体视频数据包中的图片进行抽帧,以获得目标图片;Step S306: decimating the pictures in the original live video data packet according to the number of pictures in the original live video data packet to obtain a target picture;
本申请方法中,对原始活体视频数据包中的图片进行抽帧是关键点,抽帧,即抽取原始活体视频数据包中的关键帧图片,减少视频解码器处理图片的数量,使视频解码器对必要的图片进行处理,对非必要的图片不处理,进而节省系统资源,加快处理速度。In the method of this application, frame extraction of pictures in the original live video data packet is the key point. Frame extraction is to extract the key frame pictures in the original live video data packet to reduce the number of pictures processed by the video decoder and make the video decoder The necessary pictures are processed, and the non-essential pictures are not processed, thereby saving system resources and speeding up processing.
图5示出了一个实施例中根据原始活体视频数据包中的图片数量对图片进行抽帧以获得目标图片的流程图,具体可以包括以下步骤S502~S506:FIG. 5 shows a flowchart of extracting frames to obtain a target picture according to the number of pictures in the original live video data packet in an embodiment, which may specifically include the following steps S502 to S506:
步骤S502,获取所述原始活体视频数据包中的图片数量并编号;Step S502, obtaining and numbering the number of pictures in the original live video data packet;
在视频解码器获取到原始活体视频数据包中的图片数量后,还需要对原始活体视频数据包中的图片进行依序编号,比如,视频解码器获取到的原始活体视频数据包中包含90幅帧图片,即将该90幅图片依序从0~89进行编号。After the video decoder obtains the number of pictures in the original live video data packet, it also needs to sequentially number the pictures in the original live video data packet. For example, the original live video data packet obtained by the video decoder contains 90 pictures. Frame pictures, that is, the 90 pictures are numbered sequentially from 0 to 89.
步骤S504,删除编号在首尾的预设数量图片;Step S504: Delete the preset number of pictures numbered at the beginning and end;
对于原始活体视频数据包中的图片而言,必定存在关键帧和非关键帧,在现有视频压缩技术领域,每一帧代表一幅静止的图像,在实际压缩过程中,会采取各种算法进行减少数据的容量,IPB为最常见的手段。I帧又称为内部画面(intra picture),I帧表示关键帧,属于帧内压缩,解码时只需要本帧图片数据即可完成,P帧表示这一帧与之前一个关键帧(P帧)的差别,解码时需要用之前缓存的图片进行叠加上本帧定义的差别,以生成最终图片。B帧是双向差别帧,也即B帧记录了本帧与前后帧的差别,解码B帧,要取得之前的缓存图片,还要解码之后的图片,通过前后图片与本帧图片的叠加生成最终图片。B帧压缩率高,解码时CPU负担很重,因此,本申请采用关键帧I帧和非关键帧P帧来进行计算。For the pictures in the original live video data package, there must be key frames and non-key frames. In the field of existing video compression technology, each frame represents a still image. In the actual compression process, various algorithms will be adopted. To reduce the capacity of data, IPB is the most common method. I frame is also called intra picture. I frame represents key frame and belongs to intra-frame compression. Only the picture data of this frame is needed for decoding. P frame represents this frame and the previous key frame (P frame) When decoding, the previously buffered picture needs to be superimposed on the difference defined in this frame to generate the final picture. The B frame is a two-way difference frame, that is, the B frame records the difference between the current frame and the previous and next frames. To decode the B frame, the previous cached picture must be obtained, and the picture after decoding must be superimposed to generate the final picture. The B frame has a high compression rate and a heavy burden on the CPU during decoding. Therefore, this application uses a key frame I frame and a non-key frame P frame for calculation.
本实施例中,需要删除原始活体视频数据包中图片组的首尾预设的图片,具体而言,对于90幅的原始活体视频数据包来说,需要去掉首尾各15幅图片,此处,首尾各删除的15幅图片在于防止视频解码器接收到的原始活体视频数据为假图片,所删除的预设数量的图片也根据经验值得出,本领域技术人员均能够知晓根据所接收到的原始活体视频数据包中的帧图片进行适当调整。对于90幅图片的原始活体视频数据包,删除首尾的15幅图片后,剩下60帧图片。In this embodiment, the pictures preset at the beginning and the end of the picture group in the original live video data packet need to be deleted. Specifically, for 90 original live video data packets, 15 pictures at the beginning and the end need to be deleted. Here, the beginning and the end Each of the 15 deleted pictures is to prevent the original live video data received by the video decoder from being fake pictures. The preset number of deleted pictures is also worthy of experience based on experience. Those skilled in the art can know that the original live video data received The frame picture in the video data packet is adjusted appropriately. For the original live video data packet of 90 pictures, after deleting the first and last 15 pictures, 60 pictures are left.
步骤S506,对删除首尾的预设数量图片的剩余图片进行等距离抽取图片,以获得目标图片。Step S506: Perform equidistant extraction of the remaining pictures from the preset number of pictures deleted from the beginning and the end to obtain the target picture.
在删除掉原始活体视频数据包中首尾的预设数量图片后,需要对剩下的图片进行等距离的图片抽取操作,等距离抽取操作也是为了防止图片欺诈的情况发生,比如,上述90幅图片的原始活体视频数据包在删除首尾预设的图片后,剩下60帧图片,对该60帧图片进行等距离的抽取的等距离n=(90-15×2)÷(6+1)=8,根据该等距离n为8计算出需要抽取6幅图片,即从上述原始活体视频数据包中图片组的第15帧开始计算,分别抽取第24帧(15+8)、第32帧(24+8)、第40帧(32+8)、第48帧(40+8)、第56帧(48+8)、第64帧(56+8)等6帧图片,等距离抽取原始活体视频数据包中的图片后,即获得了目标图片。After deleting the preset number of pictures at the beginning and end of the original live video data packet, it is necessary to perform an equidistant picture extraction operation on the remaining pictures. The equidistant extraction operation is also to prevent picture fraud, for example, the above 90 pictures After deleting the preset pictures at the beginning and the end of the original live video data packet, there are 60 frames of pictures left, and the equidistant extraction of the 60 frames of pictures equidistant n=(90-15×2)÷(6+1)= 8. According to the distance n=8, it is calculated that 6 pictures need to be extracted, that is, the calculation starts from the 15th frame of the picture group in the original live video data packet, and the 24th frame (15+8) and the 32nd frame ( 24+8), the 40th frame (32+8), the 48th frame (40+8), the 56th frame (48+8), the 64th frame (56+8) and other 6 frames of pictures, the original living body is extracted at an equal distance After the picture in the video data packet, the target picture is obtained.
在一些实施例中,抽帧获取的目标图片在根据上述视频压缩技术中的关键帧I帧和非关键帧P帧对目标图片进行检测,以保证抽取的目标图片正确,能够准确表示原始活体视频,可以大概率规避恶意的攻击,提高检测性能和响应效果。In some embodiments, the target picture obtained by extracting frames is detected according to the key frame I frame and the non-key frame P frame in the above video compression technology to ensure that the extracted target picture is correct and can accurately represent the original live video. , It can avoid malicious attacks with a high probability, and improve the detection performance and response effect.
步骤S308,对所述目标图片进行解码得到解码目标图片;Step S308, decode the target picture to obtain a decoded target picture;
在本实施例中,得到适当的目标图片后,即可根据原始活体视频数据包的视频压缩技术对图片进行解码得到解码目标图片。In this embodiment, after the appropriate target picture is obtained, the picture can be decoded according to the video compression technology of the original live video data packet to obtain the decoded target picture.
图6示出了一个实施例中对目标图片进行解码得到解码目标图片的流程图,具体可以包括以下步骤S602~606:FIG. 6 shows a flowchart of decoding a target picture to obtain a decoded target picture in an embodiment, which may specifically include the following steps S602 to 606:
步骤S602,获取所述原始活体视频数据包中的关键帧I帧和非关键帧P帧;Step S602: Obtain a key frame I frame and a non-key frame P frame in the original live video data packet;
步骤S604,根据所述关键帧I帧和非关键帧P帧的信息对所述目标图片进行抽帧检测,确保所述目标图片包含了所述原始活体视频中的完整图片信息;Step S604: Perform frame extraction detection on the target picture according to the information of the key frame I frame and the non-key frame P frame to ensure that the target picture contains complete picture information in the original live video;
步骤S606,对抽帧检测后的所述目标图片进行解码,以得到解码目标图片。Step S606: Decode the target picture after frame extraction detection to obtain a decoded target picture.
步骤S310,将所述解码目标图片反馈给底层接口。Step S310: Feed back the decoded target picture to the bottom layer interface.
本实施例中,视频解码器在内存中将最后得到的解码目标图片输出到底层接口,比如底层的SDK(Software Development Kit软件开发工具包)中进行活体检测,以完成来自该SDK的活体视频检测请求。In this embodiment, the video decoder outputs the finally obtained decoded target picture in the memory to the underlying interface, for example, the underlying SDK (Software Development Kit) performs liveness detection to complete the liveness video detection from the SDK ask.
图4示出了在另一个实施例中,提出了一种活体视频图片处理方法,该方法可以应用于上述的计算机设备110中,为在上述活体视频图片处理方法基础上的进一步优化技术方案,具体可以包括以下步骤:FIG. 4 shows that in another embodiment, a method for processing live video images is proposed, which can be applied to the above-mentioned computer device 110, and is a further optimized technical solution based on the above-mentioned live video image processing method. Specifically, it can include the following steps:
步骤S402,接收活体视频的检测请求并保存所述活体视频到内存;Step S402, receiving the detection request of the live video and saving the live video to the memory;
在本实施例中,接收活体视频的检测请求一般由计算机设备来完成,本实施例中采用后台服务器来完成,当然,此处采用后台服务器来完成并非限定于服务器来完成,如前所述的其他计算机设备也可以承担。在视频活体检测技术中,后台服务器承担着视频解码运算工作,将视频活体检测器设置在后台服务器端,在视频活体检测器接收到活体视频的检测请求后,视频活体检测器会获取到原始活体视频数据包,将原始活体视频数据包保存到内存中。将原始活体视频数据包保存到内存中进行操作,能够提高对原始活体视频数据的处理速度,因为在内存中对数据的直接操作速度远高于将原始活体视频数据下载到磁盘中进行操作,这是为了提高对原始活体视频数据处理的速度。In this embodiment, the detection request for receiving the live video is generally completed by a computer device. In this embodiment, a background server is used to complete. Of course, the use of a background server here is not limited to the server. As mentioned above Other computer equipment can also be undertaken. In the video in vivo detection technology, the background server is responsible for the video decoding operation work, and the video in vivo detector is set on the back-end server. After the video in vivo detector receives the detection request of the in vivo video, the video in vivo detector will obtain the original living body Video data packet, save the original live video data packet to the memory. Saving the original live video data packet to the memory for operation can improve the processing speed of the original live video data, because the speed of direct manipulation of the data in the memory is much higher than that of downloading the original live video data to the disk for operation. It is to improve the processing speed of the original live video data.
在一些实施例中,也可以将原始活体视频数据包保存到非易失性存储介质中进行处理。In some embodiments, the original live video data packet may also be saved in a non-volatile storage medium for processing.
步骤S404,获取原始活体视频数据包,并计算出所述原始活体视频数据包中的图片数量;Step S404: Obtain the original live video data packet, and calculate the number of pictures in the original live video data packet;
在本申请实施例中,视频解码器获取到原始活体视频数据包后,首先需要计算出原始活体视频数据包中所包含的帧图片的数量。在视频活体检测技术中,所需要检测的数量大概为3~6秒左右的视频数据,可根据不同的视频码率来进行确定。比如,3~6秒左右的视频中包含90幅帧图片,本实施例中将视频中包含的帧图片简称为图片,视频解码器获得原始活体视频数据包中的图片为90幅。In the embodiment of the present application, after the video decoder obtains the original live video data packet, it first needs to calculate the number of frame pictures included in the original live video data packet. In the video live detection technology, the amount of video data that needs to be detected is about 3 to 6 seconds, which can be determined according to different video bit rates. For example, a video of about 3 to 6 seconds contains 90 frame pictures. In this embodiment, the frame pictures included in the video are referred to as pictures for short, and the video decoder obtains 90 pictures in the original live video data packet.
步骤S406,根据所述原始活体视频数据包中的图片数量对所述原始活体视频数据包中的图片进行抽帧,以获得目标图片;Step S406, extract frames from the pictures in the original live video data packet according to the number of pictures in the original live video data packet to obtain a target picture;
本申请方法中,对原始活体视频数据包中的图片进行抽帧是关键点,抽帧,即抽取原始活体视频数据包中的关键帧图片,减少视频解码器处理图片的数量,使视频解码器对必要的图片进行处理,对非必要的图片不处理,进而节省系统资源,加快处理速度。In the method of this application, frame extraction of pictures in the original live video data packet is the key point. Frame extraction is to extract the key frame pictures in the original live video data packet to reduce the number of pictures processed by the video decoder and make the video decoder The necessary pictures are processed, and the non-essential pictures are not processed, thereby saving system resources and speeding up processing.
图5示出了一个实施例中根据原始活体视频数据包中的图片数量对图片进行抽帧以获得目标图片的流程图,具体可以包括以下步骤S502~S506:FIG. 5 shows a flowchart of extracting frames from pictures to obtain a target picture according to the number of pictures in the original live video data packet in an embodiment, which may specifically include the following steps S502 to S506:
步骤S502,获取所述原始活体视频数据包中的图片数量并编号;Step S502, obtaining and numbering the number of pictures in the original live video data packet;
在视频解码器获取到原始活体视频数据包中的图片数量后,还需要对原始活体视频数据包中的图片进行依序编号,比如,视频解码器获取到的原始活体视频数据包中包含90幅帧图片,即将该90幅图片依序从0~89进行编号。After the video decoder obtains the number of pictures in the original live video data packet, it also needs to sequentially number the pictures in the original live video data packet. For example, the original live video data packet obtained by the video decoder contains 90 pictures. Frame pictures, that is, the 90 pictures are numbered sequentially from 0 to 89.
步骤S504,删除编号在首尾的预设数量图片;Step S504: Delete the preset number of pictures numbered at the beginning and end;
对于原始活体视频数据包中的图片而言,必定存在关键帧和非关键帧,在现有视频压缩技术领域,每一帧代表一幅静止的图像,在实际压缩过程中,会采取各种算法进行减少数据的容量,IPB为最常见的手段。I帧又称为内部画面(intra picture),I帧表示关键帧,属于帧内压缩,解码时只需要本帧图片数据即可完成,P帧表示这一帧与之前一个关键帧(P帧)的差别,解码时需要用之前缓存的图片进行叠加上本帧定义的差别,以生成最终图片。B帧是双向差别帧,也即B帧记录了本帧与前后帧的差别,解码B帧,要取得之前的缓存图片,还要解码之后的图片,通过前后图片与本帧图片的叠加生成最终图片。B帧压缩率高,解码时CPU负担很重,因此,本申请采用关键帧I帧和非关键帧P帧来进行计算。For the pictures in the original live video data package, there must be key frames and non-key frames. In the field of existing video compression technology, each frame represents a still image. In the actual compression process, various algorithms will be adopted. To reduce the capacity of data, IPB is the most common method. I frame is also called intra picture. I frame represents key frame and belongs to intra-frame compression. Only the picture data of this frame is needed for decoding. P frame represents this frame and the previous key frame (P frame) When decoding, the previously buffered picture needs to be superimposed on the difference defined in this frame to generate the final picture. The B frame is a two-way difference frame, that is, the B frame records the difference between the current frame and the previous and next frames. To decode the B frame, the previous cached picture must be obtained, and the picture after decoding must be superimposed to generate the final picture. The B frame has a high compression rate and a heavy burden on the CPU during decoding. Therefore, this application uses a key frame I frame and a non-key frame P frame for calculation.
本实施例中,需要删除原始活体视频数据包中图片组的首尾预设的图片,具体而言,对于90幅的原始活体视频数据包来说,需要去掉首尾各15幅图片,此处,首尾各删除的15幅图片在于防止视频解码器接收到的原始活体视频数据为假图片,所删除的预设数量的图片也根据经验值得出,本领域技术人员均能够知晓根据所接收到的原始活体视频数据包中的帧图片进行适当调整。对于90幅图片的原始活体视频数据包,删除首尾的15幅图片后,剩下60帧图片。In this embodiment, the pictures preset at the beginning and the end of the picture group in the original live video data packet need to be deleted. Specifically, for 90 original live video data packets, 15 pictures at the beginning and the end need to be deleted. Here, the beginning and the end Each of the 15 deleted pictures is to prevent the original live video data received by the video decoder from being fake pictures. The preset number of deleted pictures is also worthy of experience based on experience. Those skilled in the art can know that the original live video data received The frame picture in the video data packet is adjusted appropriately. For the original live video data packet of 90 pictures, after deleting the first and last 15 pictures, 60 pictures are left.
步骤S506,对删除首尾的预设数量图片的剩余图片进行等距离抽取图片,以获得目标图片。Step S506: Perform equidistant extraction of the remaining pictures from the preset number of pictures deleted from the beginning and the end to obtain the target picture.
在删除掉原始活体视频数据包中首尾的预设数量图片后,需要对剩下的图片进行等距离的图片抽取操作,等距离抽取操作也是为了防止图片欺诈的情况发生,比如,上述90幅图片的原始活体视频数据包在删除首尾预设的图片后,剩下60帧图片,对该60帧图片进行等距离的抽取的等距离n=(90-15×2)÷(6+1)=8,根据该等距离n为8计算出需要抽取6幅图片,即从上述原始活体视频数据包中图片组的第15帧开始计算,分别抽取第24帧(15+8)、第32帧(24+8)、第40帧(32+8)、第48帧(40+8)、第56帧(48+8)、第64帧(56+8)等6帧图片,等距离抽取原始活体视频数据包中的图片后,即获得了目标图片。After deleting the preset number of pictures at the beginning and end of the original live video data packet, it is necessary to perform an equidistant picture extraction operation on the remaining pictures. The equidistant extraction operation is also to prevent picture fraud, for example, the above 90 pictures After deleting the preset pictures at the beginning and the end of the original live video data packet, there are 60 frames of pictures left, and the equidistant extraction of the 60 frames of pictures equidistant n=(90-15×2)÷(6+1)= 8. According to the distance n=8, it is calculated that 6 pictures need to be extracted, that is, the calculation starts from the 15th frame of the picture group in the original live video data packet, and the 24th frame (15+8) and the 32nd frame ( 24+8), the 40th frame (32+8), the 48th frame (40+8), the 56th frame (48+8), the 64th frame (56+8) and other 6 frames of pictures, the original living body is extracted at an equal distance After the picture in the video data packet, the target picture is obtained.
在一些实施例中,抽帧获取的目标图片在根据上述视频压缩技术中的关键帧I帧和非关键帧P帧对目标图片进行检测,以保证抽取的目标图片正确,能够准确表示原始活体视频,可以大概率规避恶意的攻击,提高检测性能和响应效果。In some embodiments, the target picture obtained by extracting frames is detected according to the key frame I frame and the non-key frame P frame in the above video compression technology to ensure that the extracted target picture is correct and can accurately represent the original live video. , It can avoid malicious attacks with a high probability, and improve the detection performance and response effect.
步骤S408,对所述目标图片进行解码得到解码目标图片;Step S408, decode the target picture to obtain a decoded target picture;
在本实施例中,得到适当的目标图片后,即可根据原始活体视频数据包的视频压缩技术对图片进行解码得到解码目标图片。In this embodiment, after the appropriate target picture is obtained, the picture can be decoded according to the video compression technology of the original live video data packet to obtain the decoded target picture.
图6示出了一个实施例中对目标图片进行解码得到解码目标图片的流程图,具体可以包括以下步骤S602~606:FIG. 6 shows a flowchart of decoding a target picture to obtain a decoded target picture in an embodiment, which may specifically include the following steps S602 to 606:
步骤S602,获取所述原始活体视频数据包中的关键帧I帧和非关键帧P帧;Step S602: Obtain a key frame I frame and a non-key frame P frame in the original live video data packet;
步骤S604,根据所述关键帧I帧和非关键帧P帧的信息对所述目标图片进行抽帧检测,确保所述目标图片包含了所述原始活体视频中的完整图片信息;Step S604: Perform frame extraction detection on the target picture according to the information of the key frame I frame and the non-key frame P frame to ensure that the target picture contains complete picture information in the original live video;
步骤S606,对抽帧检测后的所述目标图片进行解码,以得到解码目标图片。Step S606: Decode the target picture after frame extraction detection to obtain a decoded target picture.
步骤S410,获取所述解码目标图片的图片角度信息,根据所述图片角度信息进行图片旋转操作将所述解码目标图片调整为正常角度的图片;Step S410: Obtain picture angle information of the decoded target picture, and perform a picture rotation operation according to the picture angle information to adjust the decoded target picture to a picture with a normal angle;
本实施例中,对于原始活体视频而言,有些原始活体视频来源于移动端,比如手机,手机拍摄视频时旋转的角度不同时,所拍摄出来的角度也不同,也即视频为非正常视角。此时,需要进一步对解码出来的解码目标图片进行旋转,即对解码目标图片进行转置90度或270度,或者镜像180度的操作,旋转到正常视角再反馈到底层接口。当然,旋转操作并非任意旋转,需要根据原始活体视频的角度信息来进行。具体可采取矩阵逆置或镜像等操作处理,以得到正常视角的解码目标图片。比如,图片为二维数组,宽W高H的RGB格式图片可以表示为array[W][H],数组的元素值包含(R,G,B)三个数值,RGB格式图像即为一个2维3层的矩阵,矩阵逆置就是对这个array[W][H]矩阵逆置为array[H][W]的矩阵,3层图像进行相同的矩阵逆置操作。In this embodiment, for the original live video, some of the original live video comes from a mobile terminal, such as a mobile phone. When the rotation angle of the mobile phone when shooting the video is different, the shooting angle is also different, that is, the video is an abnormal viewing angle. At this time, it is necessary to further rotate the decoded target picture, that is, transpose the decoded target picture by 90 degrees or 270 degrees, or mirror 180 degrees, rotate it to the normal viewing angle, and then feed it back to the underlying interface. Of course, the rotation operation is not arbitrary rotation, and needs to be performed based on the angle information of the original live video. Specifically, operations such as matrix inversion or mirroring can be used to obtain the decoded target picture of the normal view. For example, the picture is a two-dimensional array, the RGB format picture of width W and height H can be expressed as array[W][H], the element value of the array contains three values (R, G, B), and the RGB format image is one 2 For a three-dimensional matrix, the matrix inversion is to invert this array[W][H] matrix to the matrix of array[H][W], and perform the same matrix inversion operation on the 3-layer image.
步骤S412,将所述解码目标图片反馈给底层接口。Step S412: Feed back the decoded target picture to the bottom layer interface.
本实施例中,视频解码器在内存中将最后得到的解码目标图片输出到底层接口,比如底层的SDK(Software Development Kit软件开发工具包)中进行活体检测,以完成来自该SDK的活体视频检测请求。In this embodiment, the video decoder outputs the finally obtained decoded target picture in the memory to the underlying interface, for example, the underlying SDK (Software Development Kit) performs liveness detection to complete the liveness video detection from the SDK ask.
如图7所示,在一个实施例中,提供了一种活体视频图片处理装置,该活体视频图片处理装置可以集成于上述的计算机设备110中,具体可以包括接收单元702、原始活体视频数据包计算单元704、图片抽帧单元706以及图片解码单元708。As shown in FIG. 7, in one embodiment, a living body video image processing apparatus is provided. The living body video image processing apparatus may be integrated into the above-mentioned computer device 110, and may specifically include a receiving unit 702 and an original living body video data packet. The calculation unit 704, the picture frame extraction unit 706, and the picture decoding unit 708.
接收单元702,用于接收活体视频的检测请求并将所述活体视频保存到内存;The receiving unit 702 is configured to receive a detection request of a live video and save the live video to the memory;
原始活体视频数据包计算单元704,用于计算出原始活体视频数据包中的图片数量;The original live video data packet calculation unit 704 is configured to calculate the number of pictures in the original live video data packet;
图片抽帧单元706,用于根据所述原始活体视频数据包计算单元计算出来的图片数量,对所述原始活体视频数据包中的图片进行抽帧,以获取目标图片;The picture frame extraction unit 706 is configured to extract frames from the pictures in the original live video data packet according to the number of pictures calculated by the original live video data packet calculation unit to obtain a target picture;
图片解码单元708,用于将所述图片抽帧单元抽取的目标图片进行解码还原,以得到解码目标图片,并将所述解码目标图片反馈给底层接口。The picture decoding unit 708 is configured to decode and restore the target picture extracted by the picture frame extraction unit to obtain the decoded target picture, and feed back the decoded target picture to the underlying interface.
如图9所示,在一个实施例中,所述图片抽帧单元706还包括图片数量编号模块706A和图片抽帧处理模块706B。As shown in FIG. 9, in one embodiment, the picture frame extraction unit 706 further includes a picture quantity numbering module 706A and a picture frame extraction processing module 706B.
图片数量编号模块706A,用于获取到的所述原始活体视频数据包中的图片数量,并所述原始活体视频数据包中的图片进行编号;A picture quantity numbering module 706A, configured to obtain the number of pictures in the original live video data packet, and number the pictures in the original live video data packet;
图片抽帧处理模块706B,用于删除所述图片数量编号模块进行编号的所述原始活体视频数据包中图片编号在首尾的预设数量图片,并对剩余图片进行等距离抽取图片,以获得目标图片。The picture frame extraction processing module 706B is used to delete a preset number of pictures with picture numbers at the beginning and the end of the original live video data packet numbered by the picture number numbering module, and extract pictures at equal distances from the remaining pictures to obtain the target picture.
如图10所示,在一个实施例中,所述图片解码单元708还包括参考帧获取模块708A、图片抽帧检测模块708B和图片解码模块708C。As shown in FIG. 10, in one embodiment, the picture decoding unit 708 further includes a reference frame acquisition module 708A, a picture frame detection module 708B, and a picture decoding module 708C.
参考帧获取模块708A,用于获取所述原始活体视频数据包中的关键帧I帧和非关键帧P帧;The reference frame obtaining module 708A is configured to obtain the key frame I frame and the non-key frame P frame in the original live video data packet;
图片抽帧检测模块708B,用于根据所述参考帧获取模块获取的关键帧I帧和非关键帧P帧的信息,对所述目标图片进行抽帧检测;The picture frame extraction detection module 708B is configured to perform frame extraction detection on the target picture according to the information of the key frame I frame and the non-key frame P frame acquired by the reference frame acquisition module;
图片解码模块708C,用于对所述图片抽帧检测模块输出的所述目标图片进行解码还原,并将所述解码目标图片反馈给底层接口。The picture decoding module 708C is configured to decode and restore the target picture output by the picture frame detection module, and feed back the decoded target picture to the underlying interface.
如图8所示为另外一种实施例中提出的一种活体视频图片处理装置,该装置可以集成于上述的计算机设备110中,为在上述活体视频图片处理装置基础上的进一步优化技术方案,具体可以包括接收单元802、原始活体视频数据包计算单元804、图片抽帧单元806、图片角度处理单元808以及图片解码单元810。FIG. 8 shows a live video image processing device proposed in another embodiment, which can be integrated into the above-mentioned computer equipment 110, and is a further optimized technical solution based on the above live video image processing device. Specifically, it may include a receiving unit 802, an original live video data packet calculation unit 804, a picture frame extraction unit 806, a picture angle processing unit 808, and a picture decoding unit 810.
接收单元802,用于接收活体视频的检测请求并将所述活体视频保存到内存;The receiving unit 802 is configured to receive the detection request of the live video and save the live video to the memory;
原始活体视频数据包计算单元804,用于计算出原始活体视频数据包中的图片数量;The original live video data packet calculation unit 804 is configured to calculate the number of pictures in the original live video data packet;
图片抽帧单元806,用于根据所述原始活体视频数据包计算单元计算出来的图片数量,对所述原始活体视频数据包中的图片进行抽帧,以获取目标图片;The picture frame extraction unit 806 is configured to extract frames from the pictures in the original live video data packet according to the number of pictures calculated by the original live video data packet calculation unit to obtain a target picture;
图片角度处理单元808,用于获取所述图片解码单元输出的所述解码目标图片的图片角度信息,并根据所述图片角度信息进行图片旋转操作将所述解码目标图片调整为正常角度的图片;The picture angle processing unit 808 is configured to obtain picture angle information of the decoded target picture output by the picture decoding unit, and perform a picture rotation operation according to the picture angle information to adjust the decoded target picture to a picture with a normal angle;
图片解码单元810,用于将所述图片抽帧单元抽取的目标图片进行解码还原,以得到解码目标图片,并将所述解码目标图片反馈给底层接口。The picture decoding unit 810 is configured to decode and restore the target picture extracted by the picture frame extraction unit to obtain the decoded target picture, and feed back the decoded target picture to the underlying interface.
在图8所示的活体视频图片处理装置实施例中,所述图片抽帧单元806与上述活体视频图片处理装置相同,同样包括图片数量编号模块和图片抽帧处理模块,由于与图9所示的图片抽帧单元706相同,未画图示意,可参考图9。In the embodiment of the living video picture processing device shown in FIG. 8, the picture frame extraction unit 806 is the same as the above-mentioned living video picture processing device, and also includes a picture number numbering module and a picture frame extraction processing module. The picture frame extraction unit 706 of is the same, and it is not shown in the figure. Please refer to FIG. 9.
其中,图片数量编号模块,用于获取到的所述原始活体视频数据包中的图片数量,并所述原始活体视频数据包中的图片进行编号;Wherein, the picture quantity numbering module is used to obtain the number of pictures in the original live video data packet, and number the pictures in the original live video data packet;
图片抽帧处理模块,用于删除所述图片数量编号模块进行编号的所述原始活体视频数据包中图片编号在首尾的预设数量图片,并对剩余图片进行等距离抽取图片,以获得目标图片。A picture frame extraction processing module for deleting a preset number of pictures with picture numbers at the beginning and end of the original live video data packet numbered by the picture number numbering module, and extracting pictures at equal distances from the remaining pictures to obtain a target picture .
同理,所述图片解码单元810与上述活体视频图片处理装置相同,同样还包括参考帧获取模块、图片抽帧检测模块和图片解码模块,由于与图10所示的图片解码单元708相同,未画图示意,可参考图10。In the same way, the picture decoding unit 810 is the same as the above-mentioned living video picture processing device, and also includes a reference frame acquisition module, a picture frame detection module, and a picture decoding module. Since it is the same as the picture decoding unit 708 shown in FIG. For drawing schematic, please refer to Figure 10.
其中,参考帧获取模块,用于获取所述原始活体视频数据包中的关键帧I帧和非关键帧P帧;Wherein, the reference frame obtaining module is used to obtain the key frame I frame and the non-key frame P frame in the original live video data packet;
图片抽帧检测模块,用于根据所述参考帧获取模块获取的关键帧I帧和非关键帧P帧的信息,对所述目标图片进行抽帧检测;The picture frame extraction detection module is configured to perform frame extraction detection on the target picture according to the information of the key frame I frame and the non-key frame P frame acquired by the reference frame acquisition module;
图片解码模块,用于对所述图片抽帧检测模块输出的所述目标图片进行解码还原,并将所述解码目标图片反馈给底层接口。The picture decoding module is configured to decode and restore the target picture output by the picture frame detection module, and feed back the decoded target picture to the bottom layer interface.
在一个实施例中,提出了一种计算机设备,所述计算机设备包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现以下步骤:接收活体视频的检测请求并保存所述活体视频到内存;获取原始活体视频数据包,并计算出所述原始活体视频数据包中的图片数量;根据所述原始活体视频数据包中的图片数量对所述原始活体视频数据包中的图片进行抽帧,以获得目标图片;对所述目标图片进行解码得到解码目标图片;将所述解码目标图片反馈给底层接口。In one embodiment, a computer device is proposed. The computer device includes a memory, a processor, and a computer program that is stored on the memory and can run on the processor, and the processor executes the computer The program implements the following steps: receiving a live video detection request and saving the live video to the memory; obtaining an original live video data packet, and calculating the number of pictures in the original live video data packet; according to the original live video data The number of pictures in the packet extracts frames from the pictures in the original live video data packet to obtain a target picture; decodes the target picture to obtain a decoded target picture; and feeds back the decoded target picture to an underlying interface.
在一个实施例中,处理器执行计算机可读指令时还执行以下步骤:所述根据所述原始活体视频数据包中的图片数量对所述原始活体视频数据包中的图片进行抽帧,以获得目标图片的步骤包括:In one embodiment, when the processor executes the computer-readable instructions, the following steps are also performed: said extracting frames from the pictures in the original live video data packet according to the number of pictures in the original live video data packet to obtain The steps for the target image include:
获取所述原始活体视频数据包中的图片数量并编号;Acquiring and numbering the number of pictures in the original live video data packet;
删除编号在首尾的预设数量图片;Delete the preset number of pictures numbered at the beginning and end;
对删除首尾的预设数量图片的剩余图片进行等距离抽取图片,以获得目标图片。Perform equidistant extraction of the remaining pictures from the preset number of pictures deleted at the beginning and end to obtain the target picture.
在一个实施例中,所述对所述目标图片进行解码得到解码目标图片的步骤包括:In an embodiment, the step of decoding the target picture to obtain a decoded target picture includes:
获取所述原始活体视频数据包中的关键帧I帧和非关键帧P帧;Acquiring a key frame I frame and a non-key frame P frame in the original live video data packet;
根据所述关键帧I帧和非关键帧P帧的信息对所述目标图片进行抽帧检测,确保所述目标图片包含了所述原始活体视频中的完整图片信息;Performing frame extraction detection on the target picture according to the information of the key frame I frame and the non-key frame P frame to ensure that the target picture contains complete picture information in the original live video;
对抽帧检测后的所述目标图片进行解码,以得到解码目标图片。Decoding the target picture after frame decimation detection to obtain a decoded target picture.
在另一个实施例中,还提出了一种计算机设备,所述计算机设备包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现以下步骤:接收活体视频的检测请求并保存所述活体视频到内存;获取原始活体视频数据包,并计算出所述原始活体视频数据包中的图片数量;根据所述原始活体视频数据包中的图片数量对所述原始活体视频数据包中的图片进行抽帧,以获得目标图片;对所述目标图片进行解码得到解码目标图片;获取所述解码目标图片的图片角度信息,根据所述图片角度信息进行图片旋转操作将所述解码目标图片调整为正常角度的图片;将所述解码目标图片反馈给底层接口。In another embodiment, a computer device is also provided. The computer device includes a memory, a processor, and a computer program that is stored on the memory and can run on the processor, and the processor executes all The computer program implements the following steps: receiving a live video detection request and saving the live video to the memory; acquiring an original live video data packet, and calculating the number of pictures in the original live video data packet; according to the original live video The number of pictures in the video data packet extracts frames from the pictures in the original live video data packet to obtain a target picture; decodes the target picture to obtain a decoded target picture; obtains picture angle information of the decoded target picture, Perform a picture rotation operation according to the picture angle information to adjust the decoded target picture to a picture with a normal angle; and feed back the decoded target picture to an underlying interface.
在一个实施例中,处理器执行计算机可读指令时还执行以下步骤:所述根据所述原始活体视频数据包中的图片数量对所述原始活体视频数据包中的图片进行抽帧,以获得目标图片的步骤包括:In one embodiment, when the processor executes the computer-readable instructions, the following steps are also performed: said extracting frames from the pictures in the original live video data packet according to the number of pictures in the original live video data packet to obtain The steps for the target image include:
获取所述原始活体视频数据包中的图片数量并编号;Acquiring and numbering the number of pictures in the original live video data packet;
删除编号在首尾的预设数量图片;Delete the preset number of pictures numbered at the beginning and end;
对删除首尾的预设数量图片的剩余图片进行等距离抽取图片,以获得目标图片。Perform equidistant extraction of the remaining pictures from the preset number of pictures deleted at the beginning and end to obtain the target picture.
在一个实施例中,所述对所述目标图片进行解码得到解码目标图片的步骤包括:In an embodiment, the step of decoding the target picture to obtain a decoded target picture includes:
获取所述原始活体视频数据包中的关键帧I帧和非关键帧P帧;Acquiring a key frame I frame and a non-key frame P frame in the original live video data packet;
根据所述关键帧I帧和非关键帧P帧的信息对所述目标图片进行抽帧检测,确保所述目标图片包含了所述原始活体视频中的完整图片信息;Performing frame extraction detection on the target picture according to the information of the key frame I frame and the non-key frame P frame to ensure that the target picture contains complete picture information in the original live video;
对抽帧检测后的所述目标图片进行解码,以得到解码目标图片。Decoding the target picture after frame decimation detection to obtain a decoded target picture.
在一个实施例中,提出了一种存储有计算机可读指令的存储介质,该计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤:接收活体视频的检测请求并保存所述活体视频到内存;获取原始活体视频数据包,并计算出所述原始活体视频数据包中的图片数量;根据所述原始活体视频数据包中的图片数量对所述原始活体视频数据包中的图片进行抽帧,以获得目标图片;对所述目标图片进行解码得到解码目标图片;将所述解码目标图片反馈给底层接口。In one embodiment, a storage medium storing computer-readable instructions is provided. When the computer-readable instructions are executed by one or more processors, the one or more processors perform the following steps: Detect the request and save the live video to the memory; obtain the original live video data packet, and calculate the number of pictures in the original live video data packet; compare the original live video data packet according to the number of pictures in the original live video data packet The picture in the video data packet is framed to obtain a target picture; the target picture is decoded to obtain a decoded target picture; the decoded target picture is fed back to the bottom layer interface.
在一个实施例中,处理器执行计算机可读指令时还执行以下步骤:所述根据所述原始活体视频数据包中的图片数量对所述原始活体视频数据包中的图片进行抽帧,以获得目标图片的步骤包括:In one embodiment, when the processor executes the computer-readable instructions, the following steps are also performed: said extracting frames from the pictures in the original live video data packet according to the number of pictures in the original live video data packet to obtain The steps for the target image include:
获取所述原始活体视频数据包中的图片数量并编号;Acquiring and numbering the number of pictures in the original live video data packet;
删除编号在首尾的预设数量图片;Delete the preset number of pictures numbered at the beginning and end;
对删除首尾的预设数量图片的剩余图片进行等距离抽取图片,以获得目标图片。Perform equidistant extraction of the remaining pictures from the preset number of pictures deleted at the beginning and end to obtain the target picture.
在一个实施例中,所述对所述目标图片进行解码得到解码目标图片的步骤包括:In an embodiment, the step of decoding the target picture to obtain a decoded target picture includes:
获取所述原始活体视频数据包中的关键帧I帧和非关键帧P帧;Acquiring a key frame I frame and a non-key frame P frame in the original live video data packet;
根据所述关键帧I帧和非关键帧P帧的信息对所述目标图片进行抽帧检测,确保所述目标图片包含了所述原始活体视频中的完整图片信息;Performing frame extraction detection on the target picture according to the information of the key frame I frame and the non-key frame P frame to ensure that the target picture contains complete picture information in the original live video;
对抽帧检测后的所述目标图片进行解码,以得到解码目标图片。Decoding the target picture after frame decimation detection to obtain a decoded target picture.
在另一个实施例中,还提出了一种存储有计算机可读指令的存储介质,该计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤:接收活体视频的检测请求并保存所述活体视频到内存;获取原始活体视频数据包,并计算出所述原始活体视频数据包中的图片数量;根据所述原始活体视频数据包中的图片数量对所述原始活体视频数据包中的图片进行抽帧,以获得目标图片;对所述目标图片进行解码得到解码目标图片;获取所述解码目标图片的图片角度信息,根据所述图片角度信息进行图片旋转操作将所述解码目标图片调整为正常角度的图片;将所述解码目标图片反馈给底层接口。In another embodiment, a storage medium storing computer-readable instructions is also provided. When the computer-readable instructions are executed by one or more processors, the one or more processors perform the following steps: Video detection request and save the live video to the memory; obtain the original live video data packet, and calculate the number of pictures in the original live video data packet; compare the number of pictures in the original live video data packet The picture in the original live video data packet is framed to obtain the target picture; the target picture is decoded to obtain the decoded target picture; the picture angle information of the decoded target picture is obtained, and the picture rotation operation is performed according to the picture angle information Adjusting the decoded target picture to a picture with a normal angle; feeding back the decoded target picture to the bottom layer interface.
在一个实施例中,处理器执行计算机可读指令时还执行以下步骤:所述根据所述原始活体视频数据包中的图片数量对所述原始活体视频数据包中的图片进行抽帧,以获得目标图片的步骤包括:In one embodiment, when the processor executes the computer-readable instructions, the following steps are also performed: said extracting frames from the pictures in the original live video data packet according to the number of pictures in the original live video data packet to obtain The steps for the target image include:
获取所述原始活体视频数据包中的图片数量并编号;Acquiring and numbering the number of pictures in the original live video data packet;
删除编号在首尾的预设数量图片;Delete the preset number of pictures numbered at the beginning and end;
对删除首尾的预设数量图片的剩余图片进行等距离抽取图片,以获得目标图片。Perform equidistant extraction of the remaining pictures from the preset number of pictures deleted at the beginning and end to obtain the target picture.
在一个实施例中,所述对所述目标图片进行解码得到解码目标图片的步骤包括:In an embodiment, the step of decoding the target picture to obtain a decoded target picture includes:
获取所述原始活体视频数据包中的关键帧I帧和非关键帧P帧;Acquiring a key frame I frame and a non-key frame P frame in the original live video data packet;
根据所述关键帧I帧和非关键帧P帧的信息对所述目标图片进行抽帧检测,确保所述目标图片包含了所述原始活体视频中的完整图片信息;Performing frame extraction detection on the target picture according to the information of the key frame I frame and the non-key frame P frame to ensure that the target picture contains complete picture information in the original live video;
对抽帧检测后的所述目标图片进行解码,以得到解码目标图片。Decoding the target picture after frame decimation detection to obtain a decoded target picture.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,该计算机程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述计算机可读存储介质可以是非易失性,也可以是易失性。前述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)等非易失性存储介质,或随机存储记忆体(Random Access Memory,RAM)等。A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing relevant hardware through a computer program. The computer program can be stored in a computer readable storage medium. When executed, it may include the procedures of the above-mentioned method embodiments. Wherein, the computer-readable storage medium may be non-volatile or volatile. The aforementioned storage media can be magnetic disks, optical disks, read-only storage memory (Read-Only Memory, ROM) and other non-volatile storage media, or random storage memory (Random Access Memory, RAM) etc.
以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above-mentioned embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the various technical features in the above-mentioned embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, All should be considered as the scope of this specification.
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only express several implementation manners of the present application, and their description is relatively specific and detailed, but they should not be understood as a limitation to the patent scope of the present application. It should be pointed out that for those of ordinary skill in the art, without departing from the concept of this application, several modifications and improvements can be made, and these all fall within the protection scope of this application. Therefore, the scope of protection of the patent of this application shall be subject to the appended claims.
工业实用性Industrial applicability
在此处键入工业实用性描述段落。Type a paragraph describing industrial applicability here.
序列表自由内容Sequence Listing Free Content
在此处键入序列表自由内容描述段落。Type here the free content description paragraph of the sequence listing.

Claims (20)

  1. 一种活体视频图片处理方法,其中,所述方法包括:A method for processing live video pictures, wherein the method includes:
    接收活体视频的检测请求并保存所述活体视频到内存;Receiving the detection request of the live video and saving the live video to the memory;
    获取原始活体视频数据包,并计算出所述原始活体视频数据包中的图片数量;Acquiring an original live video data packet, and calculating the number of pictures in the original live video data packet;
    根据所述原始活体视频数据包中的图片数量对所述原始活体视频数据包中的图片进行抽帧,以获得目标图片;Extracting frames from pictures in the original live video data packet according to the number of pictures in the original live video data packet to obtain a target picture;
    对所述目标图片进行解码得到解码目标图片;Decode the target picture to obtain a decoded target picture;
    将所述解码目标图片反馈给底层接口。Feed back the decoded target picture to the bottom layer interface.
  2. 如权利要求1所述的活体视频图片处理方法,其中,所述对所述目标图片进行解码得到解码目标图片的步骤之后还包括:3. The living video picture processing method of claim 1, wherein after the step of decoding the target picture to obtain a decoded target picture, the method further comprises:
    获取所述解码目标图片的图片角度信息,根据所述图片角度信息进行图片旋转操作将所述解码目标图片调整为正常角度的图片。Acquire the picture angle information of the decoding target picture, and perform a picture rotation operation according to the picture angle information to adjust the decoding target picture to a picture with a normal angle.
  3. 如权利要求1所述的活体视频图片处理方法,其中,所述根据所述原始活体视频数据包中的图片数量对所述原始活体视频数据包中的图片进行抽帧,以获得目标图片的步骤包括:3. The live video picture processing method of claim 1, wherein the step of extracting frames from the pictures in the original live video data packet according to the number of pictures in the original live video data packet to obtain a target picture include:
    获取所述原始活体视频数据包中的图片数量并编号;Acquiring and numbering the number of pictures in the original live video data packet;
    删除编号在首尾的预设数量图片;Delete the preset number of pictures numbered at the beginning and end;
    对删除首尾的预设数量图片的剩余图片进行等距离抽取图片,以获得目标图片。Perform equidistant extraction of the remaining pictures from the preset number of pictures deleted at the beginning and end to obtain the target picture.
  4. 如权利要求1所述的活体视频图片处理方法,其中,所述对所述目标图片进行解码得到解码目标图片的步骤包括:3. The living video picture processing method of claim 1, wherein the step of decoding the target picture to obtain a decoding target picture comprises:
    获取所述原始活体视频数据包中的关键帧I帧和非关键帧P帧;Acquiring a key frame I frame and a non-key frame P frame in the original live video data packet;
    根据所述关键帧I帧和非关键帧P帧的信息对所述目标图片进行抽帧检测,确保所述目标图片包含了所述原始活体视频中的完整图片信息;Performing frame extraction detection on the target picture according to the information of the key frame I frame and the non-key frame P frame to ensure that the target picture contains complete picture information in the original live video;
    对抽帧检测后的所述目标图片进行解码,以得到解码目标图片。Decoding the target picture after frame decimation detection to obtain a decoded target picture.
  5. 如权利要求1所述的活体视频图片处理方法,其中,所述的对抽帧检测后的所述目标图片进行解码,以得到解码目标图片的步骤包括:3. The living video picture processing method of claim 1, wherein the step of decoding the target picture after frame extraction detection to obtain a decoded target picture comprises:
    根据原始活体视频数据包的视频压缩方法对所述目标图片进行解码,得到解码目标图片。The target picture is decoded according to the video compression method of the original live video data packet to obtain the decoded target picture.
  6. 如权利要求2所述的活体视频图片处理方法,其中,所述根据所述图片角度信息进行图片旋转操作将所述解码目标图片调整为正常角度的图片的步骤包括:3. The live video picture processing method of claim 2, wherein the step of performing a picture rotation operation according to the picture angle information to adjust the decoding target picture to a picture with a normal angle comprises:
    采取矩阵逆置或镜像处理,将所述解码目标图片调整为正常角度的图片。Adopt matrix inversion or mirror image processing to adjust the decoding target picture to a picture with a normal angle.
  7. 如权利要求1所述的活体视频图片处理方法,其中,所述获取原始活体视频数据包的步骤之前包括:8. The method for processing live video pictures according to claim 1, wherein the step of obtaining the original live video data packet comprises:
    根据视频码率确定视频数据的检测数量。Determine the detection quantity of video data according to the video bit rate.
  8. 一种活体视频图片处理装置,其中,所述活体视频图片处理装置包括:A living body video picture processing device, wherein the living body video picture processing device includes:
    接收单元,用于接收活体视频的检测请求并将所述活体视频保存到内存;The receiving unit is configured to receive the detection request of the live video and save the live video to the memory;
    原始活体视频数据包计算单元,用于计算出原始活体视频数据包中的图片数量;The original live video data packet calculation unit is used to calculate the number of pictures in the original live video data packet;
    图片抽帧单元,用于根据所述原始活体视频数据包计算单元计算出来的图片数量,对所述原始活体视频数据包中的图片进行抽帧,以获取目标图片;The picture frame extraction unit is configured to extract frames from the pictures in the original live video data packet according to the number of pictures calculated by the original live video data packet calculation unit to obtain a target picture;
    图片解码单元,用于将所述图片抽帧单元抽取的目标图片进行解码还原,以得到解码目标图片,并将所述解码目标图片反馈给底层接口。The picture decoding unit is configured to decode and restore the target picture extracted by the picture frame extraction unit to obtain the decoded target picture, and feed back the decoded target picture to the underlying interface.
  9. 一种计算机设备,包括存储器和处理器,所述存储器中存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行如下步骤:A computer device includes a memory and a processor. The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor executes the following steps:
    接收活体视频的检测请求并保存所述活体视频到内存;Receiving the detection request of the live video and saving the live video to the memory;
    获取原始活体视频数据包,并计算出所述原始活体视频数据包中的图片数量;Acquiring an original live video data packet, and calculating the number of pictures in the original live video data packet;
    根据所述原始活体视频数据包中的图片数量对所述原始活体视频数据包中的图片进行抽帧,以获得目标图片;Extracting frames from pictures in the original live video data packet according to the number of pictures in the original live video data packet to obtain a target picture;
    对所述目标图片进行解码得到解码目标图片;Decode the target picture to obtain a decoded target picture;
    将所述解码目标图片反馈给底层接口。Feed back the decoded target picture to the bottom layer interface.
  10. 根据权利要求9所述的电子设备,其中,所述对所述目标图片进行解码得到解码目标图片的步骤之后还包括:The electronic device according to claim 9, wherein after the step of decoding the target picture to obtain a decoded target picture, the method further comprises:
    获取所述解码目标图片的图片角度信息,根据所述图片角度信息进行图片旋转操作将所述解码目标图片调整为正常角度的图片。Acquire the picture angle information of the decoding target picture, and perform a picture rotation operation according to the picture angle information to adjust the decoding target picture to a picture with a normal angle.
  11. 根据权利要求9所述的电子设备,其中,所述根据所述原始活体视频数据包中的图片数量对所述原始活体视频数据包中的图片进行抽帧,以获得目标图片的步骤包括:9. The electronic device according to claim 9, wherein the step of extracting frames from pictures in the original live video data packet according to the number of pictures in the original live video data packet to obtain a target picture comprises:
    获取所述原始活体视频数据包中的图片数量并编号;Acquiring and numbering the number of pictures in the original live video data packet;
    删除编号在首尾的预设数量图片;Delete the preset number of pictures numbered at the beginning and end;
    对删除首尾的预设数量图片的剩余图片进行等距离抽取图片,以获得目标图片。Perform equidistant extraction of the remaining pictures from the preset number of pictures deleted at the beginning and end to obtain the target picture.
  12. 根据权利要求9所述的电子设备,其中,所述对所述目标图片进行解码得到解码目标图片的步骤包括:The electronic device according to claim 9, wherein the step of decoding the target picture to obtain a decoded target picture comprises:
    获取所述原始活体视频数据包中的关键帧I帧和非关键帧P帧;Acquiring a key frame I frame and a non-key frame P frame in the original live video data packet;
    根据所述关键帧I帧和非关键帧P帧的信息对所述目标图片进行抽帧检测,确保所述目标图片包含了所述原始活体视频中的完整图片信息;Performing frame extraction detection on the target picture according to the information of the key frame I frame and the non-key frame P frame to ensure that the target picture contains complete picture information in the original live video;
    对抽帧检测后的所述目标图片进行解码,以得到解码目标图片。Decoding the target picture after frame decimation detection to obtain a decoded target picture.
  13. 根据权利要求9所述的电子设备,其中,所述的对抽帧检测后的所述目标图片进行解码,以得到解码目标图片的步骤包括:9. The electronic device according to claim 9, wherein the step of decoding the target picture after frame extraction detection to obtain a decoded target picture comprises:
    根据原始活体视频数据包的视频压缩方法对所述目标图片进行解码,得到解码目标图片。The target picture is decoded according to the video compression method of the original live video data packet to obtain the decoded target picture.
  14. 根据权利要求10所述的电子设备,其中,所述根据所述图片角度信息进行图片旋转操作将所述解码目标图片调整为正常角度的图片的步骤包括:The electronic device according to claim 10, wherein the step of performing a picture rotation operation according to the picture angle information to adjust the decoding target picture to a picture with a normal angle comprises:
    采取矩阵逆置或镜像处理,将所述解码目标图片调整为正常角度的图片。Adopt matrix inversion or mirror image processing to adjust the decoding target picture to a picture with a normal angle.
  15. 根据权利要求9所述的电子设备,其中,所述获取原始活体视频数据包的步骤之前包括:根据视频码率确定视频数据的检测数量。9. The electronic device according to claim 9, wherein before the step of obtaining the original live video data packet comprises: determining the detection quantity of the video data according to the video bit rate.
  16. 一种存储有计算机可读指令的存储介质,所述计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行如下步骤:A storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the following steps:
    接收活体视频的检测请求并保存所述活体视频到内存;Receiving the detection request of the live video and saving the live video to the memory;
    获取原始活体视频数据包,并计算出所述原始活体视频数据包中的图片数量;Acquiring an original live video data packet, and calculating the number of pictures in the original live video data packet;
    根据所述原始活体视频数据包中的图片数量对所述原始活体视频数据包中的图片进行抽帧,以获得目标图片;Extracting frames from pictures in the original live video data packet according to the number of pictures in the original live video data packet to obtain a target picture;
    对所述目标图片进行解码得到解码目标图片;Decode the target picture to obtain a decoded target picture;
    将所述解码目标图片反馈给底层接口。Feed back the decoded target picture to the bottom layer interface.
  17. 根据权利要求16所述的计算机可读存储介质,其中,所述对所述目标图片进行解码得到解码目标图片的步骤之后还包括:The computer-readable storage medium according to claim 16, wherein after the step of decoding the target picture to obtain a decoded target picture, the method further comprises:
    获取所述解码目标图片的图片角度信息,根据所述图片角度信息进行图片旋转操作将所述解码目标图片调整为正常角度的图片。Acquire the picture angle information of the decoding target picture, and perform a picture rotation operation according to the picture angle information to adjust the decoding target picture to a picture with a normal angle.
  18. 根据权利要求16所述的计算机可读存储介质,其中,所述根据所述原始活体视频数据包中的图片数量对所述原始活体视频数据包中的图片进行抽帧,以获得目标图片的步骤包括:16. The computer-readable storage medium according to claim 16, wherein the step of extracting frames from pictures in the original live video data packet according to the number of pictures in the original live video data packet to obtain a target picture include:
    获取所述原始活体视频数据包中的图片数量并编号;Acquiring and numbering the number of pictures in the original live video data packet;
    删除编号在首尾的预设数量图片;Delete the preset number of pictures numbered at the beginning and end;
    对删除首尾的预设数量图片的剩余图片进行等距离抽取图片,以获得目标图片。Perform equidistant extraction of the remaining pictures from the preset number of pictures deleted at the beginning and end to obtain the target picture.
  19. 根据权利要求16所述的计算机可读存储介质,其中,所述对所述目标图片进行解码得到解码目标图片的步骤包括:The computer-readable storage medium according to claim 16, wherein the step of decoding the target picture to obtain a decoded target picture comprises:
    获取所述原始活体视频数据包中的关键帧I帧和非关键帧P帧;Acquiring a key frame I frame and a non-key frame P frame in the original live video data packet;
    根据所述关键帧I帧和非关键帧P帧的信息对所述目标图片进行抽帧检测,确保所述目标图片包含了所述原始活体视频中的完整图片信息;Performing frame extraction detection on the target picture according to the information of the key frame I frame and the non-key frame P frame to ensure that the target picture contains complete picture information in the original live video;
    对抽帧检测后的所述目标图片进行解码,以得到解码目标图片。Decoding the target picture after frame decimation detection to obtain a decoded target picture.
  20. 根据权利要求16所述的计算机可读存储介质,其中,所述的对抽帧检测后的所述目标图片进行解码,以得到解码目标图片的步骤包括:根据原始活体视频数据包的视频压缩方法对所述目标图片进行解码,得到解码目标图片。16. The computer-readable storage medium according to claim 16, wherein the step of decoding the target picture after frame extraction detection to obtain the decoded target picture comprises: a video compression method based on the original live video data packet The target picture is decoded to obtain the decoded target picture.
PCT/CN2020/136434 2020-02-26 2020-12-15 Living body video picture processing method and apparatus, computer device, and storage medium WO2021169501A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010119603.9 2020-02-26
CN202010119603.9A CN111428568B (en) 2020-02-26 2020-02-26 Living-body video picture processing method, living-body video picture processing device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2021169501A1 true WO2021169501A1 (en) 2021-09-02

Family

ID=71551594

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/136434 WO2021169501A1 (en) 2020-02-26 2020-12-15 Living body video picture processing method and apparatus, computer device, and storage medium

Country Status (2)

Country Link
CN (1) CN111428568B (en)
WO (1) WO2021169501A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114394100A (en) * 2022-01-12 2022-04-26 深圳力维智联技术有限公司 Unmanned prowl car control system and unmanned car

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111428568B (en) * 2020-02-26 2024-04-09 平安科技(深圳)有限公司 Living-body video picture processing method, living-body video picture processing device, computer equipment and storage medium
CN112866799B (en) * 2020-12-31 2023-08-11 百果园技术(新加坡)有限公司 Video frame extraction processing method, device, equipment and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106791480A (en) * 2016-11-30 2017-05-31 努比亚技术有限公司 A kind of terminal and video skimming creation method
CN108024159A (en) * 2017-12-07 2018-05-11 上海网达软件股份有限公司 A kind of generation method and system of video file thumbnail
CN108377399A (en) * 2018-03-07 2018-08-07 广州图普网络科技有限公司 Live video stream code-transferring method, device and computer readable storage medium
CN110472487A (en) * 2019-07-03 2019-11-19 平安科技(深圳)有限公司 Living body user detection method, device, computer equipment and storage medium
CN111428568A (en) * 2020-02-26 2020-07-17 平安科技(深圳)有限公司 Living body video picture processing method and device, computer equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10142707B2 (en) * 2016-02-25 2018-11-27 Cyberlink Corp. Systems and methods for video streaming based on conversion of a target key frame

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106791480A (en) * 2016-11-30 2017-05-31 努比亚技术有限公司 A kind of terminal and video skimming creation method
CN108024159A (en) * 2017-12-07 2018-05-11 上海网达软件股份有限公司 A kind of generation method and system of video file thumbnail
CN108377399A (en) * 2018-03-07 2018-08-07 广州图普网络科技有限公司 Live video stream code-transferring method, device and computer readable storage medium
CN110472487A (en) * 2019-07-03 2019-11-19 平安科技(深圳)有限公司 Living body user detection method, device, computer equipment and storage medium
CN111428568A (en) * 2020-02-26 2020-07-17 平安科技(深圳)有限公司 Living body video picture processing method and device, computer equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114394100A (en) * 2022-01-12 2022-04-26 深圳力维智联技术有限公司 Unmanned prowl car control system and unmanned car
CN114394100B (en) * 2022-01-12 2024-04-05 深圳力维智联技术有限公司 Unmanned patrol car control system and unmanned car

Also Published As

Publication number Publication date
CN111428568A (en) 2020-07-17
CN111428568B (en) 2024-04-09

Similar Documents

Publication Publication Date Title
WO2021169501A1 (en) Living body video picture processing method and apparatus, computer device, and storage medium
US8744195B2 (en) Object detection metadata
CN109993150B (en) Method and device for identifying age
WO2022033220A1 (en) Face liveness detection method, system and apparatus, computer device, and storage medium
WO2022193910A1 (en) Data processing method, apparatus and system, and electronic device and readable storage medium
CN105979363A (en) Identity identification method and device
WO2022033219A1 (en) Face liveness detection method, system and apparatus, computer device, and storage medium
WO2023143222A1 (en) Image processing method and apparatus, device, and storage medium
WO2024001000A1 (en) Video playing detection method and system
WO2024032494A1 (en) Image processing method and apparatus, computer, readable storage medium, and program product
US8548275B2 (en) Image processing device and image processing method
WO2021051580A1 (en) Grouping batch-based picture detection method and apparatus, and storage medium
US11755758B1 (en) System and method for evaluating data files
US10282633B2 (en) Cross-asset media analysis and processing
CN110677728B (en) Method, device and equipment for playing video and storage medium
CN115701017A (en) Image processing method and device
WO2018123279A1 (en) Information processing system, information processing device and program
CN116567296B (en) Video picture processing method, device, computer equipment and storage medium
US11457247B1 (en) Edge computing method and apparatus, edge device and storage medium
CN115086730B (en) Subscription video generation method, subscription video generation system, computer equipment and subscription video generation medium
CN115878113A (en) Data processing method, data processing system, terminal and storage medium
CN117082135A (en) Service transmission method, device, computer equipment and storage medium
JPWO2019244663A1 (en) Face recognition system, terminal device, face recognition method, and program
CN115883768A (en) Screen sharing method and device, computer equipment and storage medium
CN116167761A (en) Face payment method, device, computer equipment, storage medium and product

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

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

Country of ref document: EP

Kind code of ref document: A1