CN114419292A - Image processing method, device, equipment and storage medium - Google Patents
Image processing method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN114419292A CN114419292A CN202210072428.1A CN202210072428A CN114419292A CN 114419292 A CN114419292 A CN 114419292A CN 202210072428 A CN202210072428 A CN 202210072428A CN 114419292 A CN114419292 A CN 114419292A
- Authority
- CN
- China
- Prior art keywords
- virtual object
- view space
- target object
- field
- view
- 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.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T19/00—Manipulating 3D models or images for computer graphics
- G06T19/006—Mixed reality
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T15/00—3D [Three Dimensional] image rendering
- G06T15/005—General purpose rendering architectures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T17/00—Three dimensional [3D] modelling, e.g. data description of 3D objects
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Computer Graphics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Geometry (AREA)
- Computer Hardware Design (AREA)
- General Engineering & Computer Science (AREA)
- Processing Or Creating Images (AREA)
Abstract
Description
技术领域technical field
本公开实施例涉及增强现实技术领域,尤其涉及一种图像处理方法、装置、设备及存储介质。The embodiments of the present disclosure relate to the field of augmented reality technologies, and in particular, to an image processing method, apparatus, device, and storage medium.
背景技术Background technique
通过在检测到的目标物体上过载虚拟物体是增强现实中常见的应用场景。该应用场景中,需要对空间进行目标检测。通常,在对空间中同一目标物体多次检测后,需要进行重叠的判断及视野外目标物体的移除。现有技术中,可能通过目标跟踪和特征匹配的方式实现物体重复物体的过滤及视野外物体的删除,但是该方式计算量较大,效率较低。Overloading virtual objects on detected target objects is a common application scenario in augmented reality. In this application scenario, object detection in space is required. Usually, after multiple detections of the same target object in space, it is necessary to perform overlapping judgment and remove the target object outside the field of view. In the prior art, it is possible to realize the filtering of repeated objects and the deletion of out-of-view objects by means of target tracking and feature matching, but this method requires a large amount of calculation and is inefficient.
发明内容SUMMARY OF THE INVENTION
本公开实施例提供一种图像处理方法、装置、设备及存储介质,可以降低虚拟物体更新时的计算量,从而提高图像处理效率。Embodiments of the present disclosure provide an image processing method, apparatus, device, and storage medium, which can reduce the amount of calculation when virtual objects are updated, thereby improving image processing efficiency.
第一方面,本公开实施例提供了一种图像处理方法,包括:In a first aspect, an embodiment of the present disclosure provides an image processing method, including:
获取在当前关键帧检测到的目标物体以及当前关键帧对应的已渲染虚拟物体;其中,所述关键帧为触发物体检测的帧;Obtain the target object detected in the current key frame and the rendered virtual object corresponding to the current key frame; wherein, the key frame is the frame that triggers object detection;
根据所述检测到的目标物体和视野空间队列确定待新增虚拟物体;其中,所述视野空间队列由N个最近的关键帧对应的视野空间组成,所述当前关键帧为队列中第N个关键帧;Determine the virtual object to be added according to the detected target object and the field of view space queue; wherein, the field of view space queue is composed of the field of view space corresponding to the N nearest key frames, and the current key frame is the Nth in the queue Keyframe;
根据所述已渲染虚拟物体和所述视野空间队列确定待删除虚拟物体;Determine the virtual object to be deleted according to the rendered virtual object and the view space queue;
根据所述待新增虚拟物体和所述待删除虚拟物体对所述当前关键帧对应的虚拟物体进行更新。The virtual object corresponding to the current key frame is updated according to the virtual object to be added and the virtual object to be deleted.
第二方面,本公开实施例还提供了一种图像处理装置,包括:In a second aspect, an embodiment of the present disclosure further provides an image processing apparatus, including:
目标物体检测模块,用于获取在当前关键帧检测到的目标物体以及当前关键帧对应的已渲染虚拟物体;其中,所述关键帧为触发物体检测的帧;a target object detection module, configured to acquire the target object detected in the current key frame and the rendered virtual object corresponding to the current key frame; wherein the key frame is the frame that triggers object detection;
待新增虚拟物体确定模块,用于根据所述检测到的目标物体和视野空间队列确定待新增虚拟物体;其中,所述视野空间队列由N个最近的关键帧对应的视野空间组成,所述当前关键帧为队列中第N个关键帧;The virtual object to be added determination module is used to determine the virtual object to be added according to the detected target object and the field of view space queue; wherein, the field of view space queue is composed of the field of view space corresponding to the N nearest key frames, and the The current key frame is the Nth key frame in the queue;
待删除虚拟物体确定模块,用于根据所述已渲染虚拟物体和所述视野空间队列确定待删除虚拟物体;a virtual object determination module to be deleted, configured to determine the virtual object to be deleted according to the rendered virtual object and the field of view space queue;
虚拟物体更新模块,用于根据所述待新增虚拟物体和所述待删除虚拟物体对所述当前关键帧对应的虚拟物体进行更新。The virtual object updating module is configured to update the virtual object corresponding to the current key frame according to the virtual object to be added and the virtual object to be deleted.
第三方面,本公开实施例还提供了一种电子设备,所述电子设备包括:In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:
一个或多个处理装置;one or more processing devices;
存储装置,用于存储一个或多个程序;a storage device for storing one or more programs;
当所述一个或多个程序被所述一个或多个处理装置执行,使得所述一个或多个处理装置实现如本公开实施例所述的图像处理方法。When the one or more programs are executed by the one or more processing apparatuses, the one or more processing apparatuses implement the image processing method according to the embodiments of the present disclosure.
第四方面,本公开实施例还提供了一种计算机可读介质,其上存储有计算机程序,该程序被处理装置执行时实现如本公开实施例所述的图像处理方法。In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable medium on which a computer program is stored, and when the program is executed by a processing apparatus, implements the image processing method according to the embodiment of the present disclosure.
本公开实施例公开了一种图像处理方法、装置、设备及存储介质。获取在当前关键帧检测到的目标物体以及当前关键帧对应的已渲染虚拟物体;其中,关键帧为触发物体检测的帧;根据检测到的目标物体和视野空间队列确定待新增虚拟物体;其中,视野空间队列由N个最近的关键帧对应的视野空间组成,当前关键帧为队列中第N个关键帧;根据已渲染虚拟物体和视野空间队列确定待删除虚拟物体;根据待新增虚拟物体和待删除虚拟物体对当前关键帧对应的虚拟物体进行更新。本公开实施例提供的图像处理方法,根据检测到的目标物体和视野空间队列确定待新增虚拟物体,根据已渲染虚拟物体和视野空间队列确定待删除虚拟物体,可以降低虚拟物体更新时的计算量,从而提高图像处理效率。Embodiments of the present disclosure disclose an image processing method, apparatus, device, and storage medium. Obtain the target object detected in the current key frame and the rendered virtual object corresponding to the current key frame; the key frame is the frame that triggers object detection; the virtual object to be added is determined according to the detected target object and the field of view space queue; wherein , the field of view space queue consists of the field of view space corresponding to the N nearest key frames, and the current key frame is the Nth key frame in the queue; the virtual object to be deleted is determined according to the rendered virtual object and the field of view space queue; the virtual object to be added is determined according to the virtual object to be added. The virtual object corresponding to the current key frame is updated with the virtual object to be deleted. The image processing method provided by the embodiment of the present disclosure determines the virtual object to be added according to the detected target object and the field of view space queue, and determines the virtual object to be deleted according to the rendered virtual object and the field of view space queue, which can reduce the calculation when the virtual object is updated. to improve image processing efficiency.
附图说明Description of drawings
图1是本公开实施例中的一种图像处理方法的流程图;1 is a flowchart of an image processing method in an embodiment of the present disclosure;
图2是本公开实施例中的视椎体的示意图;2 is a schematic diagram of an optic frustum in an embodiment of the present disclosure;
图3是本公开实施例中的在当前关键帧新增的目标物体示例图;3 is an example diagram of a newly added target object in a current key frame in an embodiment of the present disclosure;
图4是本公开实施例中的一种图像处理装置的结构示意图;4 is a schematic structural diagram of an image processing apparatus in an embodiment of the present disclosure;
图5是本公开实施例中的一种电子设备的结构示意图。FIG. 5 is a schematic structural diagram of an electronic device in an embodiment of the present disclosure.
具体实施方式Detailed ways
下面将参照附图更详细地描述本公开的实施例。虽然附图中显示了本公开的某些实施例,然而应当理解的是,本公开可以通过各种形式来实现,而且不应该被解释为限于这里阐述的实施例,相反提供这些实施例是为了更加透彻和完整地理解本公开。应当理解的是,本公开的附图及实施例仅用于示例性作用,并非用于限制本公开的保护范围。Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for the purpose of A more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes, and are not intended to limit the protection scope of the present disclosure.
应当理解,本公开的方法实施方式中记载的各个步骤可以按照不同的顺序执行,和/或并行执行。此外,方法实施方式可以包括附加的步骤和/或省略执行示出的步骤。本公开的范围在此方面不受限制。It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and/or in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this regard.
本文使用的术语“包括”及其变形是开放性包括,即“包括但不限于”。术语“基于”是“至少部分地基于”。术语“一个实施例”表示“至少一个实施例”;术语“另一实施例”表示“至少一个另外的实施例”;术语“一些实施例”表示“至少一些实施例”。其他术语的相关定义将在下文描述中给出。As used herein, the term "including" and variations thereof are open-ended inclusions, ie, "including but not limited to". The term "based on" is "based at least in part on." The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions of other terms will be given in the description below.
需要注意,本公开中提及的“第一”、“第二”等概念仅用于对不同的装置、模块或单元进行区分,并非用于限定这些装置、模块或单元所执行的功能的顺序或者相互依存关系。It should be noted that concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or interdependence.
需要注意,本公开中提及的“一个”、“多个”的修饰是示意性而非限制性的,本领域技术人员应当理解,除非在上下文另有明确指出,否则应该理解为“一个或多个”。It should be noted that the modifications of "a" and "a plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless the context clearly indicates otherwise, they should be understood as "one or a plurality of". multiple".
本公开实施方式中的多个装置之间所交互的消息或者信息的名称仅用于说明性的目的,而并不是用于对这些消息或信息的范围进行限制。The names of messages or information exchanged between multiple devices in the embodiments of the present disclosure are only for illustrative purposes, and are not intended to limit the scope of these messages or information.
图1为本公开实施例提供的一种图像处理方法的流程图,本实施例可适用于在三维空间的画面中的虚拟物体进行更新的情况,该方法可以由图像处理装置来执行,该装置可由硬件和/或软件组成,并一般可集成在具有图像处理功能的设备中,该设备可以是服务器、移动终端或服务器集群等电子设备。如图1所示,该方法具体包括如下步骤:FIG. 1 is a flowchart of an image processing method provided by an embodiment of the present disclosure. This embodiment can be applied to a situation where a virtual object in a screen in a three-dimensional space is updated. The method can be executed by an image processing apparatus. It can be composed of hardware and/or software, and can generally be integrated into a device with image processing functions, which can be an electronic device such as a server, a mobile terminal, or a server cluster. As shown in Figure 1, the method specifically includes the following steps:
S110,获取在当前关键帧检测到的目标物体以及当前关键帧对应的已渲染虚拟物体。S110: Acquire the target object detected in the current key frame and the rendered virtual object corresponding to the current key frame.
其中,关键帧为触发物体检测的帧,当满足设定触发条件时,终端设备触发物体检测模块对当前画面进行目标物体的检测。其中,设定触发条件可以是:每隔设定时长、每隔设定数量的视频帧或者当前已渲染虚拟物体数量小于设定值等。本实施例中,可以采用现有的目标物体检测算法对当前画面进行目标物体的检测,此处不做限定。The key frame is a frame that triggers object detection. When the set trigger condition is met, the terminal device triggers the object detection module to detect the target object on the current screen. The set trigger condition may be: every set time length, every set number of video frames, or the number of currently rendered virtual objects is less than a set value, and the like. In this embodiment, the existing target object detection algorithm may be used to detect the target object on the current picture, which is not limited here.
其中,已渲染虚拟物体可以理解为已经显示并挂载于三维空间的物体上的虚拟物体,虚拟物体为3D物体。虚拟物体可以是任意主题类别的,例如:“元宵节”主题,虚拟物体可以是:虚拟灯笼、虚拟汤圆等,此处不做限定。The rendered virtual object may be understood as a virtual object that has been displayed and mounted on an object in a three-dimensional space, and the virtual object is a 3D object. The virtual objects can be of any theme category, for example: "Lantern Festival" theme, the virtual objects can be: virtual lanterns, virtual dumplings, etc., which are not limited here.
S120,根据检测到的目标物体和视野空间队列确定待新增虚拟物体。S120: Determine the virtual object to be added according to the detected target object and the field of view space queue.
其中,视野空间队列由距离当前时刻最近的N个关键帧对应的视野空间组成,当前关键帧为队列中第N个关键帧,则上一个关键帧为第N-1帧,依次类推。视野空间可以理解为三维世界中在屏幕上可见的区域,即虚拟摄像机的视野范围。即视野空间为以相机拍摄角度为视角,且落入相机拍摄范围内的三维空间。可选的,视野空间由视椎体表征,视椎体由多个边界面围成,本实施例中,视椎体由6个边界面围成,分别为近视面(Near plane)、远视面(Far plane)及四个侧边界面。示例性的,图2是本实施例中视椎体的示意图,图中,Oc表示相机。视椎体i在空间构成的梯台空间的集合为Qi。对于视野空间队列,则为N个关键帧对应的视野空间构成的区域集合,表示为:Q=Q1∪Q2∪...∪QN,若三维空间点p位于空间Q内,则表示为p∈Q。由于计算单元的内存限制以及随着时间差的增加,旧关键帧的信息对于新关键帧的参考价值降低,所以可以在适当的时机移除旧的关键帧,因此,视野空间队列中保存N个最近的关键帧对应的视野空间。Among them, the view space queue consists of the view space corresponding to the N key frames closest to the current moment, the current key frame is the N th key frame in the queue, the previous key frame is the N-1 th frame, and so on. The field of view space can be understood as the area visible on the screen in the three-dimensional world, that is, the field of view of the virtual camera. That is, the field of view is a three-dimensional space that takes the shooting angle of the camera as the viewing angle and falls within the shooting range of the camera. Optionally, the visual field space is represented by an optic frustum, and the optic frustum is surrounded by a plurality of boundary surfaces. In this embodiment, the optic frustum is enclosed by 6 boundary surfaces, which are a near plane (Near plane) and a distance plane respectively. (Far plane) and four side interfaces. Exemplarily, FIG. 2 is a schematic diagram of a viewing frustum in this embodiment, and in the figure, Oc represents a camera. The set of platform spaces formed by the cone i in space is Qi. For the view space queue, it is the set of regions formed by the view space corresponding to N key frames, expressed as: Q=Q 1 ∪Q 2 ∪...∪Q N , if the three-dimensional space point p is located in the space Q, it means is p∈Q. Due to the memory limitation of the computing unit and the increase of the time difference, the reference value of the information of the old keyframes for the new keyframes decreases, so the old keyframes can be removed at an appropriate time. Therefore, the N recent keyframes are stored in the field of view space queue. The keyframe corresponding to the field of view space.
其中,待新增虚拟物体由在当前关键帧中新增的目标物体确定,若在当前关键帧新增了目标物体,则需要在新增的目标物体上挂载新的虚拟物体。具体的,根据检测到的目标物体和视野空间队列确定待新增虚拟物体的方式可以是:根据检测到的目标物体和视野空间队列确定新增目标物体;根据新增目标物体确定待新增虚拟物体。The virtual object to be added is determined by the target object added in the current key frame. If a target object is added in the current key frame, a new virtual object needs to be mounted on the newly added target object. Specifically, the method of determining the virtual object to be added according to the detected target object and the field of view space queue may be: determining the new target object according to the detected target object and the field of view space queue; determining the virtual object to be added according to the newly added target object object.
其中,新增目标物体可以理解为在当前关键帧新检测到的目标物体,即在之前的关键帧中未检测到。根据新增目标物体确定待新增虚拟物体的过程可以是:根据新增目标物体的检测框确定虚拟物体框,并获取虚拟物体内对应的素材,将该素材添加至虚拟物体框内进行渲染,获得新增虚拟物体。Among them, the newly added target object can be understood as the target object newly detected in the current key frame, that is, not detected in the previous key frame. The process of determining the virtual object to be added according to the newly added target object may be: determining the virtual object frame according to the detection frame of the newly added target object, obtaining the corresponding material in the virtual object, and adding the material to the virtual object frame for rendering, Get new virtual objects.
本实施例中,根据检测到的目标物体和视野空间队列确定新增目标物体的方式可以是:判断检测到的目标物体是否落入视野空间队列中第1到第N-1个视野空间中至少一个;若否,则检测到的目标物体为新增目标物体;若是,则检测到的物体为旧目标物体。In this embodiment, the method for determining the newly added target object according to the detected target object and the field of view space queue may be: judging whether the detected target object falls into at least the first to N-1th field of view space in the field of view space queue One; if not, the detected target object is a new target object; if so, the detected object is an old target object.
具体的,若检测到目标物体均未落入视野空间队列中第1到第N-1个视野空间中,则该检测到的目标物体为新增目标物体。假设由目标物体的中心点p表征目标物体,若则表明该检测到的目标物体为新增目标物体。示例性的,图3是本实施例中在当前关键帧新增的目标物体示例图,如图3所示,检测到的目标物体未落入前1到N-1帧的任一视野空间,则为新增目标物体。Specifically, if none of the detected target objects fall into the first to N-1th view spaces in the view space queue, the detected target object is a newly added target object. Assuming that the target object is represented by the center point p of the target object, if It indicates that the detected target object is a new target object. Exemplarily, FIG. 3 is an example diagram of a target object newly added in the current key frame in this embodiment. As shown in FIG. 3 , the detected target object does not fall into any visual field of the previous 1 to N-1 frames, It is a new target object.
可选的,判断检测到的目标物体是否落入视野空间队列中第1到第N-1个视野空间中的方式可以是:对于第1到第N-1个中的每个视野空间,将视野空间投影至相机平面,获得视野空间对应的二维区域;将检测到的目标物体的三维中心点投影至相机平面,获得二维中心点;判断二维中心点是否处于二维区域内;若是,则检测到的目标物体落入视野空间。Optionally, the way of judging whether the detected target object falls into the first to N-1th view spaces in the view space queue may be: for each view space in the 1st to N-1th view spaces, set the Project the field of view space to the camera plane to obtain the two-dimensional area corresponding to the field of view space; project the three-dimensional center point of the detected target object to the camera plane to obtain the two-dimensional center point; determine whether the two-dimensional center point is in the two-dimensional area; , the detected target object falls into the visual field.
本实施例中,可以基于投影原理将视野空间投影至相机平面以及检测到的目标物体的三维中心点投影至相机平面。判断二维中心点是否处于二维区域内的方式可以是判断二维中心的坐标是否满足二维区域对应的函数集,若满足,则二维中心点处于二维区域内。若二维中心点处于二维区域内,则表明目标物体的三维中心点在视椎体内部,此时检测到的目标物体落入该视野空间。由三维中心点来表征目标物体可以极大的减少计算量。In this embodiment, the field of view space can be projected onto the camera plane and the detected three-dimensional center point of the target object can be projected onto the camera plane based on the projection principle. The way of judging whether the two-dimensional center point is in the two-dimensional area may be to judge whether the coordinates of the two-dimensional center satisfy the function set corresponding to the two-dimensional area, and if so, the two-dimensional center point is in the two-dimensional area. If the two-dimensional center point is in the two-dimensional area, it means that the three-dimensional center point of the target object is inside the viewing frustum, and the detected target object at this time falls into the visual field space. Representing the target object by the three-dimensional center point can greatly reduce the computational complexity.
可选的,判断检测到的目标物体是否落入视野空间队列中第1到第N-1个视野空间中的方式可以是:对于第1到第N-1个中的每个视野空间,获取检测到的目标物体的三维中心点分别与视野空间对应的多个边界面组成的多棱锥;计算多个多棱锥的体积和;若体积和与视野空间对应的视椎体的体积相等,则检测到的目标物体落入视野空间。Optionally, the method of judging whether the detected target object falls into the first to N-1th viewing spaces in the viewing space queue may be: for each viewing space in the first to N-1th viewing spaces, obtain The detected three-dimensional center point of the target object is a polygonal pyramid composed of multiple boundary surfaces corresponding to the visual field space; the volume sum of the multiple polygonal pyramids is calculated; if the volume is equal to the volume of the visual cone corresponding to the visual field space, the detection The arriving target object falls into the field of view space.
本实施例中,视野空间对应的视椎体由6个边界面围成,且每个面包含四个边,因此,三维中心点与每个边界面构成四棱锥,从而获得6个四棱锥。分别计算各四棱锥的体积,并将6个四棱锥的体积求和,若体积和与视椎体的体积相等,则表明目标物体的三维中心点在视椎体内部,此时检测到的目标物体落入该视野空间。In this embodiment, the viewing cone corresponding to the visual field space is surrounded by 6 boundary surfaces, and each surface includes four sides. Therefore, the three-dimensional center point and each boundary surface form a quadrangular pyramid, thereby obtaining 6 quadrangular pyramids. Calculate the volume of each quadrangular pyramid separately, and sum the volumes of the 6 quadrangular pyramids. If the volume sum is equal to the volume of the viewing cone, it means that the three-dimensional center point of the target object is inside the viewing cone, and the target detected at this time is Objects fall into this field of view.
S130,根据已渲染虚拟物体和视野空间队列确定待删除虚拟物体。S130: Determine the virtual object to be deleted according to the rendered virtual object and the view space queue.
本实施例中,若已渲染虚拟物体已有一段时间未检测到,则为了节省资源及内存,需要将这部分已渲染虚拟物体删除掉。In this embodiment, if the rendered virtual object has not been detected for a period of time, in order to save resources and memory, the rendered virtual object needs to be deleted.
具体的,根据已渲染虚拟物体和视野空间队列确定待删除虚拟物体的方式可以是:判断已渲染虚拟物体是否落入视野空间队列中最近设定数量的视野空间中;若否,则将已渲染虚拟物体确定为待删除虚拟物体。Specifically, the method of determining the virtual object to be deleted according to the rendered virtual object and the field of view space queue may be: judging whether the rendered virtual object falls into the recently set number of field of view spaces in the field of view space queue; The virtual object is determined to be the virtual object to be deleted.
其中,设定数量小于或者等于N,例如可以取N/2,示例性的,假设N为10,则设定数量可以取5。本实施例中,若已渲染虚拟物体在均为落入最近设定数量的视野空间中,则该已渲染虚拟物体为待删除虚拟物体。Wherein, the set number is less than or equal to N, for example, N/2 may be taken. For example, if N is 10, the set number may be five. In this embodiment, if the rendered virtual objects all fall into the field of view space of the most recently set number, the rendered virtual objects are virtual objects to be deleted.
可选的,判断已渲染虚拟物体是否落入视野空间中最近设定数量的视野空间中的方式可以是:对于视野空间队列中最近设定数量的每个视野空间,将视野空间投影至相机平面,获得视野空间对应的二维区域;将已渲染虚拟物体的三维中心点投影至相机平面,获得二维中心点;判断二维中心点是否处于二维区域内;若是,则已渲染虚拟物体落入视野空间。Optionally, the method of judging whether the rendered virtual object falls into the most recently set number of view spaces in the view space may be: for each view space of the most recently set number in the view space queue, project the view space to the camera plane. , obtain the two-dimensional area corresponding to the field of view space; project the three-dimensional center point of the rendered virtual object to the camera plane to obtain the two-dimensional center point; determine whether the two-dimensional center point is in the two-dimensional area; if so, the rendered virtual object falls into the field of vision.
本实施例中,可以基于投影原理将视野空间投影至相机平面以及已渲染虚拟物体的三维中心点投影至相机平面。判断二维中心点是否处于二维区域内的方式可以是判断二维中心的坐标是否满足二维区域对应的函数集,若满足,则二维中心点处于二维区域内。若二维中心点处于二维区域内,则表明已渲染虚拟物体的三维中心点在视椎体内部,此时检测到的已渲染虚拟物体落入该视野空间。由三维中心点来表征已渲染虚拟物体可以极大的减少计算量。In this embodiment, the visual field space can be projected to the camera plane and the three-dimensional center point of the rendered virtual object can be projected to the camera plane based on the projection principle. The way of judging whether the two-dimensional center point is in the two-dimensional area may be to judge whether the coordinates of the two-dimensional center satisfy the function set corresponding to the two-dimensional area, and if so, the two-dimensional center point is in the two-dimensional area. If the 2D center point is in the 2D area, it means that the 3D center point of the rendered virtual object is inside the viewing frustum, and the detected rendered virtual object at this time falls into the visual field space. Representing rendered virtual objects by 3D center points can greatly reduce the amount of computation.
可选的,判断已渲染虚拟物体是否落入视野空间中最近设定数量的视野空间中的方式可以是:对于视野空间队列中最近设定数量的每个视野空间,获取已渲染虚拟物体的三维中心点分别与视野空间对应的多个边界面围成的多棱锥;计算多个多棱锥的体积和;若体积和与视野空间对应的视椎体的体积相等,则已渲染虚拟物体落入视野空间。Optionally, the method of judging whether the rendered virtual object falls into the most recently set number of view spaces in the view space may be: for each view space of the most recently set number in the view space queue, obtain the three-dimensional view of the rendered virtual object. The center point is a polygonal pyramid surrounded by multiple boundary surfaces corresponding to the visual field; the volume sum of the multiple polygonal pyramids is calculated; if the volume is equal to the volume of the visual cone corresponding to the visual field, the rendered virtual object falls into the visual field space.
本实施例中,视野空间对应的视椎体由6个边界面围成,且每个面包含四个边,因此,三维中心点与每个边界面构成四棱锥,从而获得6个四棱锥。分别计算各四棱锥的体积,并将6个四棱锥的体积求和,若体积和与视椎体的体积相等,则表明已渲染虚拟物体的三维中心点在视椎体内部,此时已渲染虚拟物体落入该视野空间。In this embodiment, the viewing cone corresponding to the visual field space is surrounded by 6 boundary surfaces, and each surface includes four sides. Therefore, the three-dimensional center point and each boundary surface form a quadrangular pyramid, thereby obtaining 6 quadrangular pyramids. Calculate the volume of each quadrangular pyramid separately, and sum the volumes of the 6 quadrangular pyramids. If the volume sum is equal to the volume of the viewing frustum, it means that the 3D center point of the rendered virtual object is inside the viewing frustum, and the rendering has been done at this time. The virtual object falls into the field of view.
S140,根据待新增虚拟物体和待删除虚拟物体对当前关键帧对应的虚拟物体进行更新。S140: Update the virtual object corresponding to the current key frame according to the virtual object to be added and the virtual object to be deleted.
具体的,根据待新增虚拟物体和待删除虚拟物体对当前关键帧对应的虚拟物体进行更新的过程可以是:将待新增虚拟物体挂载于新增目标物体对应的位置,将待删除虚拟物体删除。Specifically, the process of updating the virtual object corresponding to the current key frame according to the virtual object to be added and the virtual object to be deleted may be as follows: mount the virtual object to be added at the position corresponding to the newly added target object; Object deletion.
在当前关键帧中,新增虚拟物体后的已渲染虚拟物体集合为其中,Pk表示更新后当前关键帧对应的已渲染虚拟物体,Dk表示新挂载的虚拟物体。In the current keyframe, the set of rendered virtual objects after adding virtual objects is: Among them, P k represents the rendered virtual object corresponding to the current key frame after the update, and D k represents the newly mounted virtual object.
在当前关键帧中,删除虚拟物体后的已渲染虚拟物体集合为:Pk=Pk-1∩(Q1∪Q2∪…∪QN),Pk表示更新后当前关键帧对应的已渲染虚拟物体。In the current key frame, the set of rendered virtual objects after deleting the virtual objects is: P k =P k-1 ∩(Q 1 ∪Q 2 ∪…∪Q N ), where P k represents the updated virtual objects corresponding to the current key frame after the update. Render virtual objects.
本公开实施例的技术方案,获取在当前关键帧检测到的目标物体以及当前关键帧对应的已渲染虚拟物体;其中,关键帧为触发物体检测的帧;根据检测到的目标物体和视野空间队列确定待新增虚拟物体;其中,视野空间队列由N个最近的关键帧对应的视野空间组成,当前关键帧为队列中第N个关键帧;根据已渲染虚拟物体和视野空间队列确定待删除虚拟物体;根据待新增虚拟物体和待删除虚拟物体对当前关键帧对应的虚拟物体进行更新。本公开实施例提供的图像处理方法,根据检测到的目标物体和视野空间队列确定待新增虚拟物体,根据已渲染虚拟物体和视野空间队列确定待删除虚拟物体,可以降低虚拟物体更新时的计算量,从而提高图像处理效率。According to the technical solution of the embodiment of the present disclosure, the target object detected in the current key frame and the rendered virtual object corresponding to the current key frame are acquired; wherein, the key frame is the frame that triggers object detection; according to the detected target object and the field of view space queue Determine the virtual object to be added; wherein, the field of view space queue consists of the field of view space corresponding to the N nearest key frames, and the current key frame is the Nth key frame in the queue; determine the virtual object to be deleted according to the rendered virtual object and the field of view space queue Object; the virtual object corresponding to the current key frame is updated according to the virtual object to be added and the virtual object to be deleted. The image processing method provided by the embodiment of the present disclosure determines the virtual object to be added according to the detected target object and the field of view space queue, and determines the virtual object to be deleted according to the rendered virtual object and the field of view space queue, which can reduce the calculation when the virtual object is updated. to improve image processing efficiency.
图4是本公开实施例公开的一种图像处理装置的结构示意图,如图4所示,该装置包括:FIG. 4 is a schematic structural diagram of an image processing apparatus disclosed in an embodiment of the present disclosure. As shown in FIG. 4 , the apparatus includes:
目标物体检测模块210,用于获取在当前关键帧检测到的目标物体以及当前关键帧对应的已渲染虚拟物体;其中,所述关键帧为触发物体检测的帧;The target
待新增虚拟物体确定模块220,用于根据所述检测到的目标物体和视野空间队列确定待新增虚拟物体;其中,所述视野空间队列由距离当前时刻最近的N个关键帧对应的视野空间组成,所述当前关键帧为队列中第N个关键帧;The virtual object to be added
待删除虚拟物体确定模块230,用于根据所述已渲染虚拟物体和所述视野空间队列确定待删除虚拟物体;The virtual object to be deleted
虚拟物体更新模块240,用于根据所述待新增虚拟物体和所述待删除虚拟物体对所述当前关键帧对应的虚拟物体进行更新。The virtual
可选的,待新增虚拟物体确定模块220,还用于:Optionally, the virtual
根据所述检测到的目标物体和视野空间队列确定新增目标物体;Determine the newly added target object according to the detected target object and the field of view space queue;
根据所述新增目标物体确定待新增虚拟物体;Determine the virtual object to be added according to the newly added target object;
可选的,虚拟物体更新模块240,还用于:Optionally, the virtual
将所述待新增虚拟物体挂载于所述新增目标物体对应的位置。Mount the virtual object to be added at a position corresponding to the newly added target object.
可选的,待新增虚拟物体确定模块220,还用于:Optionally, the virtual
判断检测到的目标物体是否落入所述视野空间队列中第1到第N-1个视野空间中至少一个;Determine whether the detected target object falls into at least one of the first to N-1th view spaces in the view space queue;
若否,则检测到的目标物体为新增目标物体;若是,则检测到的物体为旧目标物体。If not, the detected target object is a new target object; if so, the detected object is an old target object.
可选的,待删除虚拟物体确定模块230,还用于:Optionally, the virtual
判断所述已渲染虚拟物体是否落入所述视野空间队列中最近设定数量的视野空间中;Judging whether the rendered virtual object falls into the most recently set number of view spaces in the view space queue;
若否,则将所述已渲染虚拟物体确定为待删除虚拟物体;其中,所述设定数量小于或者等于N。If not, the rendered virtual object is determined as the virtual object to be deleted; wherein, the set number is less than or equal to N.
可选的,所述视野空间由视椎体表征,视椎体由多个边界面围成。Optionally, the visual field space is represented by a visual cone, and the visual cone is surrounded by a plurality of boundary surfaces.
可选的,待新增虚拟物体确定模块220,还用于:Optionally, the virtual
对于第1到第N-1个中的每个视野空间,将所述视野空间投影至相机平面,获得所述视野空间对应的二维区域;For each of the first to N-1th view spaces, project the view space to the camera plane to obtain a two-dimensional area corresponding to the view space;
将所述检测到的目标物体的三维中心点投影至相机平面,获得二维中心点;Projecting the three-dimensional center point of the detected target object to the camera plane to obtain a two-dimensional center point;
判断所述二维中心点是否处于所述二维区域内;Determine whether the two-dimensional center point is within the two-dimensional area;
若是,则所述检测到的目标物体落入所述视野空间。If so, the detected target object falls into the visual field space.
可选的,待新增虚拟物体确定模块220,还用于:Optionally, the virtual
对于第1到第N-1个中的每个视野空间,获取所述检测到的目标物体的三维中心点分别与所述视野空间对应的多个边界面组成的多棱锥;For each field of view space from the 1st to the N-1th, obtain a polygonal pyramid formed by the three-dimensional center point of the detected target object and a plurality of boundary surfaces corresponding to the field of view space;
计算多个多棱锥的体积和;Calculate the volume sum of multiple polygons;
若所述体积和与所述视野空间对应的视椎体的体积相等,则所述检测到的目标物体落入所述视野空间。If the volume is equal to the volume of the viewing cone corresponding to the viewing space, the detected target object falls into the viewing space.
可选的,待删除虚拟物体确定模块230,还用于:Optionally, the virtual
对于所述视野空间队列中最近设定数量的每个视野空间,将所述视野空间投影至相机平面,获得所述视野空间对应的二维区域;For each field of view space of the most recently set number in the field of view space queue, project the field of view space to the camera plane to obtain a two-dimensional area corresponding to the field of view space;
将所述已渲染虚拟物体的三维中心点投影至相机平面,获得二维中心点;Projecting the three-dimensional center point of the rendered virtual object to the camera plane to obtain a two-dimensional center point;
判断所述二维中心点是否处于所述二维区域内;Determine whether the two-dimensional center point is within the two-dimensional area;
若是,则所述已渲染虚拟物体落入所述视野空间。If so, the rendered virtual object falls into the view space.
可选的,待删除虚拟物体确定模块230,还用于:Optionally, the virtual
对于所述视野空间队列中最近设定数量的每个视野空间,获取所述已渲染虚拟物体的三维中心点分别与所述视野空间对应的多个边界面围成的多棱锥;For each view space of the most recently set number in the view space queue, obtain a polygonal pyramid formed by the three-dimensional center point of the rendered virtual object and a plurality of boundary surfaces corresponding to the view space respectively;
计算多个多棱锥的体积和;Calculate the volume sum of multiple polygons;
若所述体积和与所述视野空间对应的视椎体的体积相等,则所述已渲染虚拟物体落入所述视野空间。If the volume is equal to the volume of the frustum corresponding to the view space, the rendered virtual object falls into the view space.
上述装置可执行本公开前述所有实施例所提供的方法,具备执行上述方法相应的功能模块和有益效果。未在本实施例中详尽描述的技术细节,可参见本公开前述所有实施例所提供的方法。The above-mentioned apparatus can execute the methods provided by all the foregoing embodiments of the present disclosure, and has corresponding functional modules and beneficial effects for executing the above-mentioned methods. For technical details not described in detail in this embodiment, reference may be made to the methods provided by all the foregoing embodiments of the present disclosure.
下面参考图5,其示出了适于用来实现本公开实施例的电子设备300的结构示意图。本公开实施例中的电子设备可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端,或者各种形式的服务器,如独立服务器或者服务器集群。图5示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。Referring next to FIG. 5 , it shows a schematic structural diagram of an
如图5所示,电子设备300可以包括处理装置(例如中央处理器、图形处理器等)301,其可以根据存储在只读存储装置(ROM)302中的程序或者从存储装置305加载到随机访问存储装置(RAM)303中的程序而执行各种适当的动作和处理。在RAM 303中,还存储有电子设备300操作所需的各种程序和数据。处理装置301、ROM 302以及RAM 303通过总线304彼此相连。输入/输出(I/O)接口305也连接至总线304。As shown in FIG. 5, the
通常,以下装置可以连接至I/O接口305:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置306;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置307;包括例如磁带、硬盘等的存储装置308;以及通信装置309。通信装置309可以允许电子设备300与其他设备进行无线或有线通信以交换数据。虽然图5示出了具有各种装置的电子设备300,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。Typically, the following devices may be connected to the I/O interface 305:
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行词语的推荐方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置309从网络上被下载和安装,或者从存储装置305被安装,或者从ROM 302被安装。在该计算机程序被处理装置301执行时,执行本公开实施例的方法中限定的上述功能。In particular, according to embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing a recommended method of a word. In such an embodiment, the computer program may be downloaded and installed from the network via the
需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the above two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or a combination of any of the above. More specific examples of computer readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable Programmable read only memory (EPROM or flash memory), fiber optics, portable compact disk read only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing. In this disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present disclosure, however, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave with computer-readable program code embodied thereon. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device . Program code embodied on a computer readable medium may be transmitted using any suitable medium including, but not limited to, electrical wire, optical fiber cable, RF (radio frequency), etc., or any suitable combination of the foregoing.
在一些实施方式中,客户端、服务器可以利用诸如HTTP(HyperText TransferProtocol,超文本传输协议)之类的任何当前已知或未来研发的网络协议进行通信,并且可以与任意形式或介质的数字数据通信(例如,通信网络)互连。通信网络的示例包括局域网(“LAN”),广域网(“WAN”),网际网(例如,互联网)以及端对端网络(例如,ad hoc端对端网络),以及任何当前已知或未来研发的网络。In some embodiments, the client and server can communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and can communicate with digital data in any form or medium (eg, a communications network) interconnected. Examples of communication networks include local area networks ("LAN"), wide area networks ("WAN"), the Internet (eg, the Internet), and peer-to-peer networks (eg, ad hoc peer-to-peer networks), as well as any currently known or future development network of.
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。The above-mentioned computer-readable medium may be included in the above-mentioned electronic device; or may exist alone without being assembled into the electronic device.
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:获取在当前关键帧检测到的目标物体以及当前关键帧对应的已渲染虚拟物体;其中,所述关键帧为触发物体检测的帧;根据所述检测到的目标物体和视野空间队列确定待新增虚拟物体;其中,所述视野空间队列由距离当前时刻最近的N个关键帧对应的视野空间组成,所述当前关键帧为队列中第N个关键帧;根据所述已渲染虚拟物体和所述视野空间队列确定待删除虚拟物体;根据所述待新增虚拟物体和所述待删除虚拟物体对所述当前关键帧对应的虚拟物体进行更新。The above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, the electronic device is made to: acquire the target object detected in the current key frame and the rendered rendered corresponding to the current key frame A virtual object; wherein, the key frame is a frame that triggers object detection; the virtual object to be added is determined according to the detected target object and the field of view space queue; wherein, the field of view space queue consists of N closest to the current moment The view space corresponding to the key frame is composed, and the current key frame is the Nth key frame in the queue; the virtual object to be deleted is determined according to the rendered virtual object and the view space queue; according to the virtual object to be added and the The virtual object to be deleted updates the virtual object corresponding to the current key frame.
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括但不限于面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。Computer program code for performing operations of the present disclosure may be written in one or more programming languages, including but not limited to object-oriented programming languages—such as Java, Smalltalk, C++, and This includes conventional procedural programming languages - such as the "C" language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (eg, using an Internet service provider through Internet connection).
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code that contains one or more logical functions for implementing the specified functions executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It is also noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented in dedicated hardware-based systems that perform the specified functions or operations , or can be implemented in a combination of dedicated hardware and computer instructions.
描述于本公开实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,单元的名称在某种情况下并不构成对该单元本身的限定。The units involved in the embodiments of the present disclosure may be implemented in a software manner, and may also be implemented in a hardware manner. Among them, the name of the unit does not constitute a limitation of the unit itself under certain circumstances.
本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), Systems on Chips (SOCs), Complex Programmable Logical Devices (CPLDs) and more.
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in connection with the instruction execution system, apparatus or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media may include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media would include one or more wire-based electrical connections, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), fiber optics, compact disk read only memory (CD-ROM), optical storage, magnetic storage, or any suitable combination of the foregoing.
根据本公开实施例的一个或多个实施例,本公开实施例公开了一种图像处理方法,包括:According to one or more of the embodiments of the present disclosure, the embodiments of the present disclosure disclose an image processing method, including:
获取在当前关键帧检测到的目标物体以及当前关键帧对应的已渲染虚拟物体;其中,所述关键帧为触发物体检测的帧;Obtain the target object detected in the current key frame and the rendered virtual object corresponding to the current key frame; wherein, the key frame is the frame that triggers object detection;
根据所述检测到的目标物体和视野空间队列确定待新增虚拟物体;其中,所述视野空间队列由距离当前时刻最近的N个关键帧对应的视野空间组成,所述当前关键帧为队列中第N个关键帧;Determine the virtual object to be added according to the detected target object and the field of view space queue; wherein, the field of view space queue is composed of the field of view space corresponding to the N key frames closest to the current moment, and the current key frame is in the queue Nth keyframe;
根据所述已渲染虚拟物体和所述视野空间队列确定待删除虚拟物体;Determine the virtual object to be deleted according to the rendered virtual object and the view space queue;
根据所述待新增虚拟物体和所述待删除虚拟物体对所述当前关键帧对应的虚拟物体进行更新。The virtual object corresponding to the current key frame is updated according to the virtual object to be added and the virtual object to be deleted.
进一步地,根据所述检测到的目标物体和视野空间队列确定待新增虚拟物体,包括:Further, determining the virtual object to be added according to the detected target object and the field of view space queue, including:
根据所述检测到的目标物体和视野空间队列确定新增目标物体;Determine the newly added target object according to the detected target object and the field of view space queue;
根据所述新增目标物体确定待新增虚拟物体;Determine the virtual object to be added according to the newly added target object;
根据所述待新增虚拟物体对所述当前关键帧对应的虚拟物体进行更新,包括:Update the virtual object corresponding to the current key frame according to the virtual object to be added, including:
将所述待新增虚拟物体挂载于所述新增目标物体对应的位置。Mount the virtual object to be added at a position corresponding to the newly added target object.
进一步地,根据所述检测到的目标物体和视野空间队列确定新增目标物体,包括:Further, determining the newly added target object according to the detected target object and the field of view space queue, including:
判断检测到的目标物体是否落入所述视野空间队列中第1到第N-1个视野空间中;Determine whether the detected target object falls into the first to N-1th view spaces in the view space queue;
若否,则检测到的目标物体为新增目标物体;否则,检测到的物体为旧目标物体。If not, the detected target object is a new target object; otherwise, the detected object is an old target object.
进一步地,根据所述已渲染虚拟物体和所述视野空间队列确定待删除虚拟物体,包括:Further, determining the virtual object to be deleted according to the rendered virtual object and the field of view space queue, including:
判断所述已渲染虚拟物体是否落入所述视野空间队列中最近设定数量的视野空间中;Judging whether the rendered virtual object falls into the most recently set number of view spaces in the view space queue;
若否,则将所述已渲染虚拟物体确定为待删除虚拟物体;其中,所述设定数量小于或者等于N。If not, the rendered virtual object is determined as the virtual object to be deleted; wherein, the set number is less than or equal to N.
进一步地,所述视野空间由视椎体表征,视椎体由多个边界面围成。Further, the visual field space is represented by an optic cone, and the optic cone is surrounded by a plurality of boundary surfaces.
进一步地,判断检测到的目标物体是否落入所述视野空间队列中第1到第N-1个视野空间中,包括:Further, judging whether the detected target object falls into the first to N-1th view spaces in the view space queue, including:
对于第1到第N-1个中的每个视野空间,将所述视野空间投影至相机平面,获得所述视野空间对应的二维区域;For each of the first to N-1th view spaces, project the view space to the camera plane to obtain a two-dimensional area corresponding to the view space;
将所述检测到的目标物体的三维中心点投影至相机平面,获得二维中心点;Projecting the three-dimensional center point of the detected target object to the camera plane to obtain a two-dimensional center point;
判断所述二维中心点是否处于所述二维区域内;Determine whether the two-dimensional center point is within the two-dimensional area;
若是,则所述检测到的目标物体落入所述视野空间。If so, the detected target object falls into the visual field space.
进一步地,判断检测到的目标物体是否落入所述视野空间队列中第1到第N-1个视野空间中,包括:Further, judging whether the detected target object falls into the first to N-1th view spaces in the view space queue, including:
对于第1到第N-1个中的每个视野空间,获取所述检测到的目标物体的三维中心点分别与所述视野空间对应的多个边界面组成的多棱锥;For each field of view space from the 1st to the N-1th, obtain a polygonal pyramid formed by the three-dimensional center point of the detected target object and a plurality of boundary surfaces corresponding to the field of view space;
计算多个多棱锥的体积和;Calculate the volume sum of multiple polygons;
若所述体积和与所述视野空间对应的视椎体的体积相等,则所述检测到的目标物体落入所述视野空间。If the volume is equal to the volume of the viewing cone corresponding to the viewing space, the detected target object falls into the viewing space.
进一步地,判断所述已渲染虚拟物体是否落入所述视野空间中最近设定数量的视野空间中,包括:Further, judging whether the rendered virtual object falls into the most recently set number of view spaces in the view space, including:
对于所述视野空间队列中最近设定数量的每个视野空间,将所述视野空间投影至相机平面,获得所述视野空间对应的二维区域;For each field of view space of the most recently set number in the field of view space queue, project the field of view space to the camera plane to obtain a two-dimensional area corresponding to the field of view space;
将所述已渲染虚拟物体的三维中心点投影至相机平面,获得二维中心点;Projecting the three-dimensional center point of the rendered virtual object to the camera plane to obtain a two-dimensional center point;
判断所述二维中心点是否处于所述二维区域内;Determine whether the two-dimensional center point is within the two-dimensional area;
若是,则所述已渲染虚拟物体落入所述视野空间。If so, the rendered virtual object falls into the view space.
进一步地,判断所述已渲染虚拟物体是否落入所述视野空间中最近设定数量的视野空间中,包括:Further, judging whether the rendered virtual object falls into the most recently set number of view spaces in the view space, including:
对于所述视野空间队列中最近设定数量的每个视野空间,获取所述已渲染虚拟物体的三维中心点分别与所述视野空间对应的多个边界面围成的多棱锥;For each view space of the recently set number in the view space queue, obtain a polygonal pyramid formed by the three-dimensional center point of the rendered virtual object and a plurality of boundary surfaces corresponding to the view space respectively;
计算多个多棱锥的体积和;Calculate the volume sum of multiple polygons;
若所述体积和与所述视野空间对应的视椎体的体积相等,则所述已渲染虚拟物体落入所述视野空间。If the volume is equal to the volume of the frustum corresponding to the view space, the rendered virtual object falls into the view space.
注意,上述仅为本公开的较佳实施例及所运用技术原理。本领域技术人员会理解,本公开不限于这里所述的特定实施例,对本领域技术人员来说能够进行各种明显的变化、重新调整和替代而不会脱离本公开的保护范围。因此,虽然通过以上实施例对本公开进行了较为详细的说明,但是本公开不仅仅限于以上实施例,在不脱离本公开构思的情况下,还可以包括更多其他等效实施例,而本公开的范围由所附的权利要求范围决定。Note that the above are only preferred embodiments of the present disclosure and applied technical principles. Those skilled in the art will understand that the present disclosure is not limited to the specific embodiments described herein, and various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present disclosure. Therefore, although the present disclosure has been described in detail through the above embodiments, the present disclosure is not limited to the above embodiments, and can also include more other equivalent embodiments without departing from the concept of the present disclosure. The scope is determined by the scope of the appended claims.
Claims (12)
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210072428.1A CN114419292B (en) | 2022-01-21 | 2022-01-21 | Image processing method, device, equipment and storage medium |
PCT/CN2023/071878 WO2023138469A1 (en) | 2022-01-21 | 2023-01-12 | Image processing method and apparatus, device, and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210072428.1A CN114419292B (en) | 2022-01-21 | 2022-01-21 | Image processing method, device, equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114419292A true CN114419292A (en) | 2022-04-29 |
CN114419292B CN114419292B (en) | 2025-06-03 |
Family
ID=81274451
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210072428.1A Active CN114419292B (en) | 2022-01-21 | 2022-01-21 | Image processing method, device, equipment and storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN114419292B (en) |
WO (1) | WO2023138469A1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2023138469A1 (en) * | 2022-01-21 | 2023-07-27 | 北京字跳网络技术有限公司 | Image processing method and apparatus, device, and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106056534A (en) * | 2016-05-31 | 2016-10-26 | 中国科学院深圳先进技术研究院 | Obstruction perspective method and device based on smart glasses |
CN106484085A (en) * | 2015-08-31 | 2017-03-08 | 北京三星通信技术研究有限公司 | Method and its head mounted display of real-world object is shown in head mounted display |
US20190114841A1 (en) * | 2017-10-17 | 2019-04-18 | Colopl, Inc. | Method, program and apparatus for providing virtual experience |
CN109840947A (en) * | 2017-11-28 | 2019-06-04 | 广州腾讯科技有限公司 | Implementation method, device, equipment and the storage medium of augmented reality scene |
US20190279407A1 (en) * | 2018-03-07 | 2019-09-12 | Samsung Electronics Co., Ltd | System and method for augmented reality interaction |
Family Cites Families (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP6719945B2 (en) * | 2016-03-31 | 2020-07-08 | キヤノン株式会社 | Information processing apparatus, information processing method, information processing system, and program |
WO2017215899A2 (en) * | 2016-05-27 | 2017-12-21 | Holobuilder Inc, | Augmented and virtual reality |
WO2019213392A1 (en) * | 2018-05-02 | 2019-11-07 | Fyusion, Inc. | System and method for generating combined embedded multi-view interactive digital media representations |
CN111127637A (en) * | 2019-12-26 | 2020-05-08 | 四川航天神坤科技有限公司 | Data processing method and device of three-dimensional model and electronic equipment |
CN111127615A (en) * | 2019-12-26 | 2020-05-08 | 四川航天神坤科技有限公司 | Data scheduling method and device of three-dimensional model and electronic equipment |
CN111476911B (en) * | 2020-04-08 | 2023-07-25 | Oppo广东移动通信有限公司 | Virtual image realization method, device, storage medium and terminal equipment |
CN112365397A (en) * | 2020-11-20 | 2021-02-12 | 天津七所精密机电技术有限公司 | Method for fusing two-dimensional video information and three-dimensional geographic information |
CN114419292B (en) * | 2022-01-21 | 2025-06-03 | 北京字跳网络技术有限公司 | Image processing method, device, equipment and storage medium |
-
2022
- 2022-01-21 CN CN202210072428.1A patent/CN114419292B/en active Active
-
2023
- 2023-01-12 WO PCT/CN2023/071878 patent/WO2023138469A1/en active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106484085A (en) * | 2015-08-31 | 2017-03-08 | 北京三星通信技术研究有限公司 | Method and its head mounted display of real-world object is shown in head mounted display |
CN106056534A (en) * | 2016-05-31 | 2016-10-26 | 中国科学院深圳先进技术研究院 | Obstruction perspective method and device based on smart glasses |
US20190114841A1 (en) * | 2017-10-17 | 2019-04-18 | Colopl, Inc. | Method, program and apparatus for providing virtual experience |
CN109840947A (en) * | 2017-11-28 | 2019-06-04 | 广州腾讯科技有限公司 | Implementation method, device, equipment and the storage medium of augmented reality scene |
US20190279407A1 (en) * | 2018-03-07 | 2019-09-12 | Samsung Electronics Co., Ltd | System and method for augmented reality interaction |
Non-Patent Citations (2)
Title |
---|
孙超;张明敏;李扬;汤兴;潘志庚;: "增强现实环境下的人手自然交互", 计算机辅助设计与图形学学报, no. 04, 15 April 2011 (2011-04-15) * |
范广斌;: "虚拟现实技术在传媒业的应用与未来发展", 传媒, no. 06, 25 March 2020 (2020-03-25) * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2023138469A1 (en) * | 2022-01-21 | 2023-07-27 | 北京字跳网络技术有限公司 | Image processing method and apparatus, device, and storage medium |
Also Published As
Publication number | Publication date |
---|---|
WO2023138469A1 (en) | 2023-07-27 |
CN114419292B (en) | 2025-06-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111292406B (en) | Model rendering method, device, electronic equipment and medium | |
CN113205601B (en) | Roaming path generation method and device, storage medium and electronic equipment | |
CN114549722A (en) | Rendering method, device and equipment of 3D material and storage medium | |
WO2023029893A1 (en) | Texture mapping method and apparatus, device and storage medium | |
CN114494328A (en) | Image display method, image display device, electronic device, and storage medium | |
CN110321447A (en) | Determination method, apparatus, electronic equipment and the storage medium of multiimage | |
US20250104354A1 (en) | Virtual object generation method and apparatus, device, and storage medium | |
CN114598824A (en) | Method, device, device and storage medium for generating special effects video | |
WO2023138468A1 (en) | Virtual object generation method and apparatus, device, and storage medium | |
WO2023193639A1 (en) | Image rendering method and apparatus, readable medium and electronic device | |
WO2023174087A1 (en) | Method and apparatus for generating special effect video, and device and storage medium | |
CN114419292A (en) | Image processing method, device, equipment and storage medium | |
CN114863071A (en) | Target object labeling method and device, storage medium and electronic equipment | |
CN114332224A (en) | Method, device, device and storage medium for generating 3D target detection samples | |
WO2024174871A1 (en) | Image processing method and apparatus, device, and medium | |
CN112037280A (en) | Object distance measuring method and device | |
CN111862342A (en) | Augmented reality texture processing method, device, electronic device and storage medium | |
CN113204557B (en) | Spreadsheet import method, device, equipment and media | |
CN115272760A (en) | Small sample smoke image fine classification method suitable for forest fire smoke detection | |
CN112883757B (en) | Method for generating tracking attitude result | |
CN114470786A (en) | Frame synchronization data processing method and device, readable medium and electronic equipment | |
CN117079171A (en) | Method, device, electronic equipment and storage medium for determining key frame | |
CN113034570A (en) | Image processing method and device and electronic equipment | |
CN112395826B (en) | Text special effect processing method and device | |
CN114359673B (en) | Small sample smoke detection method, device and equipment based on metric learning |
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 |