[go: up one dir, main page]

CN108198177A - Image acquisition method, device, terminal and storage medium - Google Patents

Image acquisition method, device, terminal and storage medium Download PDF

Info

Publication number
CN108198177A
CN108198177A CN201711484291.6A CN201711484291A CN108198177A CN 108198177 A CN108198177 A CN 108198177A CN 201711484291 A CN201711484291 A CN 201711484291A CN 108198177 A CN108198177 A CN 108198177A
Authority
CN
China
Prior art keywords
image
image frame
video data
frame
target video
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.)
Pending
Application number
CN201711484291.6A
Other languages
Chinese (zh)
Inventor
刘耀勇
陈岩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201711484291.6A priority Critical patent/CN108198177A/en
Publication of CN108198177A publication Critical patent/CN108198177A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/222Studio circuitry; Studio devices; Studio equipment
    • H04N5/262Studio circuits, e.g. for mixing, switching-over, change of character of image, other special effects ; Cameras specially adapted for the electronic generation of special effects
    • H04N5/265Mixing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10016Video; Image sequence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30168Image quality inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30196Human being; Person
    • G06T2207/30201Face

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Quality & Reliability (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)

Abstract

The application discloses an image acquisition method, an image acquisition device, a terminal and a storage medium, and belongs to the field of image processing. The method comprises the following steps: acquiring shot target video data; respectively inputting the image frames of the target video data into a pre-trained image scoring model to obtain a score corresponding to each image frame; and determining a photographed picture according to the first image frame with the highest score in the image frames of the target video data. According to the method and the device, the image frame with the highest score is screened from the target video data, the picture to be shot is determined according to the image frame, and the server can automatically select the image frame with the highest score from the target video data without manual screening by a user, so that the problem that the self-shooting efficiency of the user is low is solved, and the effect of improving the self-shooting efficiency of the user is achieved.

Description

图像获取方法、装置、终端及存储介质Image acquisition method, device, terminal and storage medium

技术领域technical field

本申请实施例涉及图像处理领域,特别涉及一种图像获取方法、装置、终端及存储介质。The embodiments of the present application relate to the field of image processing, and in particular to an image acquisition method, device, terminal, and storage medium.

背景技术Background technique

随着手机、平板电脑等具有摄像头的终端迅速普及,自拍已经成为一件极其生活化的事情。With the rapid popularization of terminals with cameras such as mobile phones and tablet computers, taking selfies has become an extremely daily thing.

在实际场景中,用户的拍照手法不正确,导致自拍的照片效果较差。比如自拍太近显得脸大,自拍角度不对导致给人看起来很脸部肥胖,照片采光过亮或者过暗等等。In the actual scene, the user's camera technique is not correct, resulting in poor self-portrait photos. For example, if you take a selfie too close, your face will look big, if you take a selfie from the wrong angle, it will make your face appear fat, or if the light in the photo is too bright or too dark, etc.

一旦自拍的照片较差,用户则需要重新自拍,这无疑降低了用户的自拍效率。Once the selfie photo is poor, the user needs to take a selfie again, which undoubtedly reduces the user's selfie efficiency.

发明内容Contents of the invention

本申请实施例提供了一种图像获取方法、装置、终端及存储介质,可以用于解决用户的自拍效率低下的问题。所述技术方案如下:Embodiments of the present application provide an image acquisition method, device, terminal, and storage medium, which can be used to solve the problem of low efficiency of a user's selfie. Described technical scheme is as follows:

第一方面,提供了一种图像获取方法,所述方法包括:In a first aspect, an image acquisition method is provided, the method comprising:

获取拍摄的目标视频数据;Obtain the captured target video data;

将所述目标视频数据的图像帧,分别输入预先训练的图像评分模型,得到每个图像帧对应的评分;The image frames of the target video data are respectively input into the pre-trained image scoring model to obtain the corresponding scoring of each image frame;

根据所述目标视频数据的图像帧中评分最高的第一图像帧,确定拍照图片。A photographed picture is determined according to the first image frame with the highest score among the image frames of the target video data.

第二方面,提供了一种图像获取装置,所述装置包括:In a second aspect, an image acquisition device is provided, the device comprising:

第一获取模块,用于获取拍摄的目标视频数据;The first obtaining module is used to obtain the target video data of shooting;

输入模块,用于将所述目标视频数据的图像帧,分别输入预先训练的图像评分模型,得到每个图像帧对应的评分;The input module is used to input the image frames of the target video data into the pre-trained image scoring model respectively to obtain the corresponding scoring of each image frame;

确定模块,用于根据所述目标视频数据的图像帧中评分最高的第一图像帧,确定拍照图片。The determination module is configured to determine the photographed picture according to the first image frame with the highest score among the image frames of the target video data.

第三方面,提供了一种终端,所述终端包括处理器、存储器,所述存储器中存储有至少一条指令,所述指令由所述处理器加载并执行以实现如第一方面所述的图像获取方法。In a third aspect, a terminal is provided, the terminal includes a processor and a memory, at least one instruction is stored in the memory, and the instruction is loaded and executed by the processor to realize the image as described in the first aspect Get method.

第四方面,提供了一种计算机可读存储介质,所述存储介质中存储有至少一条指令,所述指令由处理器加载并执行以实现如第一方面所述的图像获取方法。In a fourth aspect, a computer-readable storage medium is provided, wherein at least one instruction is stored in the storage medium, and the instruction is loaded and executed by a processor to implement the image acquisition method as described in the first aspect.

本申请实施例提供的技术方案带来的有益效果是:The beneficial effects brought by the technical solutions provided by the embodiments of the present application are:

通过从目标视频数据中筛选出评分最高的图像帧,并根据该图像帧确定拍照图片,由于无须用户手动筛选,服务器会自动从目标视频数据中选取出评分最高的图像帧,因此解决了用户的自拍效率低下的问题,达到了提高用户的自拍效率的效果。By filtering out the image frame with the highest score from the target video data, and determining the picture to be taken according to the image frame, the server will automatically select the image frame with the highest score from the target video data without manual filtering by the user, thus solving the problem of the user The problem of low self-timer efficiency has achieved the effect of improving the user's Selfie efficiency.

附图说明Description of drawings

为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings that need to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those skilled in the art, other drawings can also be obtained based on these drawings without creative effort.

图1是本申请一个示例性实施例所提供的服务器100的结构示意图;FIG. 1 is a schematic structural diagram of a server 100 provided by an exemplary embodiment of the present application;

图2A是本申请一个示例性实施例提供的图像获取方法的流程图;FIG. 2A is a flowchart of an image acquisition method provided by an exemplary embodiment of the present application;

图2B是申请一个示例性实施例提供的图像评分模型的训练过程的流程图;Fig. 2B is a flow chart of the training process of the image scoring model provided by an exemplary embodiment of the application;

图3A是本申请另一个示例性实施例提供的图像获取方法的流程图;FIG. 3A is a flowchart of an image acquisition method provided by another exemplary embodiment of the present application;

图3B是本申请一个示例性实施例提供的图像分类模型的训练过程的流程图;Fig. 3B is a flowchart of the training process of the image classification model provided by an exemplary embodiment of the present application;

图4是本申请再一个示例性实施例提供的图像获取方法的流程图;FIG. 4 is a flow chart of an image acquisition method provided in another exemplary embodiment of the present application;

图5是本申请一个示例性实施例提供的图像获取装置的结构示意图。Fig. 5 is a schematic structural diagram of an image acquisition device provided by an exemplary embodiment of the present application.

具体实施方式Detailed ways

为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。In order to make the purpose, technical solution and advantages of the present application clearer, the implementation manners of the present application will be further described in detail below in conjunction with the accompanying drawings.

下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本申请相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本申请的一些方面相一致的装置和方法的例子。When the following description refers to the accompanying drawings, the same numerals in different drawings refer to the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with aspects of the present application as recited in the appended claims.

