CN111445439B - Image analysis method, device, electronic equipment and medium - Google Patents
Image analysis method, device, electronic equipment and medium Download PDFInfo
- Publication number
- CN111445439B CN111445439B CN202010121619.3A CN202010121619A CN111445439B CN 111445439 B CN111445439 B CN 111445439B CN 202010121619 A CN202010121619 A CN 202010121619A CN 111445439 B CN111445439 B CN 111445439B
- Authority
- CN
- China
- Prior art keywords
- image
- target image
- analysis result
- feature
- background area
- 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.)
- Active
Links
- 238000003703 image analysis method Methods 0.000 title claims abstract description 21
- 238000004458 analytical method Methods 0.000 claims abstract description 86
- 230000011218 segmentation Effects 0.000 claims abstract description 25
- 238000000034 method Methods 0.000 claims description 26
- 210000000746 body region Anatomy 0.000 claims description 9
- 239000003086 colorant Substances 0.000 claims description 8
- 238000000605 extraction Methods 0.000 claims description 6
- 238000010191 image analysis Methods 0.000 claims description 6
- 238000012216 screening Methods 0.000 claims description 6
- 238000005516 engineering process Methods 0.000 abstract description 10
- 238000011156 evaluation Methods 0.000 abstract description 2
- 238000001514 detection method Methods 0.000 description 11
- 239000000284 extract Substances 0.000 description 10
- 230000002093 peripheral effect Effects 0.000 description 10
- 238000012545 processing Methods 0.000 description 10
- 230000001133 acceleration Effects 0.000 description 9
- 238000012550 audit Methods 0.000 description 8
- 238000004891 communication Methods 0.000 description 8
- 238000013527 convolutional neural network Methods 0.000 description 8
- 238000010586 diagram Methods 0.000 description 8
- 238000013528 artificial neural network Methods 0.000 description 7
- 238000004364 calculation method Methods 0.000 description 7
- 230000006870 function Effects 0.000 description 5
- 230000003287 optical effect Effects 0.000 description 5
- 238000003709 image segmentation Methods 0.000 description 4
- 239000000203 mixture Substances 0.000 description 4
- 101000827703 Homo sapiens Polyphosphoinositide phosphatase Proteins 0.000 description 3
- 102100023591 Polyphosphoinositide phosphatase Human genes 0.000 description 3
- 101100012902 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) FIG2 gene Proteins 0.000 description 3
- 101100233916 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) KAR5 gene Proteins 0.000 description 3
- 230000003796 beauty Effects 0.000 description 3
- 230000004927 fusion Effects 0.000 description 3
- 230000033001 locomotion Effects 0.000 description 3
- 241000282412 Homo Species 0.000 description 2
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 2
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 2
- 238000013473 artificial intelligence Methods 0.000 description 2
- 239000000919 ceramic Substances 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 230000001815 facial effect Effects 0.000 description 2
- 230000005484 gravity Effects 0.000 description 2
- 230000001788 irregular Effects 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000003044 adaptive effect Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 230000008094 contradictory effect Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 238000013135 deep learning Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 230000008451 emotion Effects 0.000 description 1
- 230000014509 gene expression Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 230000005055 memory storage Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 210000000056 organ Anatomy 0.000 description 1
- 230000008447 perception Effects 0.000 description 1
- 230000008569 process Effects 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 230000006641 stabilisation Effects 0.000 description 1
- 238000011105 stabilization Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0004—Industrial image inspection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/11—Region-based segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/194—Segmentation; Edge detection involving foreground-background segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/90—Determination of colour characteristics
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V40/00—Recognition of biometric, human-related or animal-related patterns in image or video data
- G06V40/10—Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
- G06V40/16—Human faces, e.g. facial parts, sketches or expressions
- G06V40/161—Detection; Localisation; Normalisation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V40/00—Recognition of biometric, human-related or animal-related patterns in image or video data
- G06V40/10—Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
- G06V40/16—Human faces, e.g. facial parts, sketches or expressions
- G06V40/168—Feature extraction; Face representation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10024—Color image
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Health & Medical Sciences (AREA)
- Oral & Maxillofacial Surgery (AREA)
- General Health & Medical Sciences (AREA)
- Human Computer Interaction (AREA)
- Multimedia (AREA)
- Quality & Reliability (AREA)
- Image Analysis (AREA)
Abstract
本申请公开了一种图像分析方法、装置、电子设备及介质。本申请中,可以基于至少一个原始图像的人脸识别结果,选择至少一个目标图像,所述目标图像包含人体区域,对所述目标图像进行语义分割,提取所述目标图像中的背景区域,提取所述背景区域对应的第一特征,基于所述第一特征计算所述背景区域的第一分析结果。通过应用本申请的技术方案,可以从多个原始图像选择至少一个包含人体区域的目标图像,对目标图像进行语义分割并提取所述目标图像中的背景区域对应的第一特征,对所述第一特征进行分析得到第一分析结果,从而提高了相关技术中,图像背景评价的准确性和实用性。
The present application discloses an image analysis method, device, electronic device and medium. In the present application, at least one target image can be selected based on the face recognition result of at least one original image, the target image contains a human body area, semantic segmentation is performed on the target image, the background area in the target image is extracted, the first feature corresponding to the background area is extracted, and the first analysis result of the background area is calculated based on the first feature. By applying the technical solution of the present application, at least one target image containing a human body area can be selected from multiple original images, semantic segmentation can be performed on the target image and the first feature corresponding to the background area in the target image can be extracted, and the first feature can be analyzed to obtain a first analysis result, thereby improving the accuracy and practicality of image background evaluation in related technologies.
Description
技术领域Technical Field
本发明涉及图像处理技术,尤其涉及一种图像分析方法、装置、电子设备及介质。The present invention relates to image processing technology, and in particular to an image analysis method, device, electronic equipment and medium.
背景技术Background technique
随着互联网的发展,在线教育受到越来越多人的欢迎,在线教育科研不限时间和地点灵活的学习,便于学习者充分提升自身的技能。相对于传统的使用固定教室更移动便捷化,在画面、音频更具视觉化和更具吸引力。在相关技术中,可能会通过视频图像随机选取加上人工筛选法,或者视频逐帧检测全图法检测在线教室的背景图像,对在线教室的背景图像进行评价和分析。但是发明人发现通过上述技术对在线教室的背景图像进行评价和分析时,存在对背景图像进行评价的不准确性以及较低的实用性的问题。With the development of the Internet, online education has become more and more popular. Online education and scientific research are flexible and can be learned at any time and place, which is convenient for learners to fully improve their skills. Compared with the traditional use of fixed classrooms, it is more mobile and convenient, and the pictures and audio are more visual and attractive. In the related art, the background image of the online classroom may be detected by random selection of video images plus manual screening, or by the full-image detection method of video frame by frame, and the background image of the online classroom may be evaluated and analyzed. However, the inventor found that when the background image of the online classroom is evaluated and analyzed by the above-mentioned technology, there are problems of inaccuracy in the evaluation of the background image and low practicality.
发明内容Summary of the invention
本申请实施例提供一种图像分析方法、装置、电子设备及介质。Embodiments of the present application provide an image analysis method, device, electronic device, and medium.
其中,根据本申请实施例的一个方面,提供的一种图像分析方法,其特征在于,包括:According to one aspect of the embodiments of the present application, an image analysis method is provided, characterized in that it includes:
基于至少一个原始图像的人脸识别结果,选择至少一个目标图像,所述目标图像包含人体区域;Based on the face recognition result of at least one original image, selecting at least one target image, wherein the target image includes a human body area;
对所述目标图像进行语义分割,提取所述目标图像中的背景区域;Performing semantic segmentation on the target image to extract a background area in the target image;
提取所述背景区域对应的第一特征,基于所述第一特征计算所述背景区域的第一分析结果。A first feature corresponding to the background area is extracted, and a first analysis result of the background area is calculated based on the first feature.
可选地,在基于本申请上述方法的另一个实施例中,所述方法还包括:Optionally, in another embodiment based on the above method of the present application, the method further includes:
对所述目标图像中的至少一个物体进行识别,基于识别结果,确定所述物体的第二分析结果;Identify at least one object in the target image, and determine a second analysis result of the object based on the identification result;
基于所述第一分析结果和所述第二分析结果,确定所述目标图像的第三分析结果。Based on the first analysis result and the second analysis result, a third analysis result of the target image is determined.
可选地,在基于本申请上述方法的另一个实施例中,所述对所述目标图像中的至少一个物体进行识别,基于识别结果,确定所述物体的第二分析结果,包括:Optionally, in another embodiment of the method of the present application, the identifying at least one object in the target image and determining a second analysis result of the object based on the identification result includes:
提取所述目标图像中的至少一个物体区域;Extracting at least one object region in the target image;
提取所述物体区域对应的第二特征,基于所述第二特征,确定所述物体的类型信息和/或属性信息;Extracting a second feature corresponding to the object region, and determining type information and/or attribute information of the object based on the second feature;
基于所述类型信息和/或属性信息,确定所述第二分析结果。Based on the type information and/or the attribute information, the second analysis result is determined.
可选地,在基于本申请上述方法的另一个实施例中,所述基于至少一个原始图像的人脸识别结果,选择至少一个目标图像,包括:Optionally, in another embodiment of the method of the present application, the step of selecting at least one target image based on the face recognition result of at least one original image includes:
利用预设的人脸识别模型,检测所述原始图像中是否包含人脸图像;Using a preset face recognition model, detecting whether the original image contains a face image;
当确定所述原始图像中包含人脸图像时,获取所述人脸图像与对应原始图像的大小占比以及所述人脸图像在所述原始图像中的所处位置;When it is determined that the original image contains a face image, obtaining a size ratio of the face image to the corresponding original image and a position of the face image in the original image;
基于所述大小占比以及所处位置,筛选符合预设条件的原始图像作为所述目标图像。Based on the size ratio and the location, the original image that meets the preset conditions is selected as the target image.
可选地,在基于本申请上述方法的另一个实施例中,所述基于所述第一特征计算所述背景区域的第一分析结果,包括:Optionally, in another embodiment of the method of the present application, the calculating a first analysis result of the background area based on the first feature includes:
基于所述第一特征,确定所述背景区域对应的颜色种类以及颜色数量;Based on the first feature, determining the color type and color quantity corresponding to the background area;
基于所述颜色种类以及颜色数量,确定所述第一分析结果。Based on the color type and the color quantity, the first analysis result is determined.
可选地,在基于本申请上述方法的另一个实施例中,所述基于所述第一特征计算所述背景区域的第一分析结果,包括:Optionally, in another embodiment of the method of the present application, the calculating a first analysis result of the background area based on the first feature includes:
计算所述第一特征与所述人体区域对应的第三特征的匹配度;Calculating a matching degree between the first feature and a third feature corresponding to the human body region;
基于所述匹配度,确定所述第一分析结果。Based on the matching degree, the first analysis result is determined.
根据本申请实施例的另一个方面,提供的一种选择图像的装置,包括:According to another aspect of an embodiment of the present application, a device for selecting an image is provided, comprising:
选择模块,用于基于至少一个原始图像的人脸识别结果,选择至少一个目标图像,所述目标图像包含人体区域;A selection module, configured to select at least one target image based on a face recognition result of at least one original image, wherein the target image includes a human body region;
提取模块,用于对所述目标图像进行语义分割,提取所述目标图像中的背景区域;An extraction module, used to perform semantic segmentation on the target image and extract a background area in the target image;
计算模块,用于提取所述背景区域对应的第一特征,基于所述第一特征计算所述背景区域的第一分析结果。The calculation module is used to extract a first feature corresponding to the background area, and calculate a first analysis result of the background area based on the first feature.
根据本申请实施例的又一个方面,提供的一种电子设备,包括:According to another aspect of the embodiments of the present application, an electronic device is provided, including:
存储器,用于存储可执行指令;以及A memory for storing executable instructions; and
显示器,用于与所述存储器显示以执行所述可执行指令从而完成上述任一所述图像分析方法的操作。A display is used to display with the memory to execute the executable instructions to complete the operation of any of the above-mentioned image analysis methods.
根据本申请实施例的还一个方面,提供的一种计算机可读存储介质,用于存储计算机可读取的指令,所述指令被执行时执行上述任一所述图像分析方法的操作。According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided for storing computer-readable instructions, wherein the instructions, when executed, perform operations of any of the above-mentioned image analysis methods.
本申请实施例提供的技术方案带来的有益效果至少包括:The beneficial effects brought by the technical solution provided by the embodiment of the present application include at least:
本申请实施例的方案在执行时,对原始图像进行人脸识别,基于至少一个原始图像的人脸识别结果,选择至少一个目标图像,该目标图像中包含人体区域,对该目标图像进行语义分割,即分离该目标图像的前景区域与背景区域,提取该目标图像中的背景区域,再提取该背景区域对应的第一特征,基于该第一特征计算该背景区域对应的第一分析结果。通过本申请,可以从多个原始图像中选择至少一个目标图像,从目标图像中提取背景区域,再对背景区域对应的第一特征进行计算,得到第一分析结果,提高了相关技术中,对图像背景进行评价的准确性和实用性。When the scheme of the embodiment of the present application is executed, face recognition is performed on the original image, and based on the face recognition result of at least one original image, at least one target image is selected, the target image contains a human body area, and semantic segmentation is performed on the target image, that is, the foreground area and the background area of the target image are separated, the background area in the target image is extracted, and then the first feature corresponding to the background area is extracted, and the first analysis result corresponding to the background area is calculated based on the first feature. Through the present application, at least one target image can be selected from multiple original images, the background area can be extracted from the target image, and then the first feature corresponding to the background area can be calculated to obtain the first analysis result, thereby improving the accuracy and practicality of evaluating the image background in the related art.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.
图1为本申请图像分析方法的系统架构示意图;FIG1 is a schematic diagram of the system architecture of the image analysis method of the present application;
图2为本申请提出的一种图像分析方法的流程示意图;FIG2 is a schematic diagram of a flow chart of an image analysis method proposed in this application;
图3为本申请提出的一种图像分析方法的流程示意图;FIG3 is a schematic diagram of a flow chart of an image analysis method proposed in this application;
图4为本申请提出的一种图像分析方法的流程示意图;FIG4 is a schematic diagram of a flow chart of an image analysis method proposed in this application;
图5为本申请图像分析装置的结构示意图;FIG5 is a schematic diagram of the structure of the image analysis device of the present application;
图6为本申请显示电子设备结构示意图。FIG. 6 is a schematic diagram showing the structure of an electronic device according to the present application.
具体实施方式Detailed ways
现在将参照附图来详细描述本申请的各种示例性实施例。应注意到:除非另外具体说明,否则在这些实施例中阐述的部件和步骤的相对布置、数字表达式和数值不限制本申请的范围。Various exemplary embodiments of the present application will now be described in detail with reference to the accompanying drawings. It should be noted that unless otherwise specifically stated, the relative arrangement of components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present application.
同时,应当明白,为了便于描述,附图中所示出的各个部分的尺寸并不是按照实际的大小比例关系绘制的。At the same time, it should be understood that for the convenience of description, the sizes of the various parts shown in the drawings are not drawn according to the actual size ratio.
以下对至少一个示例性实施例的描述实际上仅仅是说明性的,不作为对本申请及其应用或使用的任何限制。The following description of at least one exemplary embodiment is merely illustrative in nature and is not intended to limit the present application, its application, or uses.
对于相关领域普通技术人员已知的技术、方法和设备可能不作详细讨论,但在适当情况下,所述技术、方法和设备应当被视为说明书的一部分。Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered as part of the specification.
应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步讨论。It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
另外,本申请各个实施例之间的技术方案可以相互结合,但是必须是以本领域普通技术人员能够实现为基础,当技术方案的结合出现相互矛盾或无法实现时应当认为这种技术方案的结合不存在,也不在本申请要求的保护范围之内。In addition, the technical solutions between the various embodiments of the present application can be combined with each other, but it must be based on the fact that ordinary technicians in the field can implement it. When the combination of technical solutions is mutually contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.
需要说明的是,本申请实施例中所有方向性指示(诸如上、下、左、右、前、后……)仅用于解释在某一特定姿态(如附图所示)下各部件之间的相对位置关系、运动情况等,如果该特定姿态发生改变时,则该方向性指示也相应地随之改变。It should be noted that all directional indications in the embodiments of the present application (such as up, down, left, right, front, back, etc.) are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.
下面结合图1-图3来描述根据本申请示例性实施方式的用于进行图像分析方法。需要注意的是,下述应用场景仅是为了便于理解本申请的精神和原理而示出,本申请的实施方式在此方面不受任何限制。相反,本申请的实施方式可以应用于适用的任何场景。The following describes the image analysis method according to the exemplary embodiment of the present application in conjunction with Figures 1 to 3. It should be noted that the following application scenarios are only shown to facilitate understanding of the spirit and principles of the present application, and the embodiments of the present application are not limited in this regard. On the contrary, the embodiments of the present application can be applied to any applicable scenario.
图1示出了可以应用本申请实施例的图像分析方法或图像分析装置的示例性系统架构100的示意图。FIG. 1 is a schematic diagram showing an exemplary system architecture 100 to which an image analysis method or an image analysis device according to an embodiment of the present application can be applied.
如图1所示,系统架构100可以包括终端设备101、102、103中的一种或多种,网络104和服务器105。网络104用以在终端设备101、102、103和服务器105之间提供通信链路的介质。网络104可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。As shown in Fig. 1, the system architecture 100 may include one or more of terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.
应该理解,图1中的终端设备、网络和服务器的数目仅仅是示意性的。根据实现需要,可以具有任意数目的终端设备、网络和服务器。比如服务器105可以是多个服务器组成的服务器集群等。It should be understood that the number of terminal devices, networks and servers in FIG1 is only illustrative. According to implementation requirements, there may be any number of terminal devices, networks and servers. For example, the server 105 may be a server cluster composed of multiple servers.
用户可以使用终端设备101、102、103通过网络104与服务器105交互,以接收或发送消息等。终端设备101、102、103可以是具有显示屏的各种电子设备,包括但不限于智能手机、平板电脑、便携式计算机和台式计算机等等。Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Terminal devices 101, 102, 103 can be various electronic devices with display screens, including but not limited to smart phones, tablet computers, portable computers, desktop computers, etc.
本申请中的终端设备101、102、103可以为提供各种服务的终端设备。例如用户通过终端设备103(也可以是终端设备101或102)基于至少一个原始图像的人脸识别结果,选择至少一个目标图像,所述目标图像包含人体区域;对所述目标图像进行语义分割,提取所述目标图像中的背景区域;提取所述背景区域对应的第一特征,基于所述第一特征计算所述背景区域的第一分析结果。The terminal devices 101, 102, and 103 in the present application may be terminal devices that provide various services. For example, a user selects at least one target image based on the face recognition result of at least one original image through the terminal device 103 (which may also be the terminal device 101 or 102), and the target image includes a human body region; performs semantic segmentation on the target image, extracts the background region in the target image; extracts the first feature corresponding to the background region, and calculates the first analysis result of the background region based on the first feature.
在此需要说明的是,本申请实施例所提供的图像分析方法可以由终端设备101、102、103中的一个或多个,和/或,服务器105执行,相应地,本申请实施例所提供的图像分析装置一般设置于对应终端设备中,和/或,服务器105中,但本申请不限于此。It should be noted here that the image analysis method provided in the embodiment of the present application can be executed by one or more of the terminal devices 101, 102, 103, and/or the server 105. Accordingly, the image analysis device provided in the embodiment of the present application is generally arranged in the corresponding terminal device, and/or the server 105, but the present application is not limited to this.
本申请还提出一种图像分析方法、装置、目标终端及介质。The present application also proposes an image analysis method, device, target terminal and medium.
图2示意性地示出了根据本申请实施方式的一种图像分析方法的流程示意图。如图2所示,该方法包括:FIG2 schematically shows a flow chart of an image analysis method according to an embodiment of the present application. As shown in FIG2 , the method includes:
S201,基于至少一个原始图像的人脸识别结果,选择至少一个目标图像,所述目标图像包含人体区域。S201, selecting at least one target image based on a face recognition result of at least one original image, wherein the target image includes a human body region.
需要说明的是,本申请中不对获取原始图像的设备做具体限定,例如可以为智能设备,也可以为服务器。其中,智能设备可以是PC(Personal Computer,个人电脑),也可以是智能手机、平板电脑、电子书阅读器、MP3(Moving Picture Experts Group AudioLayerIII,动态影像专家压缩标准音频层面3)选择图像的器、MP4(Moving PictureExpertsGroup Audio Layer IV,动态影像专家压缩标准音频层面4)选择图像的器、便携计算机等具有显示功能的可移动式终端设备等等。It should be noted that the present application does not specifically limit the device for acquiring the original image, for example, it can be a smart device or a server. The smart device can be a PC (Personal Computer), a smart phone, a tablet computer, an e-book reader, an MP3 (Moving Picture Experts Group Audio Layer III) image selection device, an MP4 (Moving Picture Experts Group Audio Layer IV) image selection device, a portable computer and other mobile terminal devices with display functions, etc.
可选的,本申请中不对原始图像做具体限定,即本申请中的原始图像可以为任意的图像信息。在一种优选的实施方式中,原始图像可以是包含人体区域的图像等等。Optionally, the original image is not specifically limited in the present application, that is, the original image in the present application can be any image information. In a preferred embodiment, the original image can be an image containing a human body region, etc.
还有,本申请还不对原始图像的数量做具体限定,例如可以为一张,也可以为十张。In addition, the present application does not specifically limit the number of original images, for example, it can be one or ten.
进一步的,本申请在获取原始图像之后,为了保证最终选取的目标图像的图像质量符合要求,本申请可以首先针对每个原始图像检测其对应的清晰度参数以及亮度参数。Furthermore, after acquiring the original image, in order to ensure that the image quality of the target image finally selected meets the requirements, the present application may first detect the corresponding clarity parameters and brightness parameters for each original image.
可以理解的,本申请可以基于每张图像对应的像素邻域参数,来计算其清晰度值。其中,本申请中的像素邻域参数可以为反映图像的像素邻域差值的参数。以理解的,一个图像对应的像素邻域差值越高,其反映出来的清晰度越高。因此,本申请可以基于像素邻域参数生成对应的阈值,以清除图像清晰度低于预设阈值的原始图像,进而将剩余的符合清晰度标准的原始图像作为确定目标图像的候选图像。It is understandable that the present application can calculate the clarity value of each image based on the pixel neighborhood parameters corresponding to each image. Among them, the pixel neighborhood parameters in the present application can be parameters that reflect the pixel neighborhood difference of the image. It is understandable that the higher the pixel neighborhood difference corresponding to an image, the higher the clarity it reflects. Therefore, the present application can generate corresponding thresholds based on the pixel neighborhood parameters to remove original images whose image clarity is lower than the preset threshold, and then use the remaining original images that meet the clarity standard as candidate images for determining the target image.
另外,本申请为了保证从原始图像中选取的目标图像的清晰度,本申请可以检测每一个待选择图像的亮度参数,进而通过该亮度参数,确定每个原始图像的图像亮度。In addition, in order to ensure the clarity of the target image selected from the original image, the present application can detect the brightness parameter of each image to be selected, and then determine the image brightness of each original image through the brightness parameter.
其中,图像亮度是指画面的明亮程度,单位是堪德拉每平米(cd/m2)。图像亮度是从白色表面到黑色表面的感觉连续体,由反射系数决定。另外,亮度指照射在景物或图像上光线的明暗程度。图像亮度增加时,就会显得耀眼或刺眼,亮度越小时,图像就会显得灰暗。Image brightness refers to the brightness of the image, and the unit is candela per square meter (cd/m2). Image brightness is a continuum of perception from white surface to black surface, which is determined by the reflectance coefficient. In addition, brightness refers to the degree of brightness of the light shining on the scene or image. When the image brightness increases, it will appear dazzling or glaring, and when the brightness is smaller, the image will appear gray.
进一步的,在对原始图像进行上述处理之后,得到待处理原始图像,利用人脸识别技术识别待处理原始图像,根据人脸识别技术的识别结果,在待处理原始图像中选择至少一个目标图像,该目标图像包含人体区域。Furthermore, after the above processing is performed on the original image, an original image to be processed is obtained, and the original image to be processed is identified using face recognition technology. According to the recognition result of the face recognition technology, at least one target image is selected from the original image to be processed, and the target image contains a human body area.
S202,对目标图像进行语义分割,提取目标图像中的背景区域。S202, performing semantic segmentation on the target image to extract the background area in the target image.
其中,语义分割是指将图像中的所有像素点都划分出对应的类别,实现像素级别的分类。至于提取目标图像的背景区域,可以利用人物图像分割技术来实现。其中,人物图像分割是指将人物照片的前景与背景分离,目标是将输入的图片的每个像素进行分类:前景和背景,在像素级别上获取到分类图。具体而言,提取背景区域可以依据图像分割算法,比如阈值分割算法、基于边缘的分割算法、区域扩张算法、分水岭算法等等,这些算法仅在图像比较简单的情况下适用,对于色彩复杂的图像很难取得理想的分割结果。更进一步的,对于FCN及其衍生方法如SegNet和DeepLab来说,上述技术旨在实现通用的图像语义分割,以实现高精度的人物图像分割。Among them, semantic segmentation refers to dividing all pixels in the image into corresponding categories to achieve pixel-level classification. As for extracting the background area of the target image, it can be achieved using character image segmentation technology. Among them, character image segmentation refers to separating the foreground and background of character photos. The goal is to classify each pixel of the input image into foreground and background, and obtain a classification map at the pixel level. Specifically, the extraction of the background area can be based on image segmentation algorithms, such as threshold segmentation algorithms, edge-based segmentation algorithms, region expansion algorithms, watershed algorithms, etc. These algorithms are only applicable when the image is relatively simple, and it is difficult to obtain ideal segmentation results for images with complex colors. Furthermore, for FCN and its derivative methods such as SegNet and DeepLab, the above technology aims to achieve general image semantic segmentation to achieve high-precision character image segmentation.
更进一步的,本申请可以利用预设分割条件对原始图像进行分割,再根据图像像素的灰度值及个数对分割阈值进行调整,从而确定目标图像中的背景区域,进而实现背景区域的自动提取。Furthermore, the present application can segment the original image using preset segmentation conditions, and then adjust the segmentation threshold according to the grayscale value and number of image pixels, so as to determine the background area in the target image, thereby realizing automatic extraction of the background area.
S203,提取背景区域对应的第一特征,基于所述第一特征计算背景区域的第一分析结果。S203: extract a first feature corresponding to the background area, and calculate a first analysis result of the background area based on the first feature.
其中,第一特征包括色彩参数、清晰度参数等图像参数。第一分析结果用于判断背景区域对应的原始图像是否满足目标图像。The first feature includes image parameters such as color parameters, clarity parameters, etc. The first analysis result is used to determine whether the original image corresponding to the background area meets the target image.
以在线教育行业为例,老师和学生的初次交互往往从一方用户的头像照片开始。例如一张标准清晰的教师照片往往能够吸引很多学生约课,但是现阶段教师上传照片往往存在很多问题。包括图像质量,图像布局,图像背景等等。更进一步的,以图像质量来说,往往存在照片过小,分辨率不够,照片形状不规则的问题;而对于图像布局方面,可能会存在人脸过大、过小,照片人物不居中,非正脸等问题。再针对图像背景来说,会存在背景过于简单,图片背景过于混乱,人物怀抱宠物等问题。另外,对于图像中的人物情绪方面,也会存在人物情绪过于严肃等问题。Taking the online education industry as an example, the first interaction between teachers and students often starts with the profile photo of one user. For example, a standard and clear teacher photo can often attract many students to make appointments for classes, but at this stage, there are often many problems with teachers uploading photos. Including image quality, image layout, image background, and so on. Furthermore, in terms of image quality, there are often problems with photos being too small, insufficient resolution, and irregular photo shapes; and in terms of image layout, there may be problems such as faces being too large or too small, the characters in the photos not being centered, and not being in the front face. As for the image background, there may be problems such as the background being too simple, the background of the picture being too messy, and the characters holding pets. In addition, in terms of the emotions of the characters in the image, there may also be problems such as the characters being too serious.
更进一步的,现阶段已有的审核方案机器简单审核、人工审核和简单审核与人工审核结合的三种方案,各自有其缺点。例如对于机器简单审核来说,利用简单的图像识别维度,如图片大小,分辨率,清晰度等指标,对图片进行初步筛选。而人工审核是指利用人工对图片进行判别和打分。机器和人工审核结合是指利用机器给出大概的评分,对于机器给出的分数比较异常的图片的维度检测由人工进行复核。Furthermore, the existing audit solutions at this stage, namely simple machine audit, manual audit and combination of simple audit and manual audit, each have their own shortcomings. For example, for simple machine audit, simple image recognition dimensions such as image size, resolution, clarity and other indicators are used to conduct preliminary screening of images. Manual audit refers to the use of manual judgment and scoring of images. The combination of machine and manual audit means that the machine gives an approximate score, and the dimension detection of images with abnormal scores given by the machine is manually reviewed.
另外,对于在线教育领域而言,在教师开展教学活动的时候,布置一个温馨舒适的教学环境是必不可少的,但是检测和评价教室的布置是否恰当舒适,是一个难以量化的指标,也是一个难题。因此,如何从众多原始图像中,综合的选出背景人物俱佳的图像。成为了本领域技术人员需要解决的问题。In addition, for the field of online education, it is essential to create a warm and comfortable teaching environment when teachers carry out teaching activities. However, it is difficult to quantify and evaluate whether the layout of the classroom is appropriate and comfortable. Therefore, how to comprehensively select images with good background and characters from a large number of original images has become a problem that technicians in this field need to solve.
需要说明的是,在获取到原始图像对应的背景区域后,即可以基于各个背景区域的第一特征,比如色彩参数以及清晰度参数,计算背景区域的第一分析结果。It should be noted that after the background area corresponding to the original image is acquired, the first analysis result of the background area can be calculated based on the first features of each background area, such as color parameters and clarity parameters.
本申请实施例的方案在执行时,对原始图像进行人脸识别,基于至少一个原始图像的人脸识别结果,选择至少一个目标图像,该目标图像中包含人体区域,对该目标图像进行语义分割,即分离该目标图像的前景区域与背景区域,提取该目标图像中的背景区域,再提取该背景区域对应的第一特征,基于该第一特征计算该背景区域对应的第一分析结果。通过本申请,可以从多个原始图像中选择至少一个目标图像,从目标图像中提取背景区域,再对背景区域对应的第一特征进行计算,得到第一分析结果,提高了相关技术中,对图像背景进行评价的准确性和实用性。When the scheme of the embodiment of the present application is executed, face recognition is performed on the original image, and based on the face recognition result of at least one original image, at least one target image is selected, the target image contains a human body area, and semantic segmentation is performed on the target image, that is, the foreground area and the background area of the target image are separated, the background area in the target image is extracted, and then the first feature corresponding to the background area is extracted, and the first analysis result corresponding to the background area is calculated based on the first feature. Through the present application, at least one target image can be selected from multiple original images, the background area can be extracted from the target image, and then the first feature corresponding to the background area can be calculated to obtain the first analysis result, thereby improving the accuracy and practicality of evaluating the image background in the related art.
图3示意性地示出了根据本申请实施方式的一种图像分析方法的流程示意图。如图3所示,该方法包括:FIG3 schematically shows a flow chart of an image analysis method according to an embodiment of the present application. As shown in FIG3 , the method includes:
S301,利用预设的人脸识别模型,检测原始图像中是否包含人脸图像。S301, using a preset face recognition model, detecting whether the original image contains a face image.
S302,当确定原始图像中包含人脸图像时,获取人脸图像与对应原始图像的大小占比以及人脸图像在原始图像中的所处位置。S302: When it is determined that the original image contains a face image, the size ratio of the face image to the corresponding original image and the position of the face image in the original image are obtained.
可以理解的,本申请可以进一步的限定原始图像中,是否包含有用户的人脸图像。例如以头像图片来说,本申请即可以限定将每个原始图像中,人脸图像数量不为一个的原始图像进行清除。It is understandable that the present application can further limit whether the original image contains a user's face image. For example, taking a headshot image as an example, the present application can limit the removal of original images in which the number of face images is not one.
S303,基于大小占比以及所处位置,筛选符合预设条件的原始图像作为目标图像。S303: Based on the size ratio and the location, select the original image that meets the preset conditions as the target image.
进一步的,为了确定原始图像是否为符合预设条件的原始图像,本申请可以根据各个原始图像中,各个原始图像对应的人脸图像与对应原始图像的大小比例,以及该人脸图像在原始图像中的所处位置,来从中确定目标图像。Furthermore, in order to determine whether the original image is an original image that meets preset conditions, the present application can determine the target image based on the size ratio of the facial image corresponding to each original image and the corresponding original image, as well as the position of the facial image in the original image.
可以理解的,对于用户的图像来说,其选择的标准可以为从其是否在拍摄图像的时候清晰的显露脸部,以及该脸部位置是否位于图像的中心区域来确定。因此,本申请可以进一步的获取用户对应的人脸图像,并针对该人脸图像的大小,来确定对应的图像是否符合要求。It is understandable that for the user's image, the selection criteria can be determined by whether the face is clearly revealed when the image is taken, and whether the face is located in the center of the image. Therefore, the present application can further obtain the user's corresponding face image, and determine whether the corresponding image meets the requirements based on the size of the face image.
其中,本申请可以根据大小比例是否在预设的标准区间内来确定各个原始图像是否为目标图像。需要说明的是,本申请不对该标准区间做具体限定,例如可以为70%-80%的区间,也可以为75%-85%的区间等等。The present application can determine whether each original image is a target image based on whether the size ratio is within a preset standard interval. It should be noted that the present application does not specifically limit the standard interval, for example, it can be a 70%-80% interval, or a 75%-85% interval, etc.
S304,对目标图像进行语义分割,提取目标图像中的背景区域。S304, performing semantic segmentation on the target image to extract the background area in the target image.
具体可参见图2中的S202,在此不再赘述。For details, please refer to S202 in FIG. 2 , which will not be described in detail here.
S305,提取背景区域对应的第一特征,基于第一特征,确定背景区域对应的颜色种类以及颜色数量。S305, extracting a first feature corresponding to the background area, and determining the color type and color quantity corresponding to the background area based on the first feature.
S306,基于颜色种类以及颜色数量,确定第一分析结果。S306: Determine a first analysis result based on the color type and the color quantity.
其中,第一特征为第一色彩参数,根据第一色彩参数,确定每个背景区域对应的颜色种类以及颜色数量。进一步的,对于一个包含有人脸图像的原始图像来说,背景区域中过多的颜色组成,过于明亮或过于黯淡的颜色组成均会影响图像的美观。因此,本申请可以基于每个背景区域对应的颜色种类以及颜色数量,确定第一分析结果,即该背景区域是否满足目标图像的背景区域的条件。Among them, the first feature is the first color parameter, and the color type and color quantity corresponding to each background area are determined according to the first color parameter. Furthermore, for an original image containing a face image, too many color compositions in the background area, too bright or too dim color compositions will affect the beauty of the image. Therefore, the present application can determine the first analysis result based on the color type and color quantity corresponding to each background area, that is, whether the background area meets the conditions of the background area of the target image.
进一步的,本申请可以在当检测到背景区域中包括的颜色种类以及数量信息时,检测该背景中包含的颜色数量是否超过预定数量,颜色种类中是否包含预定颜色种类的情况。并根据检测结果,确定第一分析结果,即该背景区域对应的原始图像是否符合目标图像的标准。Furthermore, when the color types and quantity information included in the background area is detected, the present application can detect whether the number of colors included in the background exceeds a predetermined number and whether the color types include a predetermined color type. And according to the detection result, determine the first analysis result, that is, whether the original image corresponding to the background area meets the standard of the target image.
需要说明的是,本申请不对背景区域中的颜色种类以及颜色数量做具体限定,例如可以为在检测到背景区域中包含白色,黑色的颜色种类后,判定第一分析结果为其对应的背景区域不符合目标图像的背景区域。也可以为在检测到背景区域的颜色数量超过3种颜色后,判定判定第一分析结果为其背景区域对应的原始图像不符合目标图像的标准。It should be noted that the present application does not specifically limit the types and number of colors in the background area. For example, after detecting that the background area contains white and black colors, it can be determined that the first analysis result is that the corresponding background area does not meet the background area of the target image. It can also be determined that after detecting that the number of colors in the background area exceeds 3 colors, it is determined that the first analysis result is that the original image corresponding to the background area does not meet the standard of the target image.
S307,提取目标图像中的至少一个物体区域。S307: extract at least one object region in the target image.
S308,提取物体区域对应的第二特征,基于第二特征,确定物体的类型信息和/或属性信息。S308, extracting a second feature corresponding to the object region, and determining type information and/or attribute information of the object based on the second feature.
S309,基于类型信息和/或属性信息,确定第二分析结果。S309: Determine a second analysis result based on the type information and/or the attribute information.
S310,基于第一分析结果和第二分析结果,确定目标图像的第三分析结果。S310: Determine a third analysis result of the target image based on the first analysis result and the second analysis result.
其中,第二特征为物体参数,基于预设的神经网络图像检测模型,提取每个背景区域中,物体区域对应的物体参数,基于物体参数,确定物体的类型信息和/或属性信息。Among them, the second feature is the object parameter. Based on the preset neural network image detection model, the object parameters corresponding to the object area in each background area are extracted, and based on the object parameters, the type information and/or attribute information of the object is determined.
在一种可能实施的方式中,基于物体参数,确定每个物体的类型信息,基于每个物体的类型信息,确定第二分析结果。In a possible implementation, type information of each object is determined based on the object parameters, and a second analysis result is determined based on the type information of each object.
进一步的,本申请可以基于预设的神经网络图像检测模型,提取物体区域对应的物体特征参数,并从中确定是否包含有物体。可以理解的,在确定包含有物体区域之后,再通过该物体的类型信息,确定第二分析结果,即该物体区域对应的原始图像是否符合目标图像。Furthermore, the present application can extract object feature parameters corresponding to the object region based on a preset neural network image detection model, and determine whether the object is contained therein. It is understandable that after determining that the object region is contained, the second analysis result, that is, whether the original image corresponding to the object region is consistent with the target image, is determined based on the type information of the object.
更进一步的,本申请中的神经网络图像检测模型可以为卷积神经网络。其中,卷积神经网络(Convolutional Neural Networks,CNN)是一类包含卷积计算且具有深度结构的前馈神经网络(Feedforward Neural Networks),是深度学习的代表算法之一。卷积神经网络具有表征学习(representation learning)能力,能够按其阶层结构对输入信息进行平移不变分类。得益于CNN(卷积神经网络)对图像的强大特征表征能力,其在图像分类、目标检测、语义分割等领域都取得了令人瞩目的效果。Furthermore, the neural network image detection model in the present application can be a convolutional neural network. Among them, convolutional neural networks (CNN) are a type of feedforward neural networks (Feedforward Neural Networks) that include convolution calculations and have a deep structure, and are one of the representative algorithms for deep learning. Convolutional neural networks have representation learning capabilities and can perform translation-invariant classification of input information according to their hierarchical structure. Thanks to the powerful feature representation capabilities of CNN (convolutional neural network) for images, it has achieved remarkable results in image classification, target detection, semantic segmentation and other fields.
需要说明的是,本申请在利用神经网络图像检测模型提取物体区域对应的物体特征参数之前,还可以首先基于级联区域建议网络、区域回归网络以及关键点回归网络结构,采用深度卷积神经网络定义器官检测网络架构。所采用的深度卷积神经网络中,所述区域建议网络输入为16*16*3图像数据,网络由全卷积架构构成,输出为物体区域建议框的置信度以及粗略顶点位置;所述区域回归网络输入为32*32*3图像数据,网络由卷积和全连接架构构成,输出为背景区域的置信度以及精确顶点位置;所述关键点回归网络输入为64*64*3图像数据,网络由卷积和全连接架构构成,输出为物体形状信息的置信度、位置。It should be noted that before using the neural network image detection model to extract the object feature parameters corresponding to the object area, the present application can also first define the organ detection network architecture based on the cascaded region proposal network, region regression network and key point regression network structure using a deep convolutional neural network. In the deep convolutional neural network used, the region proposal network input is 16*16*3 image data, the network is composed of a full convolution architecture, and the output is the confidence of the object region proposal box and the rough vertex position; the region regression network input is 32*32*3 image data, the network is composed of a convolution and a fully connected architecture, and the output is the confidence of the background area and the precise vertex position; the key point regression network input is 64*64*3 image data, the network is composed of a convolution and a fully connected architecture, and the output is the confidence and position of the object shape information.
需要说明的是,本申请中不对基于每个物体图像的类型信息,确定第二分析结果的方式做具体限定。例如本申请可以将各个物体对应分为教学类物体以及非教学类物体。可以理解的,对于教学类物体来说,可以包括书本,黑板,桌椅,电脑等等。而对于非教学类物体来说,可以包括碗筷,游戏机,水杯等等。It should be noted that the present application does not specifically limit the method for determining the second analysis result based on the type information of each object image. For example, the present application can classify each object into teaching objects and non-teaching objects. It is understandable that teaching objects may include books, blackboards, tables and chairs, computers, etc. Non-teaching objects may include bowls and chopsticks, game consoles, water cups, etc.
进一步的,本申请可以在当检测到物体区域中包括教学类物体时,确定第二分析结果为其对应的背景区域符合目标图像的背景区域。而当检测到物体区域中中包括非教学类物体时,确定第二分析结果为该物体区域对应的原始图像不符合目标图像的标准。Furthermore, the present application can determine that the second analysis result is that the background area corresponding to the object region meets the background area of the target image when the object region is detected to include a teaching object. And when the object region is detected to include a non-teaching object, the second analysis result is determined that the original image corresponding to the object region does not meet the standard of the target image.
在一种可能的实施方式中,基于物体参数,确定每个物体的属性信息,属性信息包括颜色信息、数量信息以及大小信息的至少一种,基于每个物体的类型信息以及属性信息,确定第二分析结果,即该物体区域对应的原始图像是否符合目标图像的标准。In one possible implementation, attribute information of each object is determined based on object parameters, the attribute information including at least one of color information, quantity information, and size information; based on the type information and attribute information of each object, a second analysis result is determined, i.e., whether the original image corresponding to the object area meets the standards of the target image.
进一步的,本申请可以基于预设的神经网络图像检测模型,提取每个物体区域的物体特征参数,并从中确定是否包含有物体。可以理解的,在确定包含有物体之后,再通过该物体的属性信息,确定第二分析结果,即该物体区域对应的原始图像符合目标图像的标准。Furthermore, the present application can extract object feature parameters of each object region based on a preset neural network image detection model, and determine whether an object is contained therein. It is understandable that after determining that an object is contained, the second analysis result is determined through the attribute information of the object, that is, the original image corresponding to the object region meets the standard of the target image.
需要说明的是,本申请中不对基于每个物体的属性信息,确定第二分析结果的方式做具体限定。其中,该属性信息可以为反映物体颜色,数量,大小的信息。可以理解的,对于一个包含有人体区域的原始图像来说,背景区域中过多的颜色组成,过多的物体摆放,或者存在过大的物体均会影响图像的美观。因此,本申请可以基于该三个参数,综合确定第二分析结果,即该物体区域对应的原始图像符合目标图像的标准。It should be noted that the present application does not specifically limit the method of determining the second analysis result based on the attribute information of each object. Among them, the attribute information can be information reflecting the color, quantity, and size of the object. It is understandable that for an original image containing a human body area, too many color compositions in the background area, too many objects placed, or the presence of overly large objects will affect the beauty of the image. Therefore, the present application can comprehensively determine the second analysis result based on the three parameters, that is, the original image corresponding to the object area meets the standards of the target image.
进一步的,本申请可以在当检测到物体区域中包括颜色信息、数量信息以及大小信息的至少一种时,检测该物体的颜色组成是否超过第一数量,物体的数量是否超过第二数量,以及其大小是否超过对应背景图像的预设比例。如满足对应的条件,则确定第二分析结果,即该物体区域对应的原始图像符合目标图像的标准。Furthermore, the present application can detect whether the color composition of the object exceeds a first quantity, whether the number of objects exceeds a second quantity, and whether the size exceeds a preset ratio of the corresponding background image when the object region includes at least one of color information, quantity information, and size information. If the corresponding conditions are met, a second analysis result is determined, that is, the original image corresponding to the object region meets the standard of the target image.
进一步的,基于第一分析结果和第二分析结果,即根据原始图像的背景区域和物体区域,得到第三分析结果,即判断原始图像是否符合目标图像的标准。Furthermore, based on the first analysis result and the second analysis result, that is, according to the background area and the object area of the original image, a third analysis result is obtained, that is, it is determined whether the original image meets the standard of the target image.
本申请实施例的方案在执行时,对原始图像进行人脸识别,基于至少一个原始图像的人脸识别结果,选择至少一个目标图像,该目标图像中包含人体区域,对该目标图像进行语义分割,即分离该目标图像的前景区域与背景区域,提取该目标图像中的背景区域,再提取该背景区域对应的第一特征,基于该第一特征计算该背景区域对应的第一分析结果。通过本申请,可以从多个原始图像中选择至少一个目标图像,从目标图像中提取背景区域,再对背景区域对应的第一特征进行计算,得到第一分析结果,提高了相关技术中,对图像背景进行评价的准确性和实用性。When the scheme of the embodiment of the present application is executed, face recognition is performed on the original image, and based on the face recognition result of at least one original image, at least one target image is selected, the target image contains a human body area, and semantic segmentation is performed on the target image, that is, the foreground area and the background area of the target image are separated, the background area in the target image is extracted, and then the first feature corresponding to the background area is extracted, and the first analysis result corresponding to the background area is calculated based on the first feature. Through the present application, at least one target image can be selected from multiple original images, the background area can be extracted from the target image, and then the first feature corresponding to the background area can be calculated to obtain the first analysis result, thereby improving the accuracy and practicality of evaluating the image background in the related art.
图4示意性地示出了根据本申请实施方式的一种图像分析方法的流程示意图。如图4所示,该方法包括:FIG4 schematically shows a flow chart of an image analysis method according to an embodiment of the present application. As shown in FIG4 , the method includes:
S401,利用预设的人脸识别模型,检测原始图像中是否包含人脸图像。S401, using a preset face recognition model, detecting whether the original image contains a face image.
S402,当确定原始图像中包含人脸图像时,获取人脸图像与对应原始图像的大小占比以及人脸图像在原始图像中的所处位置。S402, when it is determined that the original image contains a face image, obtain the size ratio of the face image to the corresponding original image and the position of the face image in the original image.
S403,基于大小占比以及所处位置,筛选符合预设条件的原始图像作为目标图像。S403, based on the size ratio and the location, filter the original image that meets the preset conditions as the target image.
S404,对目标图像进行语义分割,提取目标图像中的背景区域。S404, performing semantic segmentation on the target image to extract the background area in the target image.
一般的,S401至S404可参照图3中的301至S304,在此不再赘述。Generally, S401 to S404 may refer to 301 to S304 in FIG. 3 , and will not be described in detail here.
S405,提取背景区域对应的第一特征,计算所述第一特征与所述人体区域对应的第三特征的匹配度。S405: extract a first feature corresponding to the background area, and calculate a matching degree between the first feature and a third feature corresponding to the human body area.
S406,基于所述匹配度,确定所述第一分析结果。S406: Determine the first analysis result based on the matching degree.
其中,第三特征为第二色彩参数,根据第二色彩参数,确定人体区域对应的颜色种类以及颜色数量。进一步的,为了保证目标图像的美观,还可以进一步的首先确定原始图像中,人体区域对应的第二色彩参数。以使后续基于该人体区域的颜色与背景图像的颜色匹配度,确定第一分析结果,该第一分析结果用于确定背景区域对应的原始图像是否符合目标图像的标准。Among them, the third feature is the second color parameter, and the color type and color quantity corresponding to the human body area are determined according to the second color parameter. Further, in order to ensure the beauty of the target image, the second color parameter corresponding to the human body area in the original image can be further determined first. Then, based on the color matching degree between the human body area and the background image, the first analysis result is determined, and the first analysis result is used to determine whether the original image corresponding to the background area meets the standard of the target image.
可以理解的,当用户身着较为艳丽的衣服时,则其对应的背景图像也应对应为色彩信息较为丰富的背景。而当用户身着较为朴素的衣服时,则其对应的背景图像也应对应为色彩信息较为简单的背景。It is understandable that when the user wears brightly colored clothes, the corresponding background image should also be a background with richer color information, while when the user wears plainer clothes, the corresponding background image should also be a background with simpler color information.
S407,提取目标图像中的至少一个物体区域。S407: extract at least one object region in the target image.
S408,提取物体区域对应的第二特征,基于第二特征,确定物体的类型信息和/或属性信息。S408, extracting a second feature corresponding to the object region, and determining type information and/or attribute information of the object based on the second feature.
S409,基于类型信息和/或属性信息,确定第二分析结果。S409: Determine a second analysis result based on the type information and/or the attribute information.
S410,基于第一分析结果和第二分析结果,确定目标图像的第三分析结果。S410: Determine a third analysis result of the target image based on the first analysis result and the second analysis result.
一般的,S47至S410可参照图3中的307至S310,在此不再赘述。Generally, S47 to S410 may refer to 307 to S310 in FIG. 3 , and will not be described in detail here.
本申请实施例的方案在执行时,对原始图像进行人脸识别,基于至少一个原始图像的人脸识别结果,选择至少一个目标图像,该目标图像中包含人体区域,对该目标图像进行语义分割,即分离该目标图像的前景区域与背景区域,提取该目标图像中的背景区域,再提取该背景区域对应的第一特征,基于该第一特征计算该背景区域对应的第一分析结果。通过本申请,可以从多个原始图像中选择至少一个目标图像,从目标图像中提取背景区域,再对背景区域对应的第一特征进行计算,得到第一分析结果,提高了相关技术中,对图像背景进行评价的准确性和实用性。When the scheme of the embodiment of the present application is executed, face recognition is performed on the original image, and based on the face recognition result of at least one original image, at least one target image is selected, the target image contains a human body area, and semantic segmentation is performed on the target image, that is, the foreground area and the background area of the target image are separated, the background area in the target image is extracted, and then the first feature corresponding to the background area is extracted, and the first analysis result corresponding to the background area is calculated based on the first feature. Through the present application, at least one target image can be selected from multiple original images, the background area can be extracted from the target image, and then the first feature corresponding to the background area can be calculated to obtain the first analysis result, thereby improving the accuracy and practicality of evaluating the image background in the related art.
在本申请的另外一种实施方式中,如图5所示,本申请还提供一种图像分析装置。其中,该装置包括选择模块501,提取模块502,计算模块503,其中:In another embodiment of the present application, as shown in FIG5 , the present application further provides an image analysis device. The device includes a selection module 501, an extraction module 502, and a calculation module 503, wherein:
选择模块501,用于基于至少一个原始图像的人脸识别结果,选择至少一个目标图像,所述目标图像包含人体区域;A selection module 501 is used to select at least one target image based on the face recognition result of at least one original image, wherein the target image contains a human body region;
提取模块502,用于对所述目标图像进行语义分割,提取所述目标图像中的背景区域;An extraction module 502 is used to perform semantic segmentation on the target image and extract a background area in the target image;
计算模块503,用于提取所述背景区域对应的第一特征,基于所述第一特征计算所述背景区域的第一分析结果。The calculation module 503 is used to extract the first feature corresponding to the background area, and calculate the first analysis result of the background area based on the first feature.
可选地,该装置还包括:Optionally, the device further comprises:
第二模块504,用于对所述目标图像中的至少一个物体进行识别,基于识别结果,确定所述物体的第二分析结果;A second module 504 is used to identify at least one object in the target image and determine a second analysis result of the object based on the identification result;
第三模块505,用于基于所述第一分析结果和所述第二分析结果,确定所述目标图像的第三分析结果。The third module 505 is used to determine a third analysis result of the target image based on the first analysis result and the second analysis result.
可选地,第二模块504包括:Optionally, the second module 504 includes:
第一单元,用于提取所述目标图像中的至少一个物体区域;A first unit is used to extract at least one object region in the target image;
第二单元,用于提取所述物体区域对应的第二特征,基于所述第二特征,确定所述物体的类型信息和/或属性信息;A second unit is used to extract a second feature corresponding to the object area, and determine type information and/or attribute information of the object based on the second feature;
第三单元,用于基于所述类型信息和/或属性信息,确定所述第二分析结果。The third unit is used to determine the second analysis result based on the type information and/or attribute information.
可选地,计算模块503,包括:Optionally, the calculation module 503 includes:
第四单元,用于基于所述第一特征,确定所述背景区域对应的颜色种类以及颜色数量;A fourth unit, configured to determine the color type and the number of colors corresponding to the background area based on the first feature;
第五单元,用于基于所述颜色种类以及颜色数量,确定所述第一分析结果。The fifth unit is used to determine the first analysis result based on the color type and the color quantity.
可选地,计算模块503,包括:Optionally, the calculation module 503 includes:
计算单元,用于计算所述第一特征与所述人体区域对应的第三特征的匹配度;a calculation unit, configured to calculate a matching degree between the first feature and a third feature corresponding to the human body region;
确定单元,用于基于所述匹配度,确定所述第一分析结果。A determining unit is used to determine the first analysis result based on the matching degree.
可选地,选择模块501包括:Optionally, the selection module 501 includes:
检测单元,用于利用预设的人脸识别模型,检测所述原始图像中是否包含人脸图像;A detection unit, used to detect whether the original image contains a face image by using a preset face recognition model;
位置确定单元,用于当确定所述原始图像中包含人脸图像时,获取所述人脸图像与对应原始图像的大小占比以及所述人脸图像在所述原始图像中的所处位置;a position determination unit, configured to, when determining that the original image contains a face image, obtain a size ratio of the face image to the corresponding original image and a position of the face image in the original image;
筛选单元,用于基于所述大小占比以及所处位置,筛选符合预设条件的原始图像作为所述目标图像。The screening unit is used to screen original images that meet preset conditions as the target images based on the size ratio and the location.
本申请实施例的方案在执行时,对原始图像进行人脸识别,基于至少一个原始图像的人脸识别结果,选择至少一个目标图像,该目标图像中包含人体区域,对该目标图像进行语义分割,即分离该目标图像的前景区域与背景区域,提取该目标图像中的背景区域,再提取该背景区域对应的第一特征,基于该第一特征计算该背景区域对应的第一分析结果。通过本申请,可以从多个原始图像中选择至少一个目标图像,从目标图像中提取背景区域,再对背景区域对应的第一特征进行计算,得到第一分析结果,提高了相关技术中,对图像背景进行评价的准确性和实用性。When the scheme of the embodiment of the present application is executed, face recognition is performed on the original image, and based on the face recognition result of at least one original image, at least one target image is selected, the target image contains a human body area, and semantic segmentation is performed on the target image, that is, the foreground area and the background area of the target image are separated, the background area in the target image is extracted, and then the first feature corresponding to the background area is extracted, and the first analysis result corresponding to the background area is calculated based on the first feature. Through the present application, at least one target image can be selected from multiple original images, the background area can be extracted from the target image, and then the first feature corresponding to the background area can be calculated to obtain the first analysis result, thereby improving the accuracy and practicality of evaluating the image background in the related art.
图6是根据一示例性实施例示出的一种电子设备的逻辑结构框图。例如,电子设备600可以是移动电话,计算机,数字广播终端,消息收发设备,游戏控制台,平板设备,医疗设备,健身设备,个人数字助理等。Fig. 6 is a block diagram of a logical structure of an electronic device according to an exemplary embodiment. For example, the electronic device 600 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
参照图6,电子设备600可以包括以下一个或多个组件:处理器601和存储器602。6 , an electronic device 600 may include one or more of the following components: a processor 601 and a memory 602 .
处理器601可以包括一个或多个处理核心,比如4核心处理器、8核心处理器等。处理器601可以采用DSP(Digital Signal Processing,数字信号处理)、FPGA(Field-Programmable Gate Array,现场可编程门阵列)、PLA(Programmable Logic Array,可编程逻辑阵列)中的至少一种硬件形式来实现。处理器601也可以包括主处理器和协处理器,主处理器是用于对在唤醒状态下的数据进行处理的处理器,也称CPU(Central ProcessingUnit,中央处理器);协处理器是用于对在待机状态下的数据进行处理的低功耗处理器。在一些实施例中,处理器601可以在集成有GPU(Graphics Processing Unit,图像处理器),GPU用于负责显示屏所需要显示的内容的渲染和绘制。一些实施例中,处理器601还可以包括AI(Artificial Intelligence,人工智能)处理器,该AI处理器用于处理有关机器学习的计算操作。The processor 601 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 601 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 601 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 601 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 601 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
存储器602可以包括一个或多个计算机可读存储介质,该计算机可读存储介质可以是非暂态的。存储器602还可包括高速随机存取存储器,以及非易失性存储器,比如一个或多个磁盘存储设备、闪存存储设备。在一些实施例中,存储器602中的非暂态的计算机可读存储介质用于存储至少一个指令,该至少一个指令用于被处理器601所执行以实现本申请中方法实施例提供的互动特效标定方法。The memory 602 may include one or more computer-readable storage media, which may be non-transitory. The memory 602 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 602 is used to store at least one instruction, which is used to be executed by the processor 601 to implement the interactive special effects calibration method provided in the method embodiment of the present application.
在一些实施例中,电子设备600还可选包括有:外围设备接口603和至少一个外围设备。处理器601、存储器602和外围设备接口603之间可以通过总线或信号线相连。各个外围设备可以通过总线、信号线或电路板与外围设备接口603相连。具体地,外围设备包括:射频电路604、触摸显示屏605、摄像头606、音频电路607、定位组件608和电源609中的至少一种。In some embodiments, the electronic device 600 may further optionally include: a peripheral device interface 603 and at least one peripheral device. The processor 601, the memory 602 and the peripheral device interface 603 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 603 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 604, a touch display screen 605, a camera 606, an audio circuit 607, a positioning component 608 and a power supply 609.
外围设备接口603可被用于将I/O(Input/Output,输入/输出)相关的至少一个外围设备连接到处理器601和存储器602。在一些实施例中,处理器601、存储器602和外围设备接口603被集成在同一芯片或电路板上;在一些其他实施例中,处理器601、存储器602和外围设备接口603中的任意一个或两个可以在单独的芯片或电路板上实现,本实施例对此不加以限定。The peripheral device interface 603 may be used to connect at least one peripheral device related to I/O (Input/Output) to the processor 601 and the memory 602. In some embodiments, the processor 601, the memory 602, and the peripheral device interface 603 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 601, the memory 602, and the peripheral device interface 603 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.
射频电路604用于接收和发射RF(Radio Frequency,射频)信号,也称电磁信号。射频电路604通过电磁信号与通信网络以及其他通信设备进行通信。射频电路604将电信号转换为电磁信号进行发送,或者,将接收到的电磁信号转换为电信号。可选地,射频电路604包括:天线系统、RF收发器、一个或多个放大器、调谐器、振荡器、数字信号处理器、编解码芯片组、用户身份模块卡等等。射频电路604可以通过至少一种无线通信协议来与其它终端进行通信。该无线通信协议包括但不限于:城域网、各代移动通信网络(2G、3G、4G及5G)、无线局域网和/或WiFi(Wireless Fidelity,无线保真)网络。在一些实施例中,射频电路604还可以包括NFC(NearField Communication,近距离无线通信)有关的电路,本申请对此不加以限定。The radio frequency circuit 604 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 604 communicates with the communication network and other communication devices through electromagnetic signals. The radio frequency circuit 604 converts the electrical signal into an electromagnetic signal for transmission, or converts the received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 604 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. The radio frequency circuit 604 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: a metropolitan area network, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and/or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 604 may also include circuits related to NFC (NearField Communication), which is not limited in this application.
显示屏605用于显示UI(User Interface,用户界面)。该UI可以包括图形、文本、图标、视频及其它们的任意组合。当显示屏605是触摸显示屏时,显示屏605还具有采集在显示屏605的表面或表面上方的触摸信号的能力。该触摸信号可以作为控制信号输入至处理器601进行处理。此时,显示屏605还可以用于提供虚拟按钮和/或虚拟键盘,也称软按钮和/或软键盘。在一些实施例中,显示屏605可以为一个,设置电子设备600的前面板;在另一些实施例中,显示屏605可以为至少两个,分别设置在电子设备600的不同表面或呈折叠设计;在再一些实施例中,显示屏605可以是柔性显示屏,设置在电子设备600的弯曲表面上或折叠面上。甚至,显示屏605还可以设置成非矩形的不规则图形,也即异形屏。显示屏605可以采用LCD(Liquid Crystal Display,液晶显示屏)、OLED(Organic Light-Emitting Diode,有机发光二极管)等材质制备。The display screen 605 is used to display the UI (User Interface). The UI may include graphics, text, icons, videos and any combination thereof. When the display screen 605 is a touch display screen, the display screen 605 also has the ability to collect touch signals on the surface or above the surface of the display screen 605. The touch signal can be input to the processor 601 as a control signal for processing. At this time, the display screen 605 can also be used to provide virtual buttons and/or virtual keyboards, also known as soft buttons and/or soft keyboards. In some embodiments, the display screen 605 can be one, and the front panel of the electronic device 600 is set; in other embodiments, the display screen 605 can be at least two, which are respectively set on different surfaces of the electronic device 600 or are folded; in some other embodiments, the display screen 605 can be a flexible display screen, which is set on the curved surface or folded surface of the electronic device 600. Even, the display screen 605 can also be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 605 can be made of materials such as LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode, organic light-emitting diode).
摄像头组件606用于采集图像或视频。可选地,摄像头组件606包括前置摄像头和后置摄像头。通常,前置摄像头设置在终端的前面板,后置摄像头设置在终端的背面。在一些实施例中,后置摄像头为至少两个,分别为主摄像头、景深摄像头、广角摄像头、长焦摄像头中的任意一种,以实现主摄像头和景深摄像头融合实现背景虚化功能、主摄像头和广角摄像头融合实现全景拍摄以及VR(Virtual Reality,虚拟现实)拍摄功能或者其它融合拍摄功能。在一些实施例中,摄像头组件606还可以包括闪光灯。闪光灯可以是单色温闪光灯,也可以是双色温闪光灯。双色温闪光灯是指暖光闪光灯和冷光闪光灯的组合,可以用于不同色温下的光线补偿。The camera assembly 606 is used to capture images or videos. Optionally, the camera assembly 606 includes a front camera and a rear camera. Typically, the front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize the panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 606 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.
音频电路607可以包括麦克风和扬声器。麦克风用于采集用户及环境的声波,并将声波转换为电信号输入至处理器601进行处理,或者输入至射频电路604以实现语音通信。出于立体声采集或降噪的目的,麦克风可以为多个,分别设置在电子设备600的不同部位。麦克风还可以是阵列麦克风或全向采集型麦克风。扬声器则用于将来自处理器601或射频电路604的电信号转换为声波。扬声器可以是传统的薄膜扬声器,也可以是压电陶瓷扬声器。当扬声器是压电陶瓷扬声器时,不仅可以将电信号转换为人类可听见的声波,也可以将电信号转换为人类听不见的声波以进行测距等用途。在一些实施例中,音频电路607还可以包括耳机插孔。The audio circuit 607 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 601 for processing, or input them into the radio frequency circuit 604 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the electronic device 600. The microphone may also be an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 601 or the radio frequency circuit 604 into sound waves. The speaker may be a traditional film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 607 may also include a headphone jack.
定位组件608用于定位电子设备600的当前地理位置,以实现导航或LBS(LocationBased Service,基于位置的服务)。定位组件608可以是基于美国的GPS(GlobalPositioning System,全球定位系统)、中国的北斗系统、俄罗斯的格雷纳斯系统或欧盟的伽利略系统的定位组件。Positioning component 608 is used to locate the current geographic location of electronic device 600 to implement navigation or LBS (Location Based Service). Positioning component 608 can be a positioning component based on the US GPS (Global Positioning System), China's Beidou system, Russia's Grenas system or the European Union's Galileo system.
电源609用于为电子设备600中的各个组件进行供电。电源609可以是交流电、直流电、一次性电池或可充电电池。当电源609包括可充电电池时,该可充电电池可以支持有线充电或无线充电。该可充电电池还可以用于支持快充技术。The power supply 609 is used to power various components in the electronic device 600. The power supply 609 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 609 includes a rechargeable battery, the rechargeable battery can support wired charging or wireless charging. The rechargeable battery can also be used to support fast charging technology.
在一些实施例中,电子设备600还包括有一个或多个传感器610。该一个或多个传感器610包括但不限于:加速度传感器611、陀螺仪传感器612、压力传感器613、指纹传感器614、光学传感器615以及接近传感器616。In some embodiments, the electronic device 600 further includes one or more sensors 610 , including but not limited to: an acceleration sensor 611 , a gyroscope sensor 612 , a pressure sensor 613 , a fingerprint sensor 614 , an optical sensor 615 , and a proximity sensor 616 .
加速度传感器611可以检测以电子设备600建立的坐标系的三个坐标轴上的加速度大小。比如,加速度传感器611可以用于检测重力加速度在三个坐标轴上的分量。处理器601可以根据加速度传感器611采集的重力加速度信号,控制触摸显示屏605以横向视图或纵向视图进行用户界面的显示。加速度传感器611还可以用于游戏或者用户的运动数据的采集。The acceleration sensor 611 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the electronic device 600. For example, the acceleration sensor 611 can be used to detect the components of gravity acceleration on the three coordinate axes. The processor 601 can control the touch display screen 605 to display the user interface in a horizontal view or a vertical view according to the gravity acceleration signal collected by the acceleration sensor 611. The acceleration sensor 611 can also be used for collecting game or user motion data.
陀螺仪传感器612可以检测电子设备600的机体方向及转动角度,陀螺仪传感器612可以与加速度传感器611协同采集用户对电子设备600的3D动作。处理器601根据陀螺仪传感器612采集的数据,可以实现如下功能:动作感应(比如根据用户的倾斜操作来改变UI)、拍摄时的图像稳定、游戏控制以及惯性导航。The gyro sensor 612 can detect the body direction and rotation angle of the electronic device 600, and the gyro sensor 612 can cooperate with the acceleration sensor 611 to collect the user's 3D actions on the electronic device 600. The processor 601 can implement the following functions based on the data collected by the gyro sensor 612: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.
压力传感器613可以设置在电子设备600的侧边框和/或触摸显示屏605的下层。当压力传感器613设置在电子设备600的侧边框时,可以检测用户对电子设备600的握持信号,由处理器601根据压力传感器613采集的握持信号进行左右手识别或快捷操作。当压力传感器613设置在触摸显示屏605的下层时,由处理器601根据用户对触摸显示屏605的压力操作,实现对UI界面上的可操作性控件进行控制。可操作性控件包括按钮控件、滚动条控件、图标控件、菜单控件中的至少一种。The pressure sensor 613 can be set on the side frame of the electronic device 600 and/or the lower layer of the touch display screen 605. When the pressure sensor 613 is set on the side frame of the electronic device 600, it can detect the user's holding signal of the electronic device 600, and the processor 601 performs left and right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor 613. When the pressure sensor 613 is set on the lower layer of the touch display screen 605, the processor 601 controls the operability controls on the UI interface according to the user's pressure operation on the touch display screen 605. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
指纹传感器614用于采集用户的指纹,由处理器601根据指纹传感器614采集到的指纹识别用户的身份,或者,由指纹传感器614根据采集到的指纹识别用户的身份。在识别出用户的身份为可信身份时,由处理器601授权该用户执行相关的敏感操作,该敏感操作包括解锁屏幕、查看加密信息、下载软件、支付及更改设置等。指纹传感器614可以被设置电子设备600的正面、背面或侧面。当电子设备600上设置有物理按键或厂商Logo时,指纹传感器614可以与物理按键或厂商Logo集成在一起。The fingerprint sensor 614 is used to collect the user's fingerprint, and the processor 601 identifies the user's identity based on the fingerprint collected by the fingerprint sensor 614, or the fingerprint sensor 614 identifies the user's identity based on the collected fingerprint. When the user's identity is identified as a trusted identity, the processor 601 authorizes the user to perform relevant sensitive operations, which include unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings. The fingerprint sensor 614 can be set on the front, back, or side of the electronic device 600. When a physical button or a manufacturer logo is set on the electronic device 600, the fingerprint sensor 614 can be integrated with the physical button or the manufacturer logo.
光学传感器615用于采集环境光强度。在一个实施例中,处理器601可以根据光学传感器615采集的环境光强度,控制触摸显示屏605的显示亮度。具体地,当环境光强度较高时,调高触摸显示屏605的显示亮度;当环境光强度较低时,调低触摸显示屏605的显示亮度。在另一个实施例中,处理器601还可以根据光学传感器615采集的环境光强度,动态调整摄像头组件606的拍摄参数。The optical sensor 615 is used to collect the ambient light intensity. In one embodiment, the processor 601 can control the display brightness of the touch display screen 605 according to the ambient light intensity collected by the optical sensor 615. Specifically, when the ambient light intensity is high, the display brightness of the touch display screen 605 is increased; when the ambient light intensity is low, the display brightness of the touch display screen 605 is reduced. In another embodiment, the processor 601 can also dynamically adjust the shooting parameters of the camera assembly 606 according to the ambient light intensity collected by the optical sensor 615.
接近传感器616,也称距离传感器,通常设置在电子设备600的前面板。接近传感器616用于采集用户与电子设备600的正面之间的距离。在一个实施例中,当接近传感器616检测到用户与电子设备600的正面之间的距离逐渐变小时,由处理器601控制触摸显示屏605从亮屏状态切换为息屏状态;当接近传感器616检测到用户与电子设备600的正面之间的距离逐渐变大时,由处理器601控制触摸显示屏605从息屏状态切换为亮屏状态。The proximity sensor 616, also called a distance sensor, is usually disposed on the front panel of the electronic device 600. The proximity sensor 616 is used to collect the distance between the user and the front of the electronic device 600. In one embodiment, when the proximity sensor 616 detects that the distance between the user and the front of the electronic device 600 is gradually decreasing, the processor 601 controls the touch display screen 605 to switch from the screen-on state to the screen-off state; when the proximity sensor 616 detects that the distance between the user and the front of the electronic device 600 is gradually increasing, the processor 601 controls the touch display screen 605 to switch from the screen-off state to the screen-on state.
本领域技术人员可以理解,图6中示出的结构并不构成对电子设备600的限定,可以包括比图示更多或更少的组件,或者组合某些组件,或者采用不同的组件布置。Those skilled in the art will appreciate that the structure shown in FIG. 6 does not limit the electronic device 600 , and may include more or fewer components than shown, or combine certain components, or adopt a different component arrangement.
在示例性实施例中,还提供了一种包括指令的非临时性计算机可读存储介质,例如包括指令的存储器604,上述指令可由电子设备600的处理器620执行以完成上述选择图像的方法,该方法包括:提取待选择图像中的背景区域图像,所述待选择图像包括用户图像以及所述背景区域图像;基于第一色彩参数以及清晰度参数,筛选所述背景区域图像中符合第一预设条件的第一背景图像;基于每个第一背景图像中包含的物体图像,筛选所述第一背景图像中符合第二预设条件的第二背景图像;将所述第二背景图像对应的待选择图像作为目标图像。可选地,上述指令还可以由电子设备600的处理器620执行以完成上述示例性实施例中所涉及的其他步骤。可选地,上述指令还可以由电子设备600的处理器620执行以完成上述示例性实施例中所涉及的其他步骤。例如,所述非临时性计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 604 including instructions, and the above instructions can be executed by the processor 620 of the electronic device 600 to complete the above method of selecting an image, the method comprising: extracting a background area image in the image to be selected, the image to be selected includes a user image and the background area image; based on a first color parameter and a clarity parameter, screening a first background image that meets a first preset condition in the background area image; based on an object image contained in each first background image, screening a second background image that meets a second preset condition in the first background image; and using the image to be selected corresponding to the second background image as a target image. Optionally, the above instructions can also be executed by the processor 620 of the electronic device 600 to complete other steps involved in the above exemplary embodiment. Optionally, the above instructions can also be executed by the processor 620 of the electronic device 600 to complete other steps involved in the above exemplary embodiment. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
在示例性实施例中,还提供了一种应用程序/计算机程序产品,包括一条或多条指令,该一条或多条指令可以由电子设备600的处理器620执行,以完成上述图像分析方法,该方法包括:基于至少一个原始图像的人脸识别结果,选择至少一个目标图像,所述目标图像包含人体区域;对所述目标图像进行语义分割,提取所述目标图像中的背景区域;提取所述背景区域对应的第一特征,基于所述第一特征计算所述背景区域的第一分析结果。可选地,上述指令还可以由电子设备600的处理器620执行以完成上述示例性实施例中所涉及的其他步骤。本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本申请的其它实施方案。本申请旨在涵盖本申请的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本申请的一般性原理并包括本申请未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本申请的真正范围和精神由下面的权利要求指出。In an exemplary embodiment, an application/computer program product is also provided, including one or more instructions, which can be executed by the processor 620 of the electronic device 600 to complete the above-mentioned image analysis method, which includes: based on the face recognition result of at least one original image, selecting at least one target image, the target image contains a human body area; performing semantic segmentation on the target image, extracting the background area in the target image; extracting the first feature corresponding to the background area, and calculating the first analysis result of the background area based on the first feature. Optionally, the above-mentioned instructions can also be executed by the processor 620 of the electronic device 600 to complete the other steps involved in the above-mentioned exemplary embodiment. Those skilled in the art will easily think of other embodiments of the present application after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variants, uses or adaptive changes of the present application, which follow the general principles of the present application and include common knowledge or customary technical means in the technical field that are not disclosed in the present application. The description and examples are only regarded as exemplary, and the true scope and spirit of the present application are indicated by the following claims.
应当理解的是,本申请并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本申请的范围仅由所附的权利要求来限制。It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims (7)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010121619.3A CN111445439B (en) | 2020-02-26 | 2020-02-26 | Image analysis method, device, electronic equipment and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010121619.3A CN111445439B (en) | 2020-02-26 | 2020-02-26 | Image analysis method, device, electronic equipment and medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111445439A CN111445439A (en) | 2020-07-24 |
CN111445439B true CN111445439B (en) | 2024-05-07 |
Family
ID=71648814
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010121619.3A Active CN111445439B (en) | 2020-02-26 | 2020-02-26 | Image analysis method, device, electronic equipment and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111445439B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113269141B (en) * | 2021-06-18 | 2023-09-22 | 浙江机电职业技术学院 | Image processing method and device |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101887518A (en) * | 2010-06-17 | 2010-11-17 | 北京交通大学 | Human body detection device and method |
CN103973977A (en) * | 2014-04-15 | 2014-08-06 | 联想(北京)有限公司 | Blurring processing method and device for preview interface and electronic equipment |
CN105894458A (en) * | 2015-12-08 | 2016-08-24 | 乐视移动智能信息技术(北京)有限公司 | Processing method and device of image with human face |
CN105981368A (en) * | 2014-02-13 | 2016-09-28 | 谷歌公司 | Photo composition and position guidance in an imaging device |
CN106331492A (en) * | 2016-08-29 | 2017-01-11 | 广东欧珀移动通信有限公司 | An image processing method and terminal |
CN107590461A (en) * | 2017-09-12 | 2018-01-16 | 广东欧珀移动通信有限公司 | Face identification method and Related product |
CN108616689A (en) * | 2018-04-12 | 2018-10-02 | Oppo广东移动通信有限公司 | Portrait-based high dynamic range image acquisition method, device and equipment |
-
2020
- 2020-02-26 CN CN202010121619.3A patent/CN111445439B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101887518A (en) * | 2010-06-17 | 2010-11-17 | 北京交通大学 | Human body detection device and method |
CN105981368A (en) * | 2014-02-13 | 2016-09-28 | 谷歌公司 | Photo composition and position guidance in an imaging device |
CN103973977A (en) * | 2014-04-15 | 2014-08-06 | 联想(北京)有限公司 | Blurring processing method and device for preview interface and electronic equipment |
CN105894458A (en) * | 2015-12-08 | 2016-08-24 | 乐视移动智能信息技术(北京)有限公司 | Processing method and device of image with human face |
CN106331492A (en) * | 2016-08-29 | 2017-01-11 | 广东欧珀移动通信有限公司 | An image processing method and terminal |
CN107590461A (en) * | 2017-09-12 | 2018-01-16 | 广东欧珀移动通信有限公司 | Face identification method and Related product |
CN108616689A (en) * | 2018-04-12 | 2018-10-02 | Oppo广东移动通信有限公司 | Portrait-based high dynamic range image acquisition method, device and equipment |
Also Published As
Publication number | Publication date |
---|---|
CN111445439A (en) | 2020-07-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109712224B (en) | Virtual scene rendering method and device and intelligent device | |
CN111541907B (en) | Article display method, apparatus, device and storage medium | |
CN110555839A (en) | Defect detection and identification method and device, computer equipment and storage medium | |
CN110335224B (en) | Image processing method, image processing device, computer equipment and storage medium | |
CN110796005A (en) | Method, device, electronic equipment and medium for online teaching monitoring | |
CN111857793B (en) | Training method, device, equipment and storage medium of network model | |
US20210335391A1 (en) | Resource display method, device, apparatus, and storage medium | |
WO2020211607A1 (en) | Video generation method, apparatus, electronic device, and medium | |
CN110853124B (en) | Methods, devices, electronic equipment and media for generating GIF dynamic images | |
CN111539795A (en) | Image processing method, image processing device, electronic equipment and computer readable storage medium | |
CN112135191A (en) | Video editing method, device, terminal and storage medium | |
WO2023142915A1 (en) | Image processing method, apparatus and device, and storage medium | |
CN112907702A (en) | Image processing method, image processing device, computer equipment and storage medium | |
CN110675473B (en) | Method, device, electronic equipment and medium for generating GIF dynamic images | |
CN111327819A (en) | Method, device, electronic equipment and medium for selecting image | |
CN111105474A (en) | Font drawing method and device, computer equipment and computer readable storage medium | |
CN113209610B (en) | Virtual scene picture display method and device, computer equipment and storage medium | |
CN112308103A (en) | Method and device for generating training sample | |
CN111445439B (en) | Image analysis method, device, electronic equipment and medium | |
CN110348318A (en) | Image recognition method, device, electronic device and medium | |
CN112860046B (en) | Method, device, electronic equipment and medium for selecting operation mode | |
CN111753813A (en) | Image processing method, device, device and storage medium | |
CN109472855B (en) | Volume rendering method and device and intelligent device | |
CN114155336A (en) | Virtual object display method and device, electronic equipment and storage medium | |
CN111797754A (en) | Image detection method, device, electronic equipment and medium |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20250331 Address after: No. 902, 9th Floor, Unit 2, Building 1, No. 333 Jiqing 3rd Road, Chengdu High tech Zone, Chengdu Free Trade Zone, Sichuan Province 610000 Patentee after: Chengdu Yudi Technology Co.,Ltd. Country or region after: China Address before: 100123 t4-27 floor, Damei center, courtyard 7, Qingnian Road, Chaoyang District, Beijing Patentee before: FUTURE VIPKID Ltd. Country or region before: China |