在本发明的描述中,需要理解的是,术语“第一”、“第二”等仅用于描述目的,而不能理解为指示或暗示相对重要性。在本发明的描述中,需要说明的是,除非另有明确的规定和限定,术语“相连”、“连接”应做广义理解,例如,可以是固定连接,也可以是可拆卸连接,或一体地连接;可以是机械连接,也可以是电连接;可以是直接相连,也可以通过中间媒介间接相连。对于本领域的普通技术人员而言,可以具体情况理解上述术语在本发明中的具体含义。此外,在本发明的描述中,除非另有说明,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。In the description of the present invention, it should be understood that the terms "first", "second" and so on are used for descriptive purposes only, and cannot be interpreted as indicating or implying relative importance. In the description of the present invention, it should be noted that unless otherwise specified and limited, the terms "connected" and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral Ground connection; it can be mechanical connection or electrical connection; it can be direct connection or indirect connection through an intermediary. Those of ordinary skill in the art can understand the specific meanings of the above terms in the present invention in specific situations. In addition, in the description of the present invention, unless otherwise specified, "plurality" means two or more. "And/or" describes the association relationship of associated objects, indicating that there may be three types of relationships, for example, A and/or B may indicate: A exists alone, A and B exist simultaneously, and B exists independently. The character "/" generally indicates that the contextual objects are an "or" relationship.

首先,对本申请涉及到的名词进行介绍。First, the nouns involved in this application are introduced.

图像评分模型:是一种用于根据输入的数据确定图像的质量评分的数学模型。Image scoring model: is a mathematical model used to determine the quality score of an image based on input data.

可选的,图像评价模型包括但不限于:卷积神经网络(Convolutional NeuralNetwork,CNN)模型、深度神经网络(Deep Neural Network,DNN)模型、循环神经网络(Recurrent Neural Networks,RNN)模型、嵌入(embedding)模型、梯度提升决策树(Gradient Boosting Decision Tree,GBDT)模型、逻辑回归(Logistic Regression,LR)模型中的至少一种。Optionally, the image evaluation model includes but is not limited to: convolutional neural network (Convolutional Neural Network, CNN) model, deep neural network (Deep Neural Network, DNN) model, recurrent neural network (Recurrent Neural Networks, RNN) model, embedding ( embedding) model, gradient boosting decision tree (Gradient Boosting Decision Tree, GBDT) model, logistic regression (Logistic Regression, LR) model at least one.

DNN模型是一种深度学习框架。DNN模型包括输入层、至少一层隐层(或称,中间层)和输出层。可选的,输入层、至少一层隐层(或称,中间层)和输出层均包括至少一个神经元,神经元用于对接收到的数据进行处理。可选的,不同层之间的神经元的数量可以相同;或者,也可以不同。The DNN model is a deep learning framework. The DNN model includes an input layer, at least one hidden layer (or middle layer) and an output layer. Optionally, the input layer, at least one hidden layer (or middle layer) and the output layer all include at least one neuron, and the neuron is used to process the received data. Optionally, the number of neurons in different layers may be the same; or may also be different.

RNN模型是一种具有反馈结构的神经网络。在RNN模型中,神经元的输出可以在下一个时间戳直接作用到自身,即,第i层神经元在m时刻的输入,除了(i-1)层神经元在该时刻的输出外,还包括其自身在(m-1)时刻的输出。The RNN model is a neural network with a feedback structure. In the RNN model, the output of a neuron can directly act on itself at the next time stamp, that is, the input of the i-th layer neuron at the m moment, in addition to the output of the (i-1) layer neuron at this moment, also includes Its own output at (m-1) time.

embedding模型是基于实体和关系分布式向量表示,将每个三元组实例中的关系看作从实体头到实体尾的翻译。其中,三元组实例包括主体、关系、客体,三元组实例可以表示成(主体,关系,客体);主体为实体头,客体为实体尾。比如:小张的爸爸是大张,则通过三元组实例表示为(小张,爸爸,大张)。The embedding model is based on a distributed vector representation of entities and relationships, and regards the relationship in each triplet instance as a translation from the entity head to the entity tail. Wherein, the triplet instance includes subject, relation, and object, and the triplet instance can be expressed as (subject, relation, object); the subject is the entity head, and the object is the entity tail. For example: Xiao Zhang's father is Da Zhang, then it is expressed as (Xiao Zhang, father, Da Zhang) through a triplet instance.

GBDT模型是一种迭代的决策树算法,该算法由多棵决策树组成,所有树的结果累加起来作为最终结果。决策树的每个节点都会得到一个预测值,以年龄为例,预测值为属于年龄对应的节点的所有人年龄的平均值。The GBDT model is an iterative decision tree algorithm, which consists of multiple decision trees, and the results of all trees are added up as the final result. Each node of the decision tree will get a predicted value. Taking age as an example, the predicted value is the average age of all people belonging to the node corresponding to the age.

LR模型是指在线性回归的基础上,套用一个逻辑函数建立的模型。The LR model refers to a model established by applying a logistic function on the basis of linear regression.

在实际场景中,用户的拍照手法不正确,导致自拍的照片效果较差。一旦自拍的照片较差,用户则需要重新自拍,这无疑降低了用户的自拍效率。为此,本申请提供了一种图像获取方法、装置、终端及存储介质,以解决上述相关技术中存在的问题。本申请提供的技术方案中,通过从目标视频数据中筛选出评分最高的图像帧,并根据该图像帧确定拍照图片,由于无须用户手动筛选,服务器会自动从目标视频数据中选取出评分最高的图像帧,因此提高了用户的自拍效率,下面采用示意性的实施例进行说明。In the actual scene, the user's camera technique is not correct, resulting in poor self-portrait photos. Once the selfie photo is poor, the user needs to take a selfie again, which undoubtedly reduces the user's selfie efficiency. To this end, the present application provides an image acquisition method, device, terminal and storage medium to solve the problems existing in the above-mentioned related technologies. In the technical solution provided by this application, by selecting the image frame with the highest score from the target video data, and determining the photographed picture according to the image frame, since the user does not need to manually filter, the server will automatically select the highest score from the target video data image frame, thus improving the Selfie efficiency of the user, which will be described below using a schematic embodiment.

在对本申请实施例进行解释说明之前,先对本申请实施例的应用场景进行说明。图1示出了本申请一个示例性实施例所提供的服务器100的结构示意图。Before explaining the embodiment of the present application, the application scenario of the embodiment of the present application will be described first. Fig. 1 shows a schematic structural diagram of a server 100 provided by an exemplary embodiment of the present application.

服务器100中存储有图像评分模型。可选的,该图像评分模型是采用样本图像对CNN进行训练得到的模型。An image scoring model is stored in the server 100 . Optionally, the image scoring model is a model obtained by using sample images to train CNN.

可选的,该服务器100包括一个或多个如下部件:处理器110和存储器120。Optionally, the server 100 includes one or more of the following components: a processor 110 and a memory 120 .

处理器110可以包括一个或者多个处理核心。处理器110利用各种接口和线路连接整个电梯调度设备内的各个部分,通过运行或执行存储在存储器120内的指令、程序、代码集或指令集,以及调用存储在存储器120内的数据,执行电梯调度设备的各种功能和处理数据。可选的,处理器110可以采用数字信号处理(Digital Signal Processing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(ProgrammableLogic Array,PLA)中的至少一种硬件形式来实现。处理器110可集成中央处理器(CentralProcessing Unit,CPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统和应用程序等;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器110中,单独通过一块芯片进行实现。Processor 110 may include one or more processing cores. The processor 110 uses various interfaces and lines to connect various parts of the entire elevator dispatching equipment, and executes or executes instructions, programs, code sets or instruction sets stored in the memory 120, and calls data stored in the memory 120 to execute Various functions and processing data of elevator dispatching equipment. Optionally, the processor 110 may use at least one of Digital Signal Processing (Digital Signal Processing, DSP), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), and Programmable Logic Array (ProgrammableLogic Array, PLA). implemented in the form of hardware. The processor 110 may integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a modem, and the like. Among them, the CPU mainly deals with the operating system and application programs, etc.; the modem is used to deal with wireless communication. It can be understood that, the above-mentioned modem may not be integrated into the processor 110, but implemented by a single chip.

可选的,处理器110执行存储器120中的程序指令时实现下面各个方法实施例提供的图像获取方法。Optionally, when the processor 110 executes the program instructions in the memory 120, the image acquisition methods provided in the following method embodiments are implemented.

存储器120可以包括随机存储器(Random Access Memory,RAM),也可以包括只读存储器(Read-Only Memory)。可选的,该存储器120包括非瞬时性计算机可读介质(non-transitory computer-readable storage medium)。存储器120可用于存储指令、程序、代码、代码集或指令集。存储器120可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于至少一个功能的指令、用于实现下面各个方法实施例的指令等;存储数据区可存储下面各个方法实施例中涉及到的数据等。The memory 120 may include a random access memory (Random Access Memory, RAM), and may also include a read-only memory (Read-Only Memory). Optionally, the storage 120 includes a non-transitory computer-readable storage medium (non-transitory computer-readable storage medium). The memory 120 may be used to store instructions, programs, codes, sets of codes, or sets of instructions. The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function, instructions for realizing the following various method embodiments, etc.; the storage data area Data and the like involved in the following method embodiments may be stored.

请参考图2A,其示出了本申请一个示例性实施例提供的图像获取方法的流程图。本实施例以该图像获取方法应用于图1所示出的实施环境来举例说明。该图像获取方法包括:Please refer to FIG. 2A , which shows a flowchart of an image acquisition method provided by an exemplary embodiment of the present application. This embodiment is described by taking the image acquisition method applied to the implementation environment shown in FIG. 1 as an example. The image acquisition methods include:

步骤201,获取拍摄的目标视频数据。Step 201, acquire the captured target video data.

可选的,服务器获取终端发送的包括目标对象的目标视频数据。对应的,该目标视频数据为终端通过前置摄像拍摄的视频数据。其中,目标对象的图像类别包括人物、动物、静物和风景中的至少一种。Optionally, the server acquires the target video data including the target object sent by the terminal. Correspondingly, the target video data is video data captured by the terminal through a front camera. Wherein, the image category of the target object includes at least one of person, animal, still life and landscape.

步骤202,将目标视频数据的图像帧,分别输入预先训练的图像评分模型,得到每个图像帧对应的评分。In step 202, the image frames of the target video data are respectively input into the pre-trained image scoring model to obtain the corresponding score of each image frame.

图像评分模型是采用样本图像和和样本图像评分对CNN进行训练得到的模型,用于计算图像的质量评分。The image scoring model is a model obtained by training CNN with sample images and sample image scores, and is used to calculate the quality score of the image.

可选的,服务器中存储有图像评分模型,该图像评分模型是根据至少一个训练样本训练得到的,每个训练样本包括:样本图像和样本图像评分。Optionally, an image scoring model is stored in the server, and the image scoring model is trained according to at least one training sample, and each training sample includes: a sample image and a score of the sample image.

其中,图像评分模型的训练过程可参考下面的实施例中的相关描述,在此先不介绍。For the training process of the image scoring model, reference may be made to the relevant descriptions in the following embodiments, which will not be introduced here.

每个图像帧对应的评分用于指示该图像的图像质量,图像质量包括图像逼真度和图像可懂度。其中,图像逼真度为提取的图像和实际图像之间的偏离程度,图像可懂度为人或机器从图像中抽取到特征信息的程度。The score corresponding to each image frame is used to indicate the image quality of the image, and the image quality includes image fidelity and image intelligibility. Among them, image fidelity is the degree of deviation between the extracted image and the actual image, and image intelligibility is the degree to which people or machines can extract feature information from images.

可选的,质量评分用于指示图像的图像质量,即用于指示图像的构图比例、色彩对比度、色彩饱和度和明暗对比度。比如,图像的质量评分越高,则表示该图像的图像质量越好,即图像的构图比例、色彩对比度、色彩饱和度和明暗对比度所对应的效果越好。Optionally, the quality score is used to indicate the image quality of the image, that is, to indicate the composition ratio, color contrast, color saturation, and light-dark contrast of the image. For example, the higher the quality score of the image, the better the image quality of the image, that is, the better the effect corresponding to the composition ratio, color contrast, color saturation and light-dark contrast of the image.

步骤203,根据目标视频数据的图像帧中评分最高的第一图像帧,确定拍照图片。Step 203: Determine the photographed picture according to the first image frame with the highest score among the image frames of the target video data.

由于质量评分用于指示图像的图像质量,评分最高的图像帧即为目标视频数据的图像帧中,图像质量最好的图像帧,因此,根据第一图像帧确定出的确定拍照图片,相比其他图像帧确定出的确定拍照图片的图像质量更好。Since the quality score is used to indicate the image quality of the image, the image frame with the highest score is the image frame with the best image quality among the image frames of the target video data. The image quality of the photographed picture determined by other image frames is better.

综上所述,本申请实施例通过从目标视频数据中筛选出评分最高的图像帧,并根据该图像帧确定拍照图片,由于无须用户手动筛选,服务器会自动从目标视频数据中选取出评分最高的图像帧,因此解决了用户的自拍效率低下的问题,达到了提高用户的自拍效率的效果。To sum up, in the embodiment of the present application, the image frame with the highest score is selected from the target video data, and the photographed picture is determined according to the image frame. Since the user does not need to manually filter, the server will automatically select the image frame with the highest score from the target video data. image frames, thus solving the problem of low self-portrait efficiency of the user, and achieving the effect of improving the self-portrait efficiency of the user.

需要说明的是,在步骤201之前,服务器需要对图像进行训练得到图像评分模型。It should be noted that before step 201, the server needs to train images to obtain an image scoring model.

请参考图2B,其示出了本申请一个示例性实施例提供的图像评分模型的训练过程的流程图。可选的,图像评分模型的训练过程包括但不限于以下几个步骤:Please refer to FIG. 2B , which shows a flowchart of a training process of an image scoring model provided by an exemplary embodiment of the present application. Optionally, the training process of the image scoring model includes but not limited to the following steps:

步骤204,获取多个训练样本。Step 204, acquiring multiple training samples.

其中,每个训练样本包括样本图像和样本图像评分。Wherein, each training sample includes a sample image and a score of the sample image.

可选的,训练样本从终端获取或者从其他服务器获取,样本图像评分由人为确定。Optionally, the training samples are obtained from the terminal or other servers, and the scores of the sample images are manually determined.

步骤205,将样本图像作为训练输入,样本图像评分作为输出参考值,对初始图像分类模型进行训练,得到训练后的图像评分模型。Step 205, using the sample image as a training input and the sample image score as an output reference value to train the initial image classification model to obtain a trained image score model.

对于至少一个训练样本中的样本图像和样本图像评分,从样本图像中提取样本图像特征,将样本图像特征输入初始图像分类模型,得到训练结果。For the sample image and the sample image score in at least one training sample, extract sample image features from the sample image, input the sample image feature into the initial image classification model, and obtain the training result.

可选的,服务器根据预设图像处理算法,从样本图像中提取样本图像特征。其中,预设图像处理算法为感知哈希算法(Perceptual hash algorithm,pHash算法)。服务器通过pHash算法计算样本图像对应的感知哈希值,将计算得到的感知哈希值确定为样本图像特征。Optionally, the server extracts sample image features from sample images according to a preset image processing algorithm. Wherein, the preset image processing algorithm is a perceptual hash algorithm (Perceptual hash algorithm, pHash algorithm). The server calculates the perceptual hash value corresponding to the sample image through the pHash algorithm, and determines the calculated perceptual hash value as the feature of the sample image.

可选的,初始图像分类模型是根据神经网络模型建立的,比如:初始图像分类模型是根据CNN模型、DNN模型和RNN模型中的一种建立的。Optionally, the initial image classification model is established according to a neural network model, for example: the initial image classification model is established according to one of a CNN model, a DNN model and an RNN model.

示意性的,对于每个训练样本,终端创建该训练样本对应的输入输出对,输入输出对的输入参数为该训练样本中样本图像对应的样本图像特征,输出参数为该训练样本中的样本图像评分;服务器将输入输出对输入初始图像分类模型,得到训练结果。Schematically, for each training sample, the terminal creates an input-output pair corresponding to the training sample, the input parameter of the input-output pair is the sample image feature corresponding to the sample image in the training sample, and the output parameter is the sample image in the training sample Scoring; the server inputs the input and output to the initial image classification model to obtain the training result.

比如,样本图像特征为“样本图像特征1”,样本图像评分为“样本图像评分1”,终端创建的输入输出对为:(样本图像特征1)->(样本图像评分1);其中,(样本图像特征1)为输入参数,(样本图像评分1)为输出参数。For example, the sample image feature is "sample image feature 1", the sample image score is "sample image score 1", and the input-output pair created by the terminal is: (sample image feature 1) -> (sample image score 1); where ( The sample image feature 1) is an input parameter, and (sample image score 1) is an output parameter.

可选的,输入输出对通过特征向量表示。Optionally, input-output pairs are represented by feature vectors.

基于上述训练得到图像评分模型,请参考图3A,其示出了本申请另一个示例性实施例提供的图像获取方法的流程图。本实施例以该图像获取方法应用于图1所示出的实施环境来举例说明。该图像获取方法包括:An image scoring model is obtained based on the above training, please refer to FIG. 3A , which shows a flow chart of an image acquisition method provided by another exemplary embodiment of the present application. This embodiment is described by taking the image acquisition method applied to the implementation environment shown in FIG. 1 as an example. The image acquisition methods include:

步骤301,获取拍摄的目标视频数据。Step 301, acquire the captured target video data.

步骤302,获取目标视频数据中预设位置的第二图像帧,将第二图像帧输入图像分类模型,得到第二图像帧的图像类别。Step 302, acquiring a second image frame at a preset position in the target video data, and inputting the second image frame into an image classification model to obtain an image category of the second image frame.

由于目标视频数据中目标对象的图像类别包括人物、动物、静物和风景中的至少一种,不同的图像类别对应的图像的质量评分标准不同,因此根据不同的图像类别选择不同的图像评分模型,可使得基于图像评分模型计算得到的图像的质量评分更加准确。Since the image category of the target object in the target video data includes at least one of people, animals, still life and scenery, the quality scoring standards of images corresponding to different image categories are different, so different image scoring models are selected according to different image categories, The image quality score calculated based on the image scoring model can be made more accurate.

对于拍摄时长较为简短的目标视频数据(比如10s内的视频数据)而言,目标视频数据中的目标对象通常不会改变,故从目标视频数据中抽取出一帧图像帧(第二图像帧),将第二图像帧输入图像分类模型,得到第二图像帧的图像类别,并将第二图像帧的图像类别作为目标视频数据中所有图像帧的图像类别。For the shorter target video data (such as video data within 10s) of the shooting time, the target object in the target video data usually does not change, so a frame of image frame (second image frame) is extracted from the target video data , input the second image frame into the image classification model to obtain the image category of the second image frame, and use the image category of the second image frame as the image category of all image frames in the target video data.

需要说明的是,预设位置是指第二图像帧在目标视频数据的位置,该预设位置可为第5帧、第10帧、第15帧,本实施例对预设位置的具体数值不做限定。It should be noted that the preset position refers to the position of the second image frame in the target video data, and the preset position can be the 5th frame, the 10th frame, and the 15th frame, and the specific value of the preset position is not specified in this embodiment. Do limited.

在一种可能实现的方式中,步骤304可被替换为:根据预设的视频处理算法,对获取到的目标视频数据进行分析,计算得到目标视频数据中目标对象的类型标识,根据计算得到的类型标识,确定与该类型标识对应的图像类别,该类型标识用于唯一标识图像类别。In a possible implementation manner, step 304 may be replaced by: analyzing the acquired target video data according to a preset video processing algorithm, and calculating the type identifier of the target object in the target video data, and according to the calculated The type identifier determines the image category corresponding to the type identifier, and the type identifier is used to uniquely identify the image category.

步骤303,根据预先存储的图像类别与图像评分模型的对应关系,确定第二图像帧的图像类型对应的目标图像评分模型,将目标视频数据中的各个图像帧分别输入目标图像评分模型,得到每个图像帧对应的评分。Step 303: Determine the target image scoring model corresponding to the image type of the second image frame according to the pre-stored correspondence between the image category and the image scoring model, input each image frame in the target video data into the target image scoring model, and obtain each Scores corresponding to image frames.

其中,图像类别与图像评分模型的对应关系如表一所示。在表一中,图像类别为“人物”时,对应的图像评分模型为“图像评分模型1”;图像类别为“动物”时,对应的图像评分模型为“图像评分模型2”;图像类别为“静物”时,对应的图像评分模型为“图像评分模型3”;图像类别为“风景”时,对应的图像评分模型为“图像评分模型4”。Among them, the corresponding relationship between the image category and the image scoring model is shown in Table 1. In Table 1, when the image category is "person", the corresponding image scoring model is "image scoring model 1"; when the image category is "animal", the corresponding image scoring model is "image scoring model 2"; the image category is For "still life", the corresponding image scoring model is "image scoring model 3"; when the image category is "landscape", the corresponding image scoring model is "image scoring model 4".

表一Table I

图像类别image category 图像评分模型Image Scoring Model 人物figure 图像评分模型1Image Scoring Model 1 动物animal 图像评分模型2Image Scoring Model 2 静物still life 图像评分模型3Image Scoring Model 3 风景landscape 图像评分模型4Image Scoring Model 4

示意性的,基于表一提供的预设对应关系,当终端获取到的目标对象的图像类别为“人物”时,获取与目标对象的图像类别“人物”对应的图像评分模型“图像评分模型1”。Schematically, based on the preset correspondence provided in Table 1, when the image category of the target object acquired by the terminal is "person", the image scoring model "image scoring model 1" corresponding to the image category of the target object "person" is obtained ".

步骤304,根据目标视频数据的图像帧中评分最高的第一图像帧,确定拍照图片。Step 304: Determine the photographed picture according to the first image frame with the highest score among the image frames of the target video data.

需要说明的是,本实施例中步骤301与步骤201类似,步骤304与步骤203类似,步骤301和步骤304具体描述可分别参考步骤201和步骤203,在此不再赘述。It should be noted that in this embodiment, step 301 is similar to step 201, and step 304 is similar to step 203. For specific descriptions of step 301 and step 304, please refer to step 201 and step 203 respectively, and details are not repeated here.

综上所述,本申请实施例通过从目标视频数据中筛选出评分最高的图像帧,并根据该图像帧确定拍照图片,由于无须用户手动筛选,服务器会自动从目标视频数据中选取出评分最高的图像帧,因此解决了用户的自拍效率低下的问题,达到了提高用户的自拍效率的效果。To sum up, in the embodiment of the present application, the image frame with the highest score is selected from the target video data, and the photographed picture is determined according to the image frame. Since the user does not need to manually filter, the server will automatically select the image frame with the highest score from the target video data. image frames, thus solving the problem of low self-portrait efficiency of the user, and achieving the effect of improving the self-portrait efficiency of the user.

本实施例中,根据不同的图像类别选择不同的图像评分模型,可使得基于图像评分模型计算得到的图像的质量评分更加准确。In this embodiment, selecting different image scoring models according to different image categories can make the image quality score calculated based on the image scoring model more accurate.

需要说明的是,在步骤301之前,服务器需要对图像进行训练得到图像分类模型。It should be noted that before step 301, the server needs to train images to obtain an image classification model.

请参考图3B,其示出了本申请一个示例性实施例提供的图像分类模型的训练过程的流程图。可选的,图像评分模型的训练过程包括但不限于以下几个步骤:Please refer to FIG. 3B , which shows a flowchart of a training process of an image classification model provided by an exemplary embodiment of the present application. Optionally, the training process of the image scoring model includes but not limited to the following steps:

步骤305,获取多个训练样本。Step 305, acquiring multiple training samples.

其中,每个训练样本包括样本图像和样本图像类别。Wherein, each training sample includes a sample image and a category of the sample image.

可选的,训练样本从终端获取或者从其他服务器获取,样本图像类别由人为确定。Optionally, the training samples are obtained from the terminal or other servers, and the category of the sample images is manually determined.

步骤306,将样本图像作为训练输入,样本图像类别作为输出参考值,对初始图像分类模型进行训练,得到训练后的图像分类模型。Step 306, using the sample image as a training input and the category of the sample image as an output reference value to train the initial image classification model to obtain a trained image classification model.

对于至少一个训练样本中的样本图像和样本图像类别,从样本图像中提取样本图像特征,将样本图像特征输入初始图像分类模型,得到训练结果。For the sample image and the sample image category in at least one training sample, sample image features are extracted from the sample image, and the sample image features are input into the initial image classification model to obtain a training result.

可选的,服务器根据预设图像处理算法,从样本图像中提取样本图像特征。其中,预设图像处理算法为感知哈希算法(Perceptual hash algorithm,pHash算法)。服务器通过pHash算法计算样本图像对应的感知哈希值,将计算得到的感知哈希值确定为样本图像特征。Optionally, the server extracts sample image features from sample images according to a preset image processing algorithm. Wherein, the preset image processing algorithm is a perceptual hash algorithm (Perceptual hash algorithm, pHash algorithm). The server calculates the perceptual hash value corresponding to the sample image through the pHash algorithm, and determines the calculated perceptual hash value as the feature of the sample image.

可选的,初始图像分类模型是根据神经网络模型建立的,比如:初始图像分类模型是根据CNN模型、DNN模型和RNN模型中的一种建立的。Optionally, the initial image classification model is established according to a neural network model, for example: the initial image classification model is established according to one of a CNN model, a DNN model and an RNN model.

示意性的,对于每个训练样本,终端创建该训练样本对应的输入输出对,输入输出对的输入参数为该训练样本中样本图像对应的样本图像特征,输出参数为该训练样本中的样本图像类别;服务器将输入输出对输入初始图像分类模型,得到训练结果。Schematically, for each training sample, the terminal creates an input-output pair corresponding to the training sample, the input parameter of the input-output pair is the sample image feature corresponding to the sample image in the training sample, and the output parameter is the sample image in the training sample category; the server inputs the input and output pairs into the initial image classification model to obtain the training result.

比如,样本图像特征为“样本图像特征1”,样本图像类别为“样本图像类别1”,终端创建的输入输出对为:(样本图像特征1)->(样本图像类别1);其中,(样本图像特征1)为输入参数,(样本图像类别1)为输出参数。For example, the sample image feature is "sample image feature 1", the sample image category is "sample image category 1", and the input-output pair created by the terminal is: (sample image feature 1) -> (sample image category 1); among them, ( Sample image feature 1) is an input parameter, and (sample image category 1) is an output parameter.

可选的,输入输出对通过特征向量表示。Optionally, input-output pairs are represented by feature vectors.

请参考图4,其示出了本申请再一个示例性实施例提供的图像获取方法的流程图。本实施例以该图像获取方法应用于图1所示出的实施环境来举例说明。该图像获取方法包括:Please refer to FIG. 4 , which shows a flow chart of an image acquisition method provided in another exemplary embodiment of the present application. This embodiment is described by taking the image acquisition method applied to the implementation environment shown in FIG. 1 as an example. The image acquisition methods include:

步骤401,获取拍摄的目标视频数据。Step 401, acquire the captured target video data.

步骤402,将目标视频数据的图像帧,分别输入预先训练的图像评分模型,得到每个图像帧对应的评分。In step 402, the image frames of the target video data are respectively input into the pre-trained image scoring model to obtain the corresponding score of each image frame.

步骤403,确定评分最高的第一图像帧。Step 403, determine the first image frame with the highest score.

步骤404,提取第一图像帧、第一图像帧的前m帧图像帧和第一图像帧的后n帧图像帧。Step 404, extracting the first image frame, the first m image frames of the first image frame, and the last n image frames of the first image frame.

由于图像帧对应的评分是根据该图像帧中所有像素块的综合评分,并不代表该图像帧中每一个像素块比其他图像帧中相同位置的像素块的评分高,为了保证拍照图片的图像质量,在提取出评分最高的第一图像帧之后,可一并提取出该第一图像帧的前m帧图像帧和第一图像帧的后n帧图像帧,对第一图像帧、第一图像帧的前m帧图像帧和第一图像帧的后n帧图像帧进行图像合成,得到高质量的拍照图像。Since the score corresponding to the image frame is based on the comprehensive score of all pixel blocks in the image frame, it does not mean that each pixel block in the image frame has a higher score than the pixel blocks in the same position in other image frames. quality, after extracting the first image frame with the highest score, the first m image frames of the first image frame and the last n image frames of the first image frame can be extracted together, for the first image frame, the first Image synthesis is performed on the first m image frames of the image frame and the last n image frames of the first image frame to obtain a high-quality photographed image.

需要说明的是,m和n均为正整数,m和n数值可以相同也可以不同,本实施例并不限定m和n的具体数值。It should be noted that both m and n are positive integers, and the values of m and n may be the same or different, and this embodiment does not limit the specific values of m and n.

由于当两张图像差异较大时,会影响所合成的拍照图片的质量,因此为了保证合成后得到拍照图片的质量,优选的,m为1,n为1。即服务器在确定出评分最高的第一图像帧后,提取第一图像帧、第一图像帧的前1帧图像帧和第一图像帧的后1帧图像帧。Since the quality of the synthesized photographic picture will be affected when the difference between the two images is large, in order to ensure the quality of the synthesized photographic picture, preferably, m is 1 and n is 1. That is, after determining the first image frame with the highest score, the server extracts the first image frame, an image frame before the first image frame, and an image frame after the first image frame.

在一种特殊的情况中,第一图像帧为目标视频数据中的首帧,或者为目标视频数据中的末帧,即如果服务器无法提取第一图像帧的前m帧图像帧,则不对第一图像帧的前m帧图像帧进行提取,同样,服务器无法提取第一图像帧的后n帧图像帧,则不对第一图像帧的后n帧图像帧进行提取。In a special case, the first image frame is the first frame in the target video data, or the last frame in the target video data, that is, if the server cannot extract the first m image frames of the first image frame, then the first image frame is not The first m image frames of an image frame are extracted. Similarly, if the server cannot extract the last n image frames of the first image frame, the next n image frames of the first image frame are not extracted.

步骤405,对第一图像帧、第一图像帧的前m帧图像帧和第一图像帧的后n帧图像帧进行图像合成,得到拍照图片。Step 405 , performing image synthesis on the first image frame, the first m image frames of the first image frame, and the last n image frames of the first image frame, to obtain a photographed picture.

可选的,在第一图像帧、第一图像帧的前m帧图像帧和第一图像帧的后n帧图像帧中,将不同图像帧中相同位置的像素块中清晰度最高的像素块,进行组合,得到拍照图片。Optionally, in the first image frame, the first m image frames of the first image frame, and the last n image frames of the first image frame, the pixel block with the highest definition among the pixel blocks at the same position in different image frames , to combine them to get the picture taken.

可选的,在第一图像帧、第一图像帧的前m帧图像帧和第一图像帧的后n帧图像帧中,将不同图像帧中相同位置的像素块中色彩饱和度最高的像素块,进行组合,得到拍照图片。Optionally, in the first image frame, the first m image frames of the first image frame, and the last n image frames of the first image frame, the pixel with the highest color saturation in the pixel blocks at the same position in different image frames Blocks are combined to obtain a photographed picture.

需要说明的是,本实施例中步骤401至步骤402与步骤201至步骤202类似,步骤401至步骤402具体描述可参考步骤201至步骤202,在此不再赘述。It should be noted that, in this embodiment, steps 401 to 402 are similar to steps 201 to 202. For specific descriptions of steps 401 to 402, reference may be made to steps 201 to 202, which will not be repeated here.

综上所述,本申请实施例通过从目标视频数据中筛选出评分最高的图像帧,并根据该图像帧确定拍照图片,由于无须用户手动筛选,服务器会自动从目标视频数据中选取出评分最高的图像帧,因此解决了用户的自拍效率低下的问题,达到了提高用户的自拍效率的效果。To sum up, in the embodiment of the present application, the image frame with the highest score is selected from the target video data, and the photographed picture is determined according to the image frame. Since the user does not need to manually filter, the server will automatically select the image frame with the highest score from the target video data. image frames, thus solving the problem of low self-portrait efficiency of the user, and achieving the effect of improving the self-portrait efficiency of the user.

本实施例中,对第一图像帧、第一图像帧的前m帧图像帧和第一图像帧的后n帧图像帧进行图像合成,从而得到高质量的拍照图像。In this embodiment, image synthesis is performed on the first image frame, the first m image frames of the first image frame, and the last n image frames of the first image frame, so as to obtain a high-quality photographed image.

下述为本申请装置实施例,可以用于执行本申请方法实施例。对于本申请装置实施例中未披露的细节,请参照本申请方法实施例。The following are device embodiments of the present application, which can be used to implement the method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.

请参考图5,其示出了本申请一个示例性实施例提供的图像获取装置的结构示意图。该图像获取装置可以通过专用硬件电路,或者,软硬件的结合实现成为图1中的终端的全部或一部分,该图像获取装置包括:第一获取模块501、输入模块502和确定模块503。Please refer to FIG. 5 , which shows a schematic structural diagram of an image acquisition device provided by an exemplary embodiment of the present application. The image acquisition device can be implemented as all or part of the terminal in FIG. 1 through a dedicated hardware circuit, or a combination of software and hardware. The image acquisition device includes: a first acquisition module 501 , an input module 502 and a determination module 503 .

第一获取模块501,用于获取拍摄的目标视频数据;The first obtaining module 501 is used to obtain the target video data of shooting;

输入模块502,用于将目标视频数据的图像帧,分别输入预先训练的图像评分模型,得到每个图像帧对应的评分;The input module 502 is used to input the image frames of the target video data into the image scoring model trained in advance respectively, so as to obtain the corresponding scoring of each image frame;

确定模块503,用于根据目标视频数据的图像帧中评分最高的第一图像帧,确定拍照图片。The determination module 503 is configured to determine a photographed picture according to the first image frame with the highest score among the image frames of the target video data.

在基于图5所示实施例提供的一个可选实施例中,该输入模块502,包括:第一输入单元和第二输入单元。In an optional embodiment provided based on the embodiment shown in FIG. 5 , the input module 502 includes: a first input unit and a second input unit.

第一输入单元,用于获取目标视频数据中预设位置的第二图像帧,将第二图像帧输入图像分类模型,得到第二图像帧的图像类别;The first input unit is used to obtain a second image frame at a preset position in the target video data, and input the second image frame into the image classification model to obtain the image category of the second image frame;

第二输入单元,用于根据预先存储的图像类别与图像评分模型的对应关系,确定第二图像帧的图像类型对应的目标图像评分模型,将目标视频数据中的各个图像帧分别输入目标图像评分模型,得到每个图像帧对应的评分。The second input unit is used to determine the target image scoring model corresponding to the image type of the second image frame according to the corresponding relationship between the pre-stored image category and the image scoring model, and input each image frame in the target video data into the target image scoring model respectively model to get the score corresponding to each image frame.

在基于图5所示实施例提供的一个可选实施例中,该装置还包括:第二获取模块和第一训练模块。In an optional embodiment provided based on the embodiment shown in FIG. 5 , the device further includes: a second acquiring module and a first training module.

第二获取模块,用于获取多个训练样本,其中,每个训练样本包括样本图像和样本图像类别;The second obtaining module is used to obtain a plurality of training samples, wherein each training sample includes a sample image and a sample image category;

第一训练模块,用于将样本图像作为训练输入,样本图像类别作为输出参考值,对初始图像分类模型进行训练,得到训练后的图像分类模型。The first training module is used to use the sample image as a training input and the category of the sample image as an output reference value to train the initial image classification model to obtain a trained image classification model.

在基于图5所示实施例提供的一个可选实施例中,该确定模块503,包括:确定单元、提取单元和合成单元。In an optional embodiment provided based on the embodiment shown in FIG. 5 , the determining module 503 includes: a determining unit, an extracting unit, and a combining unit.

确定单元,用于确定评分最高的第一图像帧;a determining unit, configured to determine the first image frame with the highest score;

提取单元,用于提取第一图像帧、第一图像帧的前m帧图像帧和第一图像帧的后n帧图像帧;An extraction unit, configured to extract the first image frame, the first m image frames of the first image frame, and the last n image frames of the first image frame;

合成单元,用于对第一图像帧、第一图像帧的前m帧图像帧和第一图像帧的后n帧图像帧进行图像合成,得到拍照图片。The synthesis unit is configured to perform image synthesis on the first image frame, the first m image frames of the first image frame, and the last n image frames of the first image frame to obtain a photographed picture.

在基于图5所示实施例提供的一个可选实施例中,该合成单元,包括:In an optional embodiment provided based on the embodiment shown in FIG. 5, the synthesis unit includes:

第一组合子单元,用于在第一图像帧、第一图像帧的前m帧图像帧和第一图像帧的后n帧图像帧中,将不同图像帧中相同位置的像素块中清晰度最高的像素块,进行组合,得到拍照图片;The first combination subunit is used to combine the sharpness of pixel blocks at the same position in different image frames in the first image frame, the first m image frames of the first image frame, and the last n image frames of the first image frame The highest pixel blocks are combined to obtain a photographed picture;

第二组合子单元,用于在第一图像帧、第一图像帧的前m帧图像帧和第一图像帧的后n帧图像帧中,将不同图像帧中相同位置的像素块中色彩饱和度最高的像素块,进行组合,得到拍照图片。The second combination subunit is used to saturate the colors in the pixel blocks at the same position in different image frames in the first image frame, the first m image frames of the first image frame, and the last n image frames of the first image frame The pixel blocks with the highest degree of accuracy are combined to obtain a photographed picture.

在基于图5所示实施例提供的一个可选实施例中,该装置还包括:第三获取模块和第二训练模块。In an optional embodiment provided based on the embodiment shown in FIG. 5 , the device further includes: a third acquiring module and a second training module.

第三获取模块,用于获取多个训练样本,其中,每个训练样本包括样本图像和样本图像评分;The third obtaining module is used to obtain a plurality of training samples, wherein each training sample includes a sample image and a score of the sample image;

第二训练模块,用于将样本图像作为训练输入,样本图像评分作为输出参考值,对初始图像分类模型进行训练,得到训练后的图像评分模型。The second training module is used to train the initial image classification model by using the sample image as a training input and the sample image score as an output reference value to obtain a trained image score model.

相关细节可结合参考图2A至图4所示的方法实施例。其中,第一获取模块501还用于实现上述方法实施例中其他任意隐含或公开的与接收步骤相关的功能;输入模块502还用于实现上述方法实施例中其他任意隐含或公开的与监测步骤相关的功能;确定模块503还用于实现上述方法实施例中其他任意隐含或公开的与监测步骤相关的功能。Relevant details may be combined with reference to the method embodiments shown in FIG. 2A to FIG. 4 . Wherein, the first acquisition module 501 is also used to implement any other implicit or disclosed functions related to the receiving step in the above method embodiments; the input module 502 is also used to implement any other implicit or disclosed functions related to the receiving step in the above method embodiments. Functions related to the monitoring step; the determining module 503 is also configured to implement any other implicit or disclosed functions related to the monitoring step in the above method embodiments.

需要说明的是,上述实施例提供的装置,在实现其功能时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将设备的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的装置与方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。It should be noted that, when realizing the functions of the device provided by the above-mentioned embodiments, the division of the above-mentioned functional modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional modules according to the needs. The internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and the method embodiment provided by the above embodiment belong to the same idea, and the specific implementation process thereof is detailed in the method embodiment, and will not be repeated here.

本申请还提供一种计算机可读介质,其上存储有程序指令,该程序指令被处理器执行时实现上述各个方法实施例提供的图像获取方法。The present application also provides a computer-readable medium, on which program instructions are stored, and when the program instructions are executed by a processor, the image acquisition methods provided in the foregoing method embodiments are implemented.

本申请还提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述各个方法实施例所述的图像获取方法。The present application also provides a computer program product containing instructions, which, when run on a computer, causes the computer to execute the image acquisition method described in each method embodiment above.

上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the above embodiments of the present application are for description only, and do not represent the advantages and disadvantages of the embodiments.

本领域普通技术人员可以理解实现上述实施例的文件处理方法中全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。以上所述仅为本申请的较佳实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。Those of ordinary skill in the art can understand that all or part of the steps in the file processing method of the above-mentioned embodiments can be completed by hardware, and can also be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage Among the media, the storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, and the like. The above descriptions are only preferred embodiments of the application, and are not intended to limit the application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the application shall be included in the protection of the application. within range.

Claims (9)

1.一种图像获取方法,其特征在于,所述方法包括:1. An image acquisition method, characterized in that the method comprises: 获取拍摄的目标视频数据;Obtain the captured target video data; 将所述目标视频数据的图像帧,分别输入预先训练的图像评分模型,得到每个图像帧对应的评分;The image frames of the target video data are respectively input into the pre-trained image scoring model to obtain the corresponding scoring of each image frame; 根据所述目标视频数据的图像帧中评分最高的第一图像帧,确定拍照图片。A photographed picture is determined according to the first image frame with the highest score among the image frames of the target video data. 2.根据权利要求1所述的方法,其特征在于,所述将所述目标视频数据的图像帧,分别输入预先训练的图像评分模型,得到每个图像帧对应的评分,包括:2. The method according to claim 1, wherein the image frames of the target video data are respectively input into a pre-trained image scoring model to obtain the corresponding scoring of each image frame, including: 获取所述目标视频数据中预设位置的第二图像帧,将所述第二图像帧输入图像分类模型,得到所述第二图像帧的图像类别;Obtaining a second image frame at a preset position in the target video data, inputting the second image frame into an image classification model to obtain an image category of the second image frame; 根据预先存储的图像类别与图像评分模型的对应关系,确定所述第二图像帧的图像类型对应的目标图像评分模型,将所述目标视频数据中的各个图像帧分别输入所述目标图像评分模型,得到每个图像帧对应的评分。According to the correspondence between the pre-stored image category and the image scoring model, determine the target image scoring model corresponding to the image type of the second image frame, and input each image frame in the target video data into the target image scoring model respectively. , to get the score corresponding to each image frame. 3.根据权利要求2所述的方法,其特征在于,所述方法还包括:3. The method according to claim 2, wherein the method further comprises: 获取多个训练样本,其中,每个训练样本包括样本图像和样本图像类别;Obtaining a plurality of training samples, wherein each training sample includes a sample image and a sample image category; 将所述样本图像作为训练输入,所述样本图像类别作为输出参考值,对初始图像分类模型进行训练,得到训练后的所述图像分类模型。The sample image is used as a training input, and the category of the sample image is used as an output reference value to train an initial image classification model to obtain the trained image classification model. 4.根据权利要求1所述的方法,其特征在于,所述根据所述目标视频数据的图像帧中评分最高的第一图像帧,确定拍照图片,包括:4. The method according to claim 1, wherein the first image frame with the highest score in the image frame according to the target video data, determining the photographed picture includes: 确定评分最高的第一图像帧;determining the first image frame with the highest score; 提取所述第一图像帧、所述第一图像帧的前m帧图像帧和所述第一图像帧的后n帧图像帧;extracting the first image frame, the first m image frames of the first image frame, and the last n image frames of the first image frame; 对所述第一图像帧、所述第一图像帧的前m帧图像帧和所述第一图像帧的后n帧图像帧进行图像合成,得到拍照图片。performing image synthesis on the first image frame, the first m image frames of the first image frame, and the last n image frames of the first image frame to obtain a photographed picture. 5.根据权利要求4所述的方法,其特征在于,所述对所述第一图像帧、所述第一图像帧的前m帧图像帧和所述第一图像帧的后n帧图像帧进行图像合成,得到拍照图片,包括:5. The method according to claim 4, wherein the pair of the first image frame, the first m image frames of the first image frame and the last n image frames of the first image frame Perform image synthesis to obtain photographed pictures, including: 在所述第一图像帧、所述第一图像帧的前m帧图像帧和所述第一图像帧的后n帧图像帧中,将不同图像帧中相同位置的像素块中清晰度最高的像素块,进行组合,得到拍照图片;或者,In the first image frame, the first m image frames of the first image frame, and the last n image frames of the first image frame, the highest definition among the pixel blocks at the same position in different image frames Pixel blocks are combined to obtain a photographed picture; or, 在所述第一图像帧、所述第一图像帧的前m帧图像帧和所述第一图像帧的后n帧图像帧中,将不同图像帧中相同位置的像素块中饱和度最高的像素块,进行组合,得到拍照图片。In the first image frame, the first m image frames of the first image frame, and the last n image frames of the first image frame, the pixel block with the highest saturation in the same position in different image frames Pixel blocks are combined to obtain a photographed picture. 6.根据权利要求1-5中任一所述的方法,其特征在于,所述方法还包括:6. The method according to any one of claims 1-5, wherein the method further comprises: 获取多个训练样本,其中,每个训练样本包括样本图像和样本图像评分;Obtaining a plurality of training samples, wherein each training sample includes a sample image and a score of the sample image; 将所述样本图像作为训练输入,所述样本图像评分作为输出参考值,对初始图像分类模型进行训练,得到训练后的所述图像评分模型。The sample image is used as a training input, and the sample image score is used as an output reference value to train an initial image classification model to obtain the trained image score model. 7.一种图像获取装置,其特征在于,所述装置包括:7. An image acquisition device, characterized in that the device comprises: 第一获取模块,用于获取拍摄的目标视频数据;The first obtaining module is used to obtain the target video data of shooting; 输入模块,用于将所述目标视频数据的图像帧,分别输入预先训练的图像评分模型,得到每个图像帧对应的评分;The input module is used to input the image frames of the target video data into the pre-trained image scoring model respectively to obtain the corresponding scoring of each image frame; 确定模块,用于根据所述目标视频数据的图像帧中评分最高的第一图像帧,确定拍照图片。The determination module is configured to determine the photographed picture according to the first image frame with the highest score among the image frames of the target video data. 8.一种终端,其特征在于,所述终端包括处理器、存储器,所述存储器中存储有至少一条指令,所述指令由所述处理器加载并执行以实现如权利要求1至6任一所述的图像获取方法。8. A terminal, characterized in that the terminal comprises a processor and a memory, and at least one instruction is stored in the memory, and the instruction is loaded and executed by the processor to implement any one of claims 1 to 6. The image acquisition method described. 9.一种计算机可读存储介质,其特征在于,所述存储介质中存储有至少一条指令,所述指令由处理器加载并执行以实现如权利要求1至6任一所述的图像获取方法。9. A computer-readable storage medium, characterized in that at least one instruction is stored in the storage medium, and the instruction is loaded and executed by a processor to implement the image acquisition method according to any one of claims 1 to 6 .
CN201711484291.6A 2017-12-29 2017-12-29 Image acquisition method, device, terminal and storage medium Pending CN108198177A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711484291.6A CN108198177A (en) 2017-12-29 2017-12-29 Image acquisition method, device, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711484291.6A CN108198177A (en) 2017-12-29 2017-12-29 Image acquisition method, device, terminal and storage medium

Publications (1)

Publication Number Publication Date
CN108198177A true CN108198177A (en) 2018-06-22

Family

ID=62586727

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711484291.6A Pending CN108198177A (en) 2017-12-29 2017-12-29 Image acquisition method, device, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN108198177A (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109409235A (en) * 2018-09-27 2019-03-01 Oppo广东移动通信有限公司 Image recognition method and apparatus, electronic device, computer-readable storage medium
CN110390263A (en) * 2019-06-17 2019-10-29 宁波江丰智能科技有限公司 A kind of method of video image processing and system
CN110659614A (en) * 2019-09-25 2020-01-07 Oppo广东移动通信有限公司 Video sampling method, apparatus, device and storage medium
WO2020116983A1 (en) 2018-12-07 2020-06-11 Samsung Electronics Co., Ltd. Electronic apparatus, controlling method of electronic apparatus, and computer readable medium
CN111935479A (en) * 2020-07-30 2020-11-13 浙江大华技术股份有限公司 Target image determination method and device, computer equipment and storage medium
CN112055847A (en) * 2018-09-18 2020-12-08 谷歌有限责任公司 Method and system for processing image
CN112188075A (en) * 2019-07-05 2021-01-05 杭州海康威视数字技术股份有限公司 Snapshot, image processing device and image processing method
CN112492297A (en) * 2020-11-17 2021-03-12 腾讯科技(深圳)有限公司 Video processing method and related equipment
CN112771612A (en) * 2019-09-06 2021-05-07 华为技术有限公司 Method and device for shooting image
CN113259601A (en) * 2020-02-11 2021-08-13 北京字节跳动网络技术有限公司 Video processing method and device, readable medium and electronic equipment
CN113365023A (en) * 2021-04-22 2021-09-07 北京房江湖科技有限公司 Holder visual angle correction method and device, electronic equipment and storage medium
CN115802146A (en) * 2021-09-07 2023-03-14 荣耀终端有限公司 Method and electronic device for capturing images in video
CN119255094A (en) * 2024-04-17 2025-01-03 荣耀终端有限公司 Shooting processing method and related equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150071547A1 (en) * 2013-09-09 2015-03-12 Apple Inc. Automated Selection Of Keeper Images From A Burst Photo Captured Set
CN105631457A (en) * 2015-12-17 2016-06-01 小米科技有限责任公司 Method and device for selecting picture
CN105913400A (en) * 2016-05-03 2016-08-31 成都索贝数码科技股份有限公司 Device for obtaining high-quality and real-time beautiful image
CN106570110A (en) * 2016-10-25 2017-04-19 北京小米移动软件有限公司 De-overlapping processing method and apparatus of image
CN107153838A (en) * 2017-04-19 2017-09-12 中国电子科技集团公司电子科学研究院 A kind of photo automatic grading method and device
CN107230192A (en) * 2017-05-31 2017-10-03 广东欧珀移动通信有限公司 Image processing method, device, computer-readable recording medium and mobile terminal

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150071547A1 (en) * 2013-09-09 2015-03-12 Apple Inc. Automated Selection Of Keeper Images From A Burst Photo Captured Set
CN105631457A (en) * 2015-12-17 2016-06-01 小米科技有限责任公司 Method and device for selecting picture
CN105913400A (en) * 2016-05-03 2016-08-31 成都索贝数码科技股份有限公司 Device for obtaining high-quality and real-time beautiful image
CN106570110A (en) * 2016-10-25 2017-04-19 北京小米移动软件有限公司 De-overlapping processing method and apparatus of image
CN107153838A (en) * 2017-04-19 2017-09-12 中国电子科技集团公司电子科学研究院 A kind of photo automatic grading method and device
CN107230192A (en) * 2017-05-31 2017-10-03 广东欧珀移动通信有限公司 Image processing method, device, computer-readable recording medium and mobile terminal

Cited By (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US12314312B2 (en) 2018-09-18 2025-05-27 Google Llc Methods and systems for processing imagery
CN112055847A (en) * 2018-09-18 2020-12-08 谷歌有限责任公司 Method and system for processing image
US11947591B2 (en) 2018-09-18 2024-04-02 Google Llc Methods and systems for processing imagery
CN112055847B (en) * 2018-09-18 2024-03-12 谷歌有限责任公司 Method and system for processing image
CN109409235A (en) * 2018-09-27 2019-03-01 Oppo广东移动通信有限公司 Image recognition method and apparatus, electronic device, computer-readable storage medium
EP3821372A4 (en) * 2018-12-07 2021-09-15 Samsung Electronics Co., Ltd. ELECTRONIC DEVICE, CONTROL METHODS OF AN ELECTRONIC DEVICE, AND COMPUTER-READABLE MEDIUM
WO2020116983A1 (en) 2018-12-07 2020-06-11 Samsung Electronics Co., Ltd. Electronic apparatus, controlling method of electronic apparatus, and computer readable medium
US12142021B2 (en) 2018-12-07 2024-11-12 Samsung Electronics Co., Ltd. Electronic apparatus, controlling method of electronic apparatus, and computer readable medium
CN113168543A (en) * 2018-12-07 2021-07-23 三星电子株式会社 Electronic device, control method of electronic device, and computer-readable medium
US11558545B2 (en) 2018-12-07 2023-01-17 Samsung Electronics Co., Ltd. Electronic apparatus, controlling method of electronic apparatus, and computer readable medium
CN110390263A (en) * 2019-06-17 2019-10-29 宁波江丰智能科技有限公司 A kind of method of video image processing and system
CN112188075B (en) * 2019-07-05 2023-04-18 杭州海康威视数字技术股份有限公司 Snapshot, image processing device and image processing method
CN112188075A (en) * 2019-07-05 2021-01-05 杭州海康威视数字技术股份有限公司 Snapshot, image processing device and image processing method
CN112771612A (en) * 2019-09-06 2021-05-07 华为技术有限公司 Method and device for shooting image
CN110659614A (en) * 2019-09-25 2020-01-07 Oppo广东移动通信有限公司 Video sampling method, apparatus, device and storage medium
CN113259601A (en) * 2020-02-11 2021-08-13 北京字节跳动网络技术有限公司 Video processing method and device, readable medium and electronic equipment
US11996124B2 (en) 2020-02-11 2024-05-28 Beijing Bytedance Network Technology Co., Ltd. Video processing method, apparatus, readable medium and electronic device
CN111935479A (en) * 2020-07-30 2020-11-13 浙江大华技术股份有限公司 Target image determination method and device, computer equipment and storage medium
CN112492297A (en) * 2020-11-17 2021-03-12 腾讯科技(深圳)有限公司 Video processing method and related equipment
CN113365023A (en) * 2021-04-22 2021-09-07 北京房江湖科技有限公司 Holder visual angle correction method and device, electronic equipment and storage medium
CN115802146A (en) * 2021-09-07 2023-03-14 荣耀终端有限公司 Method and electronic device for capturing images in video
CN115802146B (en) * 2021-09-07 2024-04-02 荣耀终端有限公司 Method for capturing images in video and electronic equipment
CN119255094A (en) * 2024-04-17 2025-01-03 荣耀终端有限公司 Shooting processing method and related equipment

Similar Documents

Publication Publication Date Title
CN108198177A (en) Image acquisition method, device, terminal and storage medium
CN108234870B (en) Image processing method, device, terminal and storage medium
CN108875619B (en) Video processing method and apparatus, electronic device, computer-readable storage medium
JP2017531950A (en) Method and apparatus for constructing a shooting template database and providing shooting recommendation information
US11917158B2 (en) Static video recognition
WO2024041108A1 (en) Image correction model training method and apparatus, image correction method and apparatus, and computer device
WO2020207203A1 (en) Prospect data generation and application methods, related apparatus and system
CN108174097A (en) Method and device for taking pictures and providing shooting parameters
CN111985281A (en) Image generation model generation method and device, and image generation method and device
CN110288534A (en) Image processing method, device, electronic device, and storage medium
CN107820018A (en) User photographing method, device and equipment
CN114372990A (en) Image synthesis method, device, device and storage medium for completely removing green screen
CN110266955A (en) Image processing method, device, electronic device, and storage medium
WO2023217138A1 (en) Parameter configuration method and apparatus, device, storage medium and product
CN112489144A (en) Image processing method, image processing apparatus, terminal device, and storage medium
CN115623313A (en) Image processing method, image processing apparatus, electronic device, and storage medium
CN114257730B (en) Image data processing method, device, storage medium and computer equipment
WO2021078276A1 (en) Method for obtaining continuously photographed photos, smart terminal, and storage medium
CN118035493A (en) Image generation method, device, equipment, storage medium and program product
WO2019205566A1 (en) Method and device for displaying image
CN113129252A (en) Image scoring method and electronic equipment
CN110766631A (en) Face image modification method and device, electronic equipment and computer readable medium
CN111724300B (en) Single picture background blurring method, device and equipment
CN114143429B (en) Image shooting method, device, electronic equipment and computer readable storage medium
US20230267620A1 (en) Computing platform using machine learning for foreground mask estimation

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20180622