CN116912463A - 3D virtual image processing method, device, electronic device and readable storage medium - Google Patents
3D virtual image processing method, device, electronic device and readable storage medium Download PDFInfo
- Publication number
- CN116912463A CN116912463A CN202310879539.8A CN202310879539A CN116912463A CN 116912463 A CN116912463 A CN 116912463A CN 202310879539 A CN202310879539 A CN 202310879539A CN 116912463 A CN116912463 A CN 116912463A
- Authority
- CN
- China
- Prior art keywords
- information
- target object
- virtual image
- virtual
- dynamic display
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 16
- 230000003993 interaction Effects 0.000 claims abstract description 125
- 238000000034 method Methods 0.000 claims abstract description 41
- 238000001514 detection method Methods 0.000 claims description 31
- 230000004044 response Effects 0.000 claims description 20
- 238000012545 processing Methods 0.000 claims description 11
- 238000013507 mapping Methods 0.000 claims description 2
- 230000036544 posture Effects 0.000 description 49
- 230000002452 interceptive effect Effects 0.000 description 36
- 230000000694 effects Effects 0.000 description 31
- 238000010586 diagram Methods 0.000 description 6
- 238000005516 engineering process Methods 0.000 description 6
- 230000008569 process Effects 0.000 description 6
- 230000006870 function Effects 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 238000004891 communication Methods 0.000 description 3
- 230000002093 peripheral effect Effects 0.000 description 3
- 238000012549 training Methods 0.000 description 3
- RAFGELQLHMBRHD-VFYVRILKSA-N Bixin Natural products COC(=O)C=CC(=C/C=C/C(=C/C=C/C=C(C)/C=C/C=C(C)/C=C/C(=O)O)/C)C RAFGELQLHMBRHD-VFYVRILKSA-N 0.000 description 2
- RAFGELQLHMBRHD-UHFFFAOYSA-N alpha-Fuc-(1-2)-beta-Gal-(1-3)-(beta-GlcNAc-(1-6))-GalNAc-ol Natural products COC(=O)C=CC(C)=CC=CC(C)=CC=CC=C(C)C=CC=C(C)C=CC(O)=O RAFGELQLHMBRHD-UHFFFAOYSA-N 0.000 description 2
- 239000001670 anatto Substances 0.000 description 2
- 235000012665 annatto Nutrition 0.000 description 2
- 230000003190 augmentative effect Effects 0.000 description 2
- RAFGELQLHMBRHD-SLEZCNMESA-N bixin Chemical compound COC(=O)\C=C\C(\C)=C/C=C/C(/C)=C/C=C/C=C(\C)/C=C/C=C(\C)/C=C/C(O)=O RAFGELQLHMBRHD-SLEZCNMESA-N 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000001960 triggered effect Effects 0.000 description 2
- 241001465754 Metazoa Species 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000005034 decoration Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000002996 emotional effect Effects 0.000 description 1
- 230000004807 localization Effects 0.000 description 1
- 230000001737 promoting effect Effects 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
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/20—Editing of 3D images, e.g. changing shapes or colours, aligning objects or positioning parts
-
- 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
Landscapes
- Engineering & Computer Science (AREA)
- Computer Graphics (AREA)
- Computer Hardware Design (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Architecture (AREA)
- Processing Or Creating Images (AREA)
Abstract
Description
技术领域Technical field
本申请属于计算机技术领域,具体涉及一种3D虚拟形象处理方法、装置、电子设备和可读存储介质。This application belongs to the field of computer technology, and specifically relates to a 3D virtual image processing method, device, electronic equipment and readable storage medium.
背景技术Background technique
随着动漫影视等的发展,二次元类的漫画、动漫、游戏等对用户的吸引力突飞猛进,而手办模型等具有收藏性的模型就是对于动漫形象的情感延伸。近年来,针对手办模型等实体玩具的收藏也越来越流行。但是,目前对于手办模型等这类实体玩具的玩法通常只是作为一个摆件,只是起到装饰的展示作用,展示效果单一,与用户之间的互动性也不够灵活。With the development of animation, film and television, two-dimensional comics, animations, games, etc. are increasingly attractive to users, and collectible models such as hand-made models are an emotional extension of animation images. In recent years, the collection of physical toys such as hand models has become increasingly popular. However, the current gameplay of physical toys such as hand models is usually just as a decoration, which only plays a decorative display role. The display effect is single, and the interaction with users is not flexible enough.
发明内容Contents of the invention
本申请实施例提供了一种3D虚拟形象处理方法、装置、电子设备和可读存储介质,能够解决相关技术中手办等实体玩具展示效果单一、与用户之间互动性不够灵活的问题。Embodiments of the present application provide a 3D virtual image processing method, device, electronic device and readable storage medium, which can solve the problems in related technologies of single display effect of physical toys such as figures and inflexible interaction with users.
第一方面,本申请实施例提供了一种3D虚拟形象处理方法,包括:In the first aspect, embodiments of the present application provide a 3D virtual image processing method, including:
获取包括目标对象的第一预览图像;Obtaining a first preview image including the target object;
根据所述第一预览图像确定第一信息,所述第一信息包括如下至少一项:所述目标对象在实际空间的第一空间位置、所述目标对象在实际空间的朝向、所述目标对象的数量、所述目标对象的姿态;First information is determined according to the first preview image, and the first information includes at least one of the following: the first spatial position of the target object in the actual space, the orientation of the target object in the actual space, the The number and posture of the target object;
基于所述第一信息确定所述目标对象对应的3D虚拟形象的交互信息和/或动态展示信息;Determine the interaction information and/or dynamic display information of the 3D virtual image corresponding to the target object based on the first information;
其中,所述交互信息用于实现所述3D虚拟形象与用户之间的交互,所述动态展示信息用于生成所述3D虚拟形象的动态展示画面。Wherein, the interaction information is used to realize the interaction between the 3D virtual image and the user, and the dynamic display information is used to generate a dynamic display screen of the 3D virtual image.
第二方面,本申请实施例提供了一种3D虚拟形象处理装置,包括:In the second aspect, embodiments of the present application provide a 3D virtual image processing device, including:
获取模块,用于获取包括目标对象的第一预览图像;An acquisition module, used to acquire the first preview image including the target object;
第一确定模块,用于根据所述第一预览图像确定第一信息,所述第一信息包括如下至少一项:所述目标对象在实际空间的第一空间位置、所述目标对象在实际空间的朝向、所述目标对象的数量、所述目标对象的姿态;A first determination module, configured to determine first information based on the first preview image, where the first information includes at least one of the following: a first spatial position of the target object in the actual space, a first spatial position of the target object in the actual space, The orientation, the number of the target objects, and the posture of the target objects;
第二确定模块,用于基于所述第一信息确定所述目标对象对应的3D虚拟形象的交互信息和/或动态展示信息;a second determination module, configured to determine the interaction information and/or dynamic display information of the 3D virtual image corresponding to the target object based on the first information;
其中,所述交互信息用于实现所述3D虚拟形象与用户之间的交互,所述动态展示信息用于生成所述3D虚拟形象的动态展示画面。Wherein, the interaction information is used to realize the interaction between the 3D virtual image and the user, and the dynamic display information is used to generate a dynamic display screen of the 3D virtual image.
第三方面,本申请实施例提供了一种电子设备,包括处理器和存储器,所述存储器存储可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如第一方面所述的3D虚拟形象处理方法的步骤。In a third aspect, embodiments of the present application provide an electronic device, including a processor and a memory. The memory stores programs or instructions that can be run on the processor. When the program or instructions are executed by the processor, The steps of implementing the 3D virtual image processing method as described in the first aspect.
第四方面,本申请实施例提供了一种可读存储介质,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如第一方面所述的3D虚拟形象处理方法的步骤。In the fourth aspect, embodiments of the present application provide a readable storage medium. Programs or instructions are stored on the readable storage medium. When the programs or instructions are executed by a processor, the 3D virtual image as described in the first aspect is realized. Processing method steps.
本申请实施例中,在获取到针对目标对象的第一预览图像后,根据所述第一预览图像确定第一信息,该第一信息包括所述目标对象在实际空间的第一空间位置、朝向、目标对象的数量和姿态中的至少一项,基于该第一信息确定所述目标对象对应的3D虚拟形象的交互信息和/或动态展示信息,所述交互信息能够实现所述3D虚拟形象与用户之间的交互,所述动态展示信息用于生成所述3D虚拟形象的动态展示画面。这样,也就能够对手办、玩具等这类目标对象设置相应的交互信息和/或动态展示信息,从而使得目标对象能够基于对应的3D虚拟形象实现与用户之间的交互,或是能够展示目标对象3D虚拟形象的动态展示画面,从而能够有效提升目标对象与用户之间的互动性,使得目标对象与用户之间的交互更为灵活,也能够有效丰富目标对象的展示效果,有效提升目标对象的用户体验度。In the embodiment of the present application, after obtaining the first preview image of the target object, the first information is determined based on the first preview image. The first information includes the first spatial position and orientation of the target object in the actual space. , at least one of the number and posture of the target object, determine the interactive information and/or dynamic display information of the 3D virtual image corresponding to the target object based on the first information, the interactive information can realize the interaction between the 3D virtual image and In the interaction between users, the dynamic display information is used to generate a dynamic display screen of the 3D virtual image. In this way, corresponding interactive information and/or dynamic display information can be set for target objects such as figures and toys, so that the target object can interact with the user based on the corresponding 3D virtual image, or can display the target The dynamic display screen of the object's 3D virtual image can effectively improve the interaction between the target object and the user, making the interaction between the target object and the user more flexible, and can also effectively enrich the display effect of the target object and effectively improve the target object. user experience.
附图说明Description of the drawings
图1是本申请实施例提供的一种3D虚拟形象处理方法的流程图;Figure 1 is a flow chart of a 3D virtual image processing method provided by an embodiment of the present application;
图2是本申请实施例中一种空间点云的示意图;Figure 2 is a schematic diagram of a spatial point cloud in an embodiment of the present application;
图3是本申请实施例提供的一种3D虚拟形象处理装置的结构图;Figure 3 is a structural diagram of a 3D virtual image processing device provided by an embodiment of the present application;
图4是本申请实施例提供的另一种3D虚拟形象处理装置的结构图;Figure 4 is a structural diagram of another 3D virtual image processing device provided by an embodiment of the present application;
图5是本申请实施例提供的一种电子设备的结构图。Figure 5 is a structural diagram of an electronic device provided by an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art fall within the scope of protection of this application.
本申请的说明书和权利要求书中的术语“第一”、“第二”等是用于区别类似的对象,而不用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施,且“第一”、“第二”等所区分的对象通常为一类,并不限定对象的个数,例如第一对象可以是一个,也可以是多个。此外,说明书以及权利要求中“和/或”表示所连接对象的至少其中之一,字符“/”,一般表示前后关联对象是一种“或”的关系。The terms "first", "second", etc. in the description and claims of this application are used to distinguish similar objects and are not used to describe a specific order or sequence. It is to be understood that the figures so used are interchangeable under appropriate circumstances so that the embodiments of the present application can be practiced in orders other than those illustrated or described herein, and that "first," "second," etc. are distinguished Objects are usually of one type, and the number of objects is not limited. For example, the first object can be one or multiple. In addition, "and/or" in the description and claims indicates at least one of the connected objects, and the character "/" generally indicates that the related objects are in an "or" relationship.
下面结合附图,通过具体的实施例及其应用场景对本申请实施例提供的3D虚拟形象处理方法、装置及电子设备等进行详细地说明。The 3D virtual image processing method, device and electronic equipment provided by the embodiments of the present application will be described in detail below with reference to the accompanying drawings through specific embodiments and application scenarios.
请参照图1,图1是本申请实施例提供的一种3D虚拟形象处理方法的流程图,所述方法应用于电子设备。如图1所示,所述方法包括以下步骤:Please refer to FIG. 1 , which is a flow chart of a 3D virtual image processing method provided by an embodiment of the present application. The method is applied to electronic devices. As shown in Figure 1, the method includes the following steps:
步骤101、获取包括目标对象的第一预览图像。Step 101: Obtain a first preview image including the target object.
需要说明地,本申请实施例中所涉及的对象可以是包括手办、玩偶等玩具或摆件,还可以是包括人或者动物等,例如所述对象可以是由人扮演(cosplay)的一些具体角色或形象等。其中,手办也可以称为首办或者首版,是一种以动漫电影电视,游戏角色为原型制作的高精度、小尺寸雕塑作品,原名套装模件(GARAGE KIT,GK)模型。手办通常是动漫、电影、游戏等的周边衍生品,是虚拟电影游戏角色形象在现实生活中的实物化。示例性地,所述目标对象可以是指一个或多个手办,例如可以是某个系列的所有手办。It should be noted that the objects involved in the embodiments of the present application may include toys or ornaments such as figures and dolls, and may also include people or animals. For example, the objects may be some specific roles cosplayed by people. or image etc. Among them, the figure can also be called the first model or the first edition. It is a high-precision, small-size sculpture based on animation, film, television, and game characters. It was originally called a GARAGE KIT (GK) model. Figures are usually peripheral derivatives of animation, movies, games, etc. They are the materialization of virtual movie and game character images in real life. For example, the target object may refer to one or more figures, for example, it may be all figures in a certain series.
本申请实施例中,可以是通过摄像头来获取针对目标对象的第一预览图像。例如,用户可以是开启电子设备的摄像头,将摄像头对准所述目标对象,进而摄像头的预览界面中也即会显示所述目标对象,从而以获取到针对所述目标对象的第一预览图像。In this embodiment of the present application, the first preview image of the target object may be obtained through a camera. For example, the user can turn on the camera of the electronic device and aim the camera at the target object, and then the target object will be displayed in the preview interface of the camera, thereby obtaining the first preview image of the target object.
步骤102、根据所述第一预览图像确定第一信息,所述第一信息包括如下至少一项:所述目标对象在实际空间的第一空间位置、所述目标对象在实际空间的朝向、所述目标对象的数量、所述目标对象的姿态。Step 102: Determine first information based on the first preview image. The first information includes at least one of the following: the first spatial position of the target object in the actual space, the orientation of the target object in the actual space, the Describe the number of target objects and the posture of the target object.
示例性地,电子设备在获取到针对目标对象的第一预览图像后,可以是以电子设备摄像头作为坐标原点建立空间坐标系,进而根据所述摄像头采集到的第一预览图像也就能够确定所述目标对象对应的第一信息,例如目标对象在该空间坐标系中的坐标位置,根据该坐标位置从而以确定所述目标对象的第一空间位置。其中,所述第一空间位置可以是包括所述目标对象在空间坐标系中的空间坐标和/或方位。For example, after acquiring the first preview image of the target object, the electronic device may establish a spatial coordinate system using the camera of the electronic device as the coordinate origin, and then determine the target object based on the first preview image collected by the camera. The first information corresponding to the target object, such as the coordinate position of the target object in the spatial coordinate system, is used to determine the first spatial position of the target object based on the coordinate position. Wherein, the first spatial position may include the spatial coordinates and/or orientation of the target object in a spatial coordinate system.
可以理解地,根据所述第一预览图像还可以是获得目标对象的数量、姿态或目标对象在实际空间的朝向等信息。It can be understood that information such as the number, posture, or orientation of the target object in the actual space may also be obtained based on the first preview image.
步骤103、基于所述第一信息确定所述目标对象对应的第一3D虚拟形象的交互信息和/或动态展示信息。Step 103: Determine the interaction information and/or dynamic display information of the first 3D virtual image corresponding to the target object based on the first information.
其中,所述交互信息用于实现所述3D虚拟形象与用户之间的交互,所述动态展示信息用于生成所述3D虚拟形象的动态展示画面。Wherein, the interaction information is used to realize the interaction between the 3D virtual image and the user, and the dynamic display information is used to generate a dynamic display screen of the 3D virtual image.
可选地,在确定所述目标对象在实际空间的第一空间位置后,可以是基于所述第一空间位置确定所述目标对象对应的第一3D虚拟形象在虚拟三维空间的第二空间位置。其中,所述虚拟三维空间可以是根据所述实际空间渲染得到的,或者,也可以是指定的虚拟三维空间。Optionally, after determining the first spatial position of the target object in the actual space, the second spatial position of the first 3D virtual image corresponding to the target object in the virtual three-dimensional space may be determined based on the first spatial position. . The virtual three-dimensional space may be rendered according to the actual space, or may be a specified virtual three-dimensional space.
例如,电子设备在基于摄像头采集的第一预览图像确定目标对象在实际空间的第一空间位置后,可以是根据所述第一预览图像渲染出一个与实际空间对应的虚拟三维空间,并根据所述目标对象在实际空间的第一空间位置,确定所述目标对象对应的3D虚拟形象在所述虚拟三维空间的第二空间位置。For example, after the electronic device determines the first spatial position of the target object in the actual space based on the first preview image collected by the camera, the electronic device may render a virtual three-dimensional space corresponding to the actual space based on the first preview image, and generate the virtual three-dimensional space according to the first preview image. The first spatial position of the target object in the actual space is determined, and the second spatial position of the 3D virtual image corresponding to the target object in the virtual three-dimensional space is determined.
或者,所述虚拟三维空间为指定的虚拟三维空间,电子设备可以是基于用户的输入操作来确定所述目标对象对应3D虚拟形象在该虚拟三维空间的第二空间位置。例如,电子设备在确定目标对象在实际空间的第一空间位置后,可以是以电子设备的显示界面作为指定的虚拟三维空间,进而以方便用户能够直观地获知该虚拟三维空间的所在。进一步地,用户可以是将所述目标对象对应的3D虚拟形象置于所述虚拟三维空间的第二空间位置,例如所述3D虚拟形象显示于电子设备的显示界面,电子设备可以是基于用户对所述3D虚拟形象的拖动操作,将所述3D虚拟形象置于所述虚拟三维空间的第二空间位置,进而使得对于3D虚拟形象的操作更为灵活方便。需要说明地,所述目标对象的3D虚拟形象可以是预先构建的。可选地,所述步骤103之前,所述方法还可以包括以下步骤:Alternatively, the virtual three-dimensional space is a designated virtual three-dimensional space, and the electronic device may determine the second spatial position of the 3D virtual image corresponding to the target object in the virtual three-dimensional space based on the user's input operation. For example, after determining the first spatial position of the target object in the actual space, the electronic device may use the display interface of the electronic device as the designated virtual three-dimensional space, so that the user can intuitively know the location of the virtual three-dimensional space. Further, the user may place the 3D virtual image corresponding to the target object at a second spatial position in the virtual three-dimensional space. For example, the 3D virtual image may be displayed on a display interface of an electronic device. The electronic device may display the 3D virtual image based on the user's response to the target object. The drag operation of the 3D virtual image places the 3D virtual image in the second spatial position of the virtual three-dimensional space, thereby making the operation of the 3D virtual image more flexible and convenient. It should be noted that the 3D virtual image of the target object may be pre-constructed. Optionally, before step 103, the method may also include the following steps:
获取环绕所述目标对象进行拍摄得到的多个图像帧;Obtaining multiple image frames obtained by shooting around the target object;
提取每一个所述图像帧的关键点,并将所述关键点映射至虚拟三维空间中,得到所述关键点在所述虚拟三维空间中的空间方位信息;Extract the key points of each image frame, map the key points to the virtual three-dimensional space, and obtain the spatial orientation information of the key points in the virtual three-dimensional space;
基于所述空间方位信息,构建所述目标对象在所述虚拟三维空间中的3D虚拟形象。Based on the spatial orientation information, a 3D virtual image of the target object in the virtual three-dimensional space is constructed.
需要说明地,为了能够让目标对象(例如手办)以3D虚拟形象出现在虚拟三维空间中,首先需要构建所述目标对象的三维空间点云。It should be noted that in order to allow a target object (such as a figure) to appear in a virtual three-dimensional space as a 3D virtual image, it is first necessary to construct a three-dimensional space point cloud of the target object.
本申请实施例中,可以是通过电子设备的摄像头(例如单目摄像头)环绕拍摄所述目标对象,得到所述目标对象不同角度的多个图像帧;进一步地,提取每一个图像帧的关键点,例如可以是基于同时定位与建图(Simultaneous Localization and Mapping,SLAM)技术提取每一帧图像帧的关键点,并将这些2D的关键点映射至虚拟三维空间中,形成空间中的点。再根据图像帧与图像帧之间的关键点匹配来得到不同关键点在虚拟三维空间中的空间方位信息,基于这些关键点的空间方位信息,构建出一个空间点云,进而以得到目标对象在虚拟三维空间中的3D虚拟形象。如图2所示,目标对象为水壶,基于上述方式也就能够构建出水壶的空间点云,从而得到水壶的3D虚拟形象。In the embodiment of the present application, the target object may be captured by a camera (such as a monocular camera) of an electronic device to obtain multiple image frames from different angles of the target object; further, the key points of each image frame may be extracted. For example, it can be based on Simultaneous Localization and Mapping (SLAM) technology to extract the key points of each image frame, and map these 2D key points to the virtual three-dimensional space to form points in the space. Then based on the key point matching between image frames, the spatial orientation information of different key points in the virtual three-dimensional space is obtained. Based on the spatial orientation information of these key points, a spatial point cloud is constructed, and then the target object is obtained. 3D virtual image in virtual three-dimensional space. As shown in Figure 2, the target object is a kettle. Based on the above method, the spatial point cloud of the kettle can be constructed, thereby obtaining the 3D virtual image of the kettle.
需要说明地,在目标对象为多个的情况下,可以是构建多个目标对象在同一虚拟三维空间各自对应的3D虚拟形象。例如,以目标对象为某个系列的手办为例,通常一个系列下会包括多个手办,且多个手办之间具有特定的摆放位置,也即这些手办在实际空间中具有特定的空间位置;这种情况下,可以是针对每个手办进行环绕拍摄得到该手办的多个图像帧,然后基于上述方式构建该手办的3D虚拟形象,基于该手办在实际空间中,在手办系列中的摆放位置,获取该手办在实际空间中的位置和朝向,将该手办的3D虚拟形象按照实际空间中的位置和朝向映射至指定的虚拟三维空间中的位置;基于这样的方式,构建手办系列下的多个手办各自对应的3D虚拟形象,并可以是将这些手办对应的3D虚拟形象按照其对应手办在实际空间的位置和方位,确定各3D虚拟形象在虚拟三维空间的位置和方位,也即这些手办各自对应的3D虚拟形象在虚拟三维空间中的位置和方位,与这些手办在实际空间中的位置和方位一致。例如某个手办A在实际空间中是位于手办B的左前方,则手办A对应的3D虚拟形象在虚拟三维空间中同样也位于手办B对应的3D虚拟形象左前方。It should be noted that when there are multiple target objects, 3D virtual images corresponding to the multiple target objects in the same virtual three-dimensional space may be constructed. For example, taking the target object of a certain series of figures as an example, a series usually includes multiple figures, and the multiple figures have specific placement positions, that is, these figures have certain characteristics in the actual space. A specific spatial position; in this case, you can perform surround shooting for each figure to obtain multiple image frames of the figure, and then build a 3D virtual image of the figure based on the above method, based on the position of the figure in the actual space In the figure series, the position and orientation of the figure in the actual space are obtained, and the 3D virtual image of the figure is mapped to the specified virtual three-dimensional space according to the position and orientation in the actual space. Position; Based on this method, the corresponding 3D virtual images of multiple figures in the figure series are constructed, and the 3D virtual images corresponding to these figures can be determined according to the position and orientation of the corresponding figures in the actual space. The position and orientation of each 3D virtual image in the virtual three-dimensional space, that is, the position and orientation of the corresponding 3D virtual image of these figures in the virtual three-dimensional space, are consistent with the position and orientation of these figures in the actual space. For example, if a certain figure A is located in front and left of figure B in the actual space, then the 3D avatar corresponding to figure A is also located in front and left of the 3D avatar corresponding to figure B in the virtual three-dimensional space.
可选地,在构建得到不同目标对象的3D虚拟形象后,电子设备可以是将这些3D虚拟形象存储至云端。进而,电子设备能够从云端获取不同目标对象对应的3D虚拟形象。Optionally, after constructing 3D virtual images of different target objects, the electronic device may store these 3D virtual images in the cloud. Furthermore, the electronic device can obtain 3D virtual images corresponding to different target objects from the cloud.
本申请实施例中,电子设备在确定第一信息后,基于所述第一信息,确定所述3D虚拟形象的交互信息和/或动态展示信息,可选地,所述交互信息和所述动态展示信息与所述第一信息相关。例如,针对同一个3D虚拟形象,该3D虚拟形象对应的目标对象在实际空间的不同的第一空间位置可以是对应不同的交互信息和/或动态展示信息,也即一个目标对象对应3D虚拟形象在虚拟三维空间可以是具有多个第二空间位置,针对不同的第二空间位置,可以是设置不同的交互信息和/或动态展示信息。In this embodiment of the present application, after determining the first information, the electronic device determines the interactive information and/or dynamic display information of the 3D virtual image based on the first information. Optionally, the interactive information and the dynamic display information Display information is related to the first information. For example, for the same 3D virtual image, the target object corresponding to the 3D virtual image may correspond to different interactive information and/or dynamic display information at different first spatial positions in the actual space, that is, one target object corresponds to the 3D virtual image. The virtual three-dimensional space may have multiple second spatial locations, and different interactive information and/or dynamic display information may be set for different second spatial locations.
或者,根据目标对象在实际空间的不同朝向,该目标对象对应的3D虚拟形象也可以是有不同的交互信息和/或动态展示信息。例如,目标对象的正面朝左的情况下,其3D虚拟形象对应的动态展示信息为向左旋转展示;目标对象的正面朝右的情况下,其3D虚拟形象对应的动态展示信息为向右旋转展示。Alternatively, according to different orientations of the target object in the actual space, the 3D virtual image corresponding to the target object may also have different interactive information and/or dynamic display information. For example, when the front of the target object is facing left, the dynamic display information corresponding to its 3D avatar is rotated to the left; when the front of the target object is facing right, the dynamic display information corresponding to its 3D avatar is rotated to the right. exhibit.
又如,3D虚拟形象的交互信息和/或动态展示信息还可以是与目标对象的数量相关。可选地,在所述第一信息包括所述目标对象的数量的情况下,所述基于所述第一信息确定所述目标对象对应的3D虚拟形象的交互信息和/或动态展示信息,包括:For another example, the interaction information and/or dynamic display information of the 3D virtual image may also be related to the number of target objects. Optionally, in the case where the first information includes the number of the target object, determining the interaction information and/or dynamic display information of the 3D virtual image corresponding to the target object based on the first information includes: :
根据所述目标对象的数量,确定所述目标对象的3D虚拟形象与所述数量对应的交互信息和/或动态展示信息。According to the number of the target objects, interaction information and/or dynamic display information corresponding to the 3D virtual image of the target object and the number are determined.
例如,若识别到第一预览图像中包括两个目标对象(例如可以是两个不同的手办,或者是相同的两个手办)时,基于两个目标对象各自对应的3D虚拟形象对应生成的动态展示画面为画面1;若识别到第一预览图像中包括三个目标对象,基于这三个目标对象各自对应的3D虚拟形象对应生成的动态展示画面为画面2。For example, if it is recognized that the first preview image includes two target objects (for example, they can be two different figures, or the same two figures), the 3D virtual images corresponding to the two target objects are correspondingly generated. The dynamic display screen is screen 1; if it is recognized that the first preview image includes three target objects, the dynamic display screen generated based on the 3D virtual images corresponding to the three target objects is screen 2.
进而,本申请实施例中,不同数量的目标对象,目标对象对应的3D虚拟形象的动态张氏信息和/或交互信息也就不同,这样也就更有助于吸引用户更多地收集目标对象,为用户提供更多的玩法,有效提升目标对象与用户之间的互动性。Furthermore, in the embodiments of the present application, with different numbers of target objects, the dynamic Zhang information and/or interactive information of the 3D virtual image corresponding to the target object will be different, which will be more helpful to attract users to collect more target objects. , providing users with more ways to play and effectively improving the interaction between target objects and users.
可选地,3D虚拟形象的交互信息和/或动态展示信息还可以是与目标对象的姿态有关。例如,若识别到第一预览图像中目标对象的姿态为立放姿态,该目标对象对应的3D虚拟形象可以是以站立的形象进行动态展示,若识别到目标对象的姿态为平放姿态,该目标对象对应的3D虚拟形象可以是以躺卧的形象进行动态展示,等等。Optionally, the interaction information and/or dynamic display information of the 3D virtual image may also be related to the posture of the target object. For example, if it is recognized that the posture of the target object in the first preview image is a standing posture, the 3D virtual image corresponding to the target object can be dynamically displayed in a standing image; if it is recognized that the posture of the target object is a lying posture, the 3D virtual image corresponding to the target object can be dynamically displayed. The 3D virtual image corresponding to the target object can be dynamically displayed as a lying image, etc.
需要说明地,所述第一信息可以是包括所述目标对象在实际空间的第一空间位置、所述目标对象在实际空间的朝向、所述目标对象的数量、所述目标对象的姿态中的至少一项,进而本申请实施例中所述第一信息的具体内容还可以是除上述之外的其他可能情况,3D虚拟形象的交互信息和/或动态展示信息也可以是其他的可能情况,此处不做过多列举。It should be noted that the first information may include the first spatial position of the target object in the actual space, the orientation of the target object in the actual space, the number of the target objects, and the posture of the target object. At least one item, and furthermore, the specific content of the first information in the embodiments of this application can also be other possible situations besides the above, and the interactive information and/or dynamic display information of the 3D virtual image can also be other possible situations, Not too many are listed here.
本申请实施例中,能够根据目标对象对应的第一信息,来确定对应的3D虚拟形象的交互信息和/或动态展示信息,从而使得目标对象能够基于对应的3D虚拟形象实现与用户之间的交互,或是能够展示目标对象3D虚拟形象的动态展示画面,从而能够有效提升目标对象与用户之间的互动性,有效提升了目标对象的用户体验度。In the embodiment of the present application, the interaction information and/or dynamic display information of the corresponding 3D virtual image can be determined according to the first information corresponding to the target object, so that the target object can realize interaction with the user based on the corresponding 3D virtual image. Interaction, or a dynamic display screen that can display the 3D virtual image of the target object, thereby effectively improving the interaction between the target object and the user, and effectively improving the user experience of the target object.
可选地,所述步骤103具体可以包括:Optionally, step 103 may specifically include:
获取第一输入信息;Get the first input information;
在基于所述第一信息确定所述3D虚拟形象在虚拟三维空间的第二空间位置的情况下,根据所述第一输入信息确定所述3D虚拟形象的交互信息和/或动态展示信息。When the second spatial position of the 3D virtual image in the virtual three-dimensional space is determined based on the first information, interaction information and/or dynamic display information of the 3D virtual image is determined based on the first input information.
其中,所述第一输入信息可以是指用户输入的相关信息,例如可以是用户输入的交互信息和/或动态展示信息。示例性地,在确定目标对象对应的3D虚拟形象在虚拟三维空间的第二空间位置后,电子设备可以是显示输入框,以获取用户的第一输入信息。The first input information may refer to relevant information input by the user, for example, it may be interactive information and/or dynamic display information input by the user. For example, after determining the second spatial position of the 3D virtual image corresponding to the target object in the virtual three-dimensional space, the electronic device may display an input box to obtain the user's first input information.
例如,以电子设备的显示界面作为指定的虚拟三维空间,在电子设备的显示界面显示目标对象对应的3D虚拟形象的情况下,显示界面还可以显示输入框,用户可以根据3D虚拟形象在显示界面的显示位置(也即第二空间位置),在输入框中输入相应的交互信息和/或动态展示信息。这样,电子设备根据用户输入的输入信息,也即能够确定3D虚拟形象的交互信息和/或动态展示信息。For example, the display interface of the electronic device is used as the designated virtual three-dimensional space. When the display interface of the electronic device displays a 3D virtual image corresponding to the target object, the display interface can also display an input box, and the user can enter the 3D virtual image in the display interface based on the 3D virtual image. display position (that is, the second spatial position), enter the corresponding interactive information and/or dynamic display information in the input box. In this way, the electronic device can determine the interactive information and/or dynamic display information of the 3D virtual image based on the input information input by the user.
可选地,所述目标对象对应的3D虚拟形象在虚拟三维空间包括至少一个第二空间位置,不同的所述第二空间位置对应不同的交互信息和/或不同的动态展示信息。例如,3D虚拟形象位于位置A时,用户可以是输入第一交互信息和第一动态展示信息,3D虚拟形象位于位置B时,用户可以是输入第二交互信息和第二动态展示信息,进而也就能够确定3D虚拟形象在不同第二空间位置各自对应的交互信息和/或动态展示信息。这样,对于某个目标对象的3D虚拟形象,根据其所处的空间位置,也就具有不同的交互信息和/或动态展示信息,从而能够有效丰富该3D虚拟形象与用户之间的交互,和/或使得3D虚拟形象的动态展示画面更加多样和丰富,为用户带来更好的互动体验。Optionally, the 3D virtual image corresponding to the target object includes at least one second spatial position in the virtual three-dimensional space, and different second spatial positions correspond to different interaction information and/or different dynamic display information. For example, when the 3D virtual image is located at position A, the user can input the first interaction information and the first dynamic display information. When the 3D virtual image is located at the position B, the user can input the second interaction information and the second dynamic display information, and then also It is possible to determine the corresponding interactive information and/or dynamic display information of the 3D virtual image in different second space positions. In this way, the 3D virtual image of a certain target object will have different interactive information and/or dynamic display information according to its spatial position, thereby effectively enriching the interaction between the 3D virtual image and the user, and /Or make the dynamic display of 3D virtual images more diverse and rich, bringing a better interactive experience to users.
可选地,在所述目标对象的数量为至少两个的情况下,至少两个所述目标对象各自对应的3D虚拟形象在虚拟三维空间包括至少一个相对位置关系,不同的所述相对位置关系对应不同的交互信息和/或不同的动态展示信息。例如,以目标对象为某个系列的多个手办为例,若该系列手办包括手办1、手办2和手办3,手办1可以有两个不同第二空间位置,手办2也有两个而不同第二空间位置,则手办1和手办2之间可以是具有四个相对位置关系,这四个相对位置关系可以是分别对应四种不同的交互信息和/或四种不同的动态展示信息;相应地,手办1和手办3之间也可以是具有至少一个相对位置关系,手办2和手办3之间也可以是具有至少一个相对位置关系,以及手办1、手办2和手办3之间也可以是具有至少一个相对位置关系,不同的相对位置关系都可以是对应不同的交互信息和/或不同的动态展示信息。这样,对于多个3D虚拟形象之间的不同的相对位置关系,也就具有不同的交互信息和/或动态展示信息,从而能够有效丰富3D虚拟形象与用户之间的交互和/或动态展示效果,为用户带来更好的互动体验。Optionally, when the number of the target objects is at least two, the 3D virtual images corresponding to the at least two target objects include at least one relative position relationship in the virtual three-dimensional space. Different relative position relationships Correspond to different interactive information and/or different dynamic display information. For example, take the target object of multiple figures of a certain series as an example. If the series of figures includes figure 1, figure 2 and figure 3, figure 1 can have two different second space positions. 2 also has two but different second spatial positions, then there can be four relative position relationships between figure 1 and figure 2. These four relative position relationships can respectively correspond to four different interactive information and/or four Different dynamic display information; accordingly, there can be at least one relative position relationship between figure 1 and figure 3, there can also be at least one relative position relationship between figure 2 and figure 3, and there can be at least one relative position relationship between figure 1 and figure 3, and Figure 1, Figure 2 and Figure 3 may also have at least one relative position relationship, and different relative position relationships may correspond to different interactive information and/or different dynamic display information. In this way, for different relative position relationships between multiple 3D virtual images, there will be different interactive information and/or dynamic display information, which can effectively enrich the interaction and/or dynamic display effects between the 3D virtual image and the user. , bringing a better interactive experience to users.
需要说明的是,这些交互信息和/或动态展示信息可以是基于用户的输入信息来确定。It should be noted that these interactive information and/or dynamic display information may be determined based on user input information.
本申请实施例中,在获取到针对目标对象的第一预览图像后,根据所述第一预览图像确定第一信息,该第一信息包括所述目标对象在实际空间的第一空间位置、朝向、目标对象的数量和姿态中的至少一项,基于该第一信息确定所述目标对象对应的3D虚拟形象的交互信息和/或动态展示信息,所述交互信息能够实现所述3D虚拟形象与用户之间的交互,所述动态展示信息用于生成所述3D虚拟形象的动态展示画面。这样,也就能够对手办、玩具等这类目标对象设置相应的交互信息和/或动态展示信息,从而使得目标对象能够基于对应的3D虚拟形象实现与用户之间的交互,或是能够展示目标对象3D虚拟形象的动态展示画面,从而能够有效提升目标对象与用户之间的互动性,有效提升了目标对象的用户体验度。In the embodiment of the present application, after obtaining the first preview image of the target object, the first information is determined based on the first preview image. The first information includes the first spatial position and orientation of the target object in the actual space. , at least one of the number and posture of the target object, determine the interactive information and/or dynamic display information of the 3D virtual image corresponding to the target object based on the first information, the interactive information can realize the interaction between the 3D virtual image and In the interaction between users, the dynamic display information is used to generate a dynamic display screen of the 3D virtual image. In this way, corresponding interactive information and/or dynamic display information can be set for target objects such as figures and toys, so that the target object can interact with the user based on the corresponding 3D virtual image, or can display the target The dynamic display screen of the object's 3D virtual image can effectively enhance the interaction between the target object and the user, and effectively improve the user experience of the target object.
可选地,本申请实施例中,所述步骤104之后,所述方法还可以包括:Optionally, in this embodiment of the present application, after step 104, the method may further include:
基于所述动态展示信息生成并展示所述3D虚拟形象的动态展示画面;和/或,Generate and display a dynamic display screen of the 3D virtual image based on the dynamic display information; and/or,
在获取到用户交互指令的情况下,基于所述交互信息生成响应指令,以通过所述响应指令实现所述3D虚拟形象与用户之间的交互。When a user interaction instruction is obtained, a response instruction is generated based on the interaction information, so as to realize interaction between the 3D virtual image and the user through the response instruction.
本申请实施例中,在确定目标对象对应的3D虚拟形象的动态展示信息后,则电子设备能够基于所述动态展示信息生成并展示所述3D虚拟形象的动态展示画面。例如,电子设备可以是在接收到用户的输入操作的情况下,如对特定按键的触发操作,或是用户的语音输入等,则电子设备生成并展示目标对象对应的3D虚拟形象的动态展示画面。其中,所述动态展示画面可以是指所述3D虚拟形象以动态方式进行展示,例如所述3D虚拟形象可以是以一定的速度按照特定方向进行旋转或是移动等。进而,通过生成并展示所述3D虚拟形象的动态展示画面,也就使得所述目标对象能够以3D虚拟形象进行动态展示,从而有效提升目标对象的互动性和观赏性,为用户带来更好的使用体验。In the embodiment of the present application, after determining the dynamic display information of the 3D virtual image corresponding to the target object, the electronic device can generate and display the dynamic display screen of the 3D virtual image based on the dynamic display information. For example, when the electronic device receives the user's input operation, such as the triggering operation of a specific button, or the user's voice input, the electronic device generates and displays a dynamic display screen of the 3D virtual image corresponding to the target object. . The dynamic display screen may mean that the 3D virtual image is displayed in a dynamic manner. For example, the 3D virtual image may rotate or move in a specific direction at a certain speed. Furthermore, by generating and displaying the dynamic display screen of the 3D virtual image, the target object can be dynamically displayed in the 3D virtual image, thereby effectively improving the interactivity and viewing of the target object, and bringing better results to users. usage experience.
或者,在确定目标对象对应的3D虚拟形象的交互信息后,若接收到用户的交互指令,根据所述交互信息生成用于响应所述交互指令的响应指令,以实现3D虚拟形象与用户之间的交互。其中,所述交互指令包括如下至少一项:触控交互指令、手势交互指令、语音交互指令。Or, after determining the interaction information of the 3D virtual image corresponding to the target object, if an interaction instruction from the user is received, a response instruction for responding to the interaction instruction is generated according to the interaction information, so as to realize the relationship between the 3D virtual image and the user. interaction. Wherein, the interaction instructions include at least one of the following: touch interaction instructions, gesture interaction instructions, and voice interaction instructions.
例如,若接收到用户的语音交互指令,如“你好”,则电子设备可以是基于交互信息生成相应的响应指令,如所述响应指令为控制3D虚拟形象旋转或跳跃等,从而以对用户的语音交互指令进行响应,以实现与用户之间的交互。又例如,若通过摄像头获取到用户的手势交互指令,如招手,电子设备可以是基于交互信息生成相应的响应指令,如控制3D虚拟形象招手(若3D虚拟形象为人物形象),从而以实现3D虚拟形象与用户之间的交互。这样,也就能够有效提升3D虚拟形象与用户之间的互动性,为用户带来更好的互动体验。For example, if the user's voice interaction instruction is received, such as "Hello", the electronic device can generate a corresponding response instruction based on the interaction information. For example, the response instruction is to control the 3D virtual image to rotate or jump, etc., so as to respond to the user. Respond to voice interaction instructions to achieve interaction with the user. For another example, if the user's gesture interaction instructions, such as waving, are obtained through the camera, the electronic device can generate corresponding response instructions based on the interactive information, such as controlling the 3D virtual image to wave (if the 3D avatar is a character), thereby realizing 3D Interaction between avatar and user. In this way, the interaction between the 3D virtual image and the user can be effectively improved, and a better interactive experience can be brought to the user.
需要说明的是,针对不同交互指令,电子设备可以是预先设置用于生成对应的响应指令的交互信息,进而在获取到交互指令的情况下,电子设备也就能够确定需要基于哪些交互信息来生成对应的响应指令,从而以实现对交互指令的响应。例如,对于不同的手势动作,比如招手、握拳、比心等之类的手势动作,可以是预先设置不同的交互信息,从而根据不同的交互信息来生成不同的响应指令,如招手对应的交互信息用于控制3D虚拟形象生成招手的响应指令,比心对应的交互信息用于控制3D虚拟形象生成比心的响应指令。这样,也就能够通过不同的交互信息来生成对不同交互指令进行响应的响应指令,以确保3D虚拟形象能够对用户的不同交互指令都能够实现准确而有效的交互,使得3D虚拟形象与用户之间能够实现更丰富多样的互动。It should be noted that for different interaction instructions, the electronic device can be pre-set to generate interaction information for corresponding response instructions. Then, when the interaction instructions are obtained, the electronic device can also determine which interaction information needs to be generated based on Corresponding response instructions to implement responses to interactive instructions. For example, for different gesture actions, such as waving, making fists, comparing hearts, etc., different interactive information can be set in advance, so that different response instructions can be generated based on different interactive information, such as interactive information corresponding to waving. It is used to control the 3D virtual image to generate response instructions for waving, and the interactive information corresponding to Bixin is used to control the 3D virtual image to generate response instructions for Bixin. In this way, response instructions that respond to different interaction instructions can be generated through different interaction information, so as to ensure that the 3D virtual image can achieve accurate and effective interaction with the user's different interaction instructions, so that the 3D virtual image can interact effectively with the user. can achieve richer and more diverse interactions.
本申请实施例中,在确定目标对象对应的3D虚拟形象的动态展示信息后,用户可以通过电子设备扫描所述目标对象,以使电子设备生成并展示动态展示画面。In the embodiment of the present application, after determining the dynamic display information of the 3D virtual image corresponding to the target object, the user can scan the target object through the electronic device, so that the electronic device generates and displays the dynamic display screen.
示例性地,用户可以是通过电子设备的摄像头来扫描待识别对象。在电子设备启动摄像头的情况下,会显示摄像头采集到的预览图像,若将摄像头对准待识别对象,则所述预览图像中也即会显示所述待识别对象。For example, the user may scan the object to be identified through a camera of the electronic device. When the electronic device starts the camera, the preview image collected by the camera will be displayed. If the camera is pointed at the object to be identified, the object to be identified will also be displayed in the preview image.
需要说明地,所述待识别对象可以是已经确定或者说设置了动态展示信息的目标对象;本申请实施例中,可以是基于前述方式对多个目标对象建立其对应的3D虚拟形象的动态展示信息,所述目标对象及对应的3D虚拟形象的动态展示信息可以是存储于电子设备本地或者是云端。电子设备在基于摄像头获取到预览图像中的待识别对象的情况下,可以是将所述待识别对象与目标对象进行比对,或者可以是调用云端存储的目标对象来进行比对。若所述待识别对象与已经建立了D3虚拟形象动态展示信息的目标对象匹配,则将所述目标对象的3D虚拟形象作为所述待识别对象的3D虚拟形象。It should be noted that the object to be identified may be a target object for which dynamic display information has been determined or set; in the embodiment of the present application, it may be a dynamic display of corresponding 3D virtual images established for multiple target objects based on the foregoing method. Information, the dynamic display information of the target object and the corresponding 3D virtual image may be stored locally on the electronic device or in the cloud. When the electronic device obtains an object to be recognized in the preview image based on the camera, it may compare the object to be recognized with the target object, or it may call the target object stored in the cloud for comparison. If the object to be recognized matches the target object for which D3 virtual image dynamic display information has been established, the 3D virtual image of the target object is used as the 3D virtual image of the object to be recognized.
例如,若目标对象包括动漫角色A的手办,电子设备已经确定了该手办的3D虚拟形象的动态展示信息。之后,当用户通过电子设备摄像头扫描待识别对象,并通过比对确定该待识别对象也即动漫角色A的手办,则获取该手办对应的3D虚拟形象以及对应的动态展示信息,基于该手办的3D虚拟形象的动态展示信息生成动态展示画面,并展示该动态展示画面。这样,也就能够通过扫描手办等对象,来生成并展示该对象对应的3D虚拟形象的动态展示画面,为用户带来更好的互动体验,有助于提升用户对手办等对象的收集和观赏兴趣,从而促进这些手办等对象的消费。For example, if the target object includes a figure of anime character A, the electronic device has determined the dynamic display information of the 3D virtual image of the figure. Afterwards, when the user scans the object to be identified through the electronic device camera and determines through comparison that the object to be identified is the figure of anime character A, the 3D virtual image corresponding to the figure and the corresponding dynamic display information are obtained. Based on the The dynamic display information of the 3D virtual image of the figure generates a dynamic display screen, and displays the dynamic display screen. In this way, objects such as figures can be scanned to generate and display a dynamic display of the 3D virtual image corresponding to the object, bringing a better interactive experience to users and helping to improve the user's collection and collection of figures and other objects. viewing interest, thereby promoting the consumption of these figures and other objects.
可选地,所述获取包括目标对象的第一预览图像,包括:Optionally, the obtaining includes a first preview image of the target object, including:
在显示第一预览图像的情况下,在所述第一预览图像中生成识别框;When the first preview image is displayed, generating an identification frame in the first preview image;
获取所述第一预览图像的所述识别框中的目标对象。Obtain the target object in the recognition frame of the first preview image.
本申请实施例中,在电子设备启动摄像头并显示第一预览图像的情况下,可以是在所述第一预览图像中生成识别框,通过该识别框来引导用户调整摄像头的采集方位和角度,从而以使得目标对象位于该识别框内。或者,也可以是通过该识别框来捕捉目标对象,以使得目标对象位于该识别框内,从而以更好地来对目标对象进行定位。电子设备可以是通过识别框的位置来确定目标对象的空间位置,进而能够确定是对哪个位置的目标对象进行检测识别。In the embodiment of the present application, when the electronic device starts the camera and displays the first preview image, an identification frame may be generated in the first preview image, and the identification frame may be used to guide the user to adjust the collection orientation and angle of the camera. Thus, the target object is located within the recognition frame. Alternatively, the target object may be captured through the recognition frame so that the target object is located within the recognition frame, thereby better positioning the target object. The electronic device may determine the spatial position of the target object through the position of the recognition frame, and thereby determine which position of the target object is to be detected and recognized.
需要说明地,在目标对象为多个的情况下,可以是分别针对每个目标对象生成识别框,或者也可以是针对所有的目标对象生成一个识别框。例如,若目标对象为多个,且这些目标对象都属于同一系列的手办,则可以是生成一个识别框,进而将这些同一系列的手办定位于一个识别框内,并可以是通过该系列手办对应的目标检测模型来进行识别和检测。It should be noted that when there are multiple target objects, the identification frame may be generated for each target object respectively, or one identification frame may be generated for all target objects. For example, if there are multiple target objects, and these target objects all belong to the same series of figures, an identification frame can be generated, and then these figures of the same series can be positioned in an identification frame, and the figures of the same series can be positioned through the identification frame. The target detection model corresponding to the figure is used for identification and detection.
可选地,所述获取包括目标对象的第一预览图像,包括:Optionally, the obtaining includes a first preview image of the target object, including:
在显示第一预览图像的情况下,获取所述第一预览图像中的待识别对象;When the first preview image is displayed, obtain the object to be recognized in the first preview image;
获取所述待识别对象所属的对象类别;Obtain the object category to which the object to be identified belongs;
基于所述对象类别确定目标检测模型;Determine a target detection model based on the object category;
在所述目标检测模型识别所述待识别对象与目标对象匹配的情况下,将所述待识别对象作为所述目标对象,以获取包括所述目标对象的第一预览图像,其中,不同的对象类别对应不同的所述目标检测模型。When the target detection model recognizes that the object to be recognized matches the target object, the object to be recognized is used as the target object to obtain a first preview image including the target object, wherein different objects Categories correspond to different target detection models.
示例性地,以所述待识别对象为待识别手办为例,首先获取所述待识别手办所属的对象类别,也即属于哪个手办系列。可选地,可以是根据用户的输入来确定所属的对象类别。可以理解地,对于待识别手办,用户可以自主确认该待识别手办属于哪个手办系列,电子设备可以是显示有对象类别选择框,用户可以是在该选择框中来选择对应的手办系列,从而电子设备能够基于用户的输入来确定待识别手办所属的手办系列,也即确定待识别对象所属的对象类别。For example, assuming that the object to be recognized is a figure to be recognized, first the object category to which the figure to be recognized belongs is obtained, that is, which figure series it belongs to. Optionally, the object category to which the object belongs may be determined based on user input. Understandably, for a figure to be identified, the user can independently confirm which figure series the figure to be identified belongs to. The electronic device can display an object category selection box, and the user can select the corresponding figure in the selection box. series, so that the electronic device can determine the figure series to which the figure to be recognized belongs based on the user's input, that is, determine the object category to which the object to be recognized belongs.
进一步地,电子设备根据所述对象类别确定对应的目标检测模型,不同的对象类别对应不同的目标检测模型,进而通过对应的目标检测模型来检测所述待识别对象是否与目标对象匹配。例如,针对不同的手办系列,电子设备可以是预先训练并存储与每个手办系列对应的目标检测模型,进而针对某个手办系列下的手办,则通过该手办系列对应的目标检测模型来进行识别。需要说明地,各目标检测模型可以是使用对应的手办系列下的各手办的相关数据训练而成,例如可以是通过采集各手办不同角度、不同方位、不同姿态等情况下的图像数据作为训练数据,以对目标检测模型进行训练,进而使得训练后的目标检测模型能够识别对应手办系列下的手办,从而以提升对待识别手办的识别准确率。其中,所述目标检测模型的训练数据中也即包括目标对象的图像数据。Further, the electronic device determines a corresponding target detection model according to the object category. Different object categories correspond to different target detection models, and then detects whether the object to be identified matches the target object through the corresponding target detection model. For example, for different figure series, the electronic device can pre-train and store the target detection model corresponding to each figure series, and then for a figure under a certain figure series, the target corresponding to the figure series can be used detection model for identification. It should be noted that each target detection model can be trained using the relevant data of each figure under the corresponding figure series. For example, it can be collected by collecting image data of each figure at different angles, different orientations, different postures, etc. It is used as training data to train the target detection model, so that the trained target detection model can recognize the figures in the corresponding figure series, thereby improving the recognition accuracy of the figures to be recognized. Wherein, the training data of the target detection model also includes image data of the target object.
本申请实施例中,通过对不同的对象类别分别训练对应的目标检测模型,进而能够基于待识别对象所属的对象类别,调用与该对象类别对应的目标检测模型来识别待识别对象是否与目标对象匹配,从而能够有效提升对待识别对象的识别准确率。In the embodiment of the present application, by training corresponding target detection models for different object categories, the target detection model corresponding to the object category can be called to identify whether the object to be identified is the same as the target object based on the object category to which the object to be identified belongs. matching, which can effectively improve the recognition accuracy of the object to be identified.
可选地,,在所述第一信息包括所述目标对象的姿态的情况下,所述方法还包括:Optionally, in the case where the first information includes the posture of the target object, the method further includes:
获取所述目标对象的姿态,所述目标对象的姿态包括立放姿态和平放姿态;Obtaining the posture of the target object, the posture of the target object includes a standing posture and a lying posture;
基于所述目标对象对应的3D虚拟形象的动态展示信息,展示所述3D虚拟形象与所述立放姿态或所述平放姿态匹配的动态展示画面。Based on the dynamic display information of the 3D virtual image corresponding to the target object, a dynamic display picture matching the 3D virtual image with the standing posture or the flat posture is displayed.
可以理解地,目标对象可以是有不同的姿态,例如平放姿态或立方姿态。假设所述目标对象处于平放姿态,在基于所述目标对象对应的3D虚拟形象的动态展示信息生成动态展示画面后,可以是展示所述3D虚拟形象与平放姿态匹配的动态展示画面,例如该3D虚拟形象也以平放姿态进行动态展示。It can be understood that the target object may have different postures, such as a flat posture or a cubic posture. Assuming that the target object is in a flat posture, after generating a dynamic display screen based on the dynamic display information of the 3D virtual image corresponding to the target object, a dynamic display screen matching the 3D virtual image and the flat posture may be displayed, for example The 3D virtual image is also dynamically displayed in a flat posture.
其中,所述目标对象的姿态,可以是根据目标对象的宽高大小来进行判断,如果高度大于宽度,可以认为目标对象处于立放姿态,如果高度小于宽度,可以认为目标对象处于平放姿态。The posture of the target object can be determined based on the width and height of the target object. If the height is greater than the width, the target object can be considered to be in an upright posture. If the height is less than the width, the target object can be considered to be in a flat posture.
本申请实施例中,通过获取目标对象的姿态,从而能够展示3D虚拟形象与所述姿态匹配的动态展示画面,从而有效提升了3D虚拟形象动态展示画面的丰富性和灵活性。In the embodiment of the present application, by obtaining the posture of the target object, a dynamic display picture of the 3D virtual image matching the posture can be displayed, thereby effectively improving the richness and flexibility of the dynamic display picture of the 3D virtual image.
为更好地理解,以下以目标对象及待识别对象为手办为例,对本申请实施例提供的3D虚拟形象处理方法进行具体说明,所述3D虚拟形象处理方法包括以下步骤:For better understanding, the following takes the target object and the object to be identified as figures as examples to specifically describe the 3D virtual image processing method provided by the embodiment of the present application. The 3D virtual image processing method includes the following steps:
步骤1、预先构建每个手办系列(或手办类型)的各个手办对应的3D虚拟形象。Step 1. Pre-construct the 3D virtual image corresponding to each figure of each figure series (or figure type).
其中,该步骤1具体包括如下步骤:Among them, step 1 specifically includes the following steps:
步骤11、构建手办的空间点云。Step 11. Construct a spatial point cloud of the figure.
可以理解地,为了能够让手办的虚拟形象出现在3D空间中,首先需要建立手办的三维空间点云。例如,可以是采用空间SLAM技术,通过单目摄像头环绕手办拍摄,然后基于SLAM技术提取拍摄的每一帧图像帧的关键点,并将这些2D的关键点映射到3维空间中,形成空间中的点,再根据帧与帧之间的额关键点匹配来得到不同关键点在空间中方位,以此构建一个空间点云。如图2所示,基于上述方式构建水壶的空间点云。Understandably, in order to allow the virtual image of the figure to appear in 3D space, it is first necessary to establish a three-dimensional space point cloud of the figure. For example, spatial SLAM technology can be used to surround the figure with a monocular camera, and then the key points of each captured image frame can be extracted based on SLAM technology, and these 2D key points can be mapped into a 3-dimensional space to form a space points in the frame, and then obtain the orientation of different key points in space based on the key point matching between frames, thereby constructing a spatial point cloud. As shown in Figure 2, the spatial point cloud of the kettle is constructed based on the above method.
步骤12、构建手办3D虚拟形象。Step 12. Construct a 3D virtual image of the figure.
获取手办的空间坐标与方位,示例性地,可以在指定的空间坐标摆放事先设计好的手办3D虚拟形象并将其渲染到空间中的指定坐标。Obtain the spatial coordinates and orientation of the figure. For example, you can place a pre-designed 3D virtual image of the figure at the specified spatial coordinates and render it to the specified coordinates in the space.
步骤13、手办3D虚拟形象的渲染。Step 13. Rendering of the 3D virtual image of the figure.
用户通过手机客户端的相机对准手办,客户端就会自动识别到手办的空间坐标,并在相机显示界面中手办的前方渲染出一个三维的动态虚拟形象。The user aims at the figure through the camera of the mobile client, and the client will automatically recognize the spatial coordinates of the figure and render a three-dimensional dynamic virtual image in front of the figure in the camera display interface.
步骤2、在指定的虚拟空间坐标与方位上放置各个手办的3D虚拟形象。Step 2. Place the 3D virtual image of each figure at the specified virtual space coordinates and orientation.
其中,每个手办3D虚拟形象可以具有一个以上的指定位置,两个以上手办3D虚拟形象之间具有一个以上的相对位置关系(或者位置范围)。Each 3D virtual image of the figure can have more than one designated position, and there is more than one relative position relationship (or position range) between two or more 3D virtual figures of the figure.
步骤3、根据各个手办之间的虚拟空间坐标关系与方位关系,设置各个手办3D虚拟形象之间的交互逻辑和对应的动态展示效果。Step 3. Based on the virtual space coordinate relationship and orientation relationship between each figure, set the interaction logic and corresponding dynamic display effect between the 3D virtual images of each figure.
可选地,两个以上手办3D虚拟形象之间位于第一位置范围内时设置第一交互逻辑和第一动态展示效果;两个以上手办3D虚拟形象之间位于第二位置范围内时设置第二交互逻辑和第二动态展示效果;以此类推,不同位置关系的手办3D虚拟形象之间设置不同的交互逻辑和动态展示效果。Optionally, the first interaction logic and the first dynamic display effect are set when two or more 3D virtual figures of the figures are located within the first position range; when the two or more 3D virtual figures of the figures are located within the second position range, Set the second interaction logic and the second dynamic display effect; and by analogy, set different interaction logic and dynamic display effects between the 3D virtual images of the figures with different positional relationships.
进一步地,对同一个手办系列的各个手办设置不同的手办型号。不同手办型号的3D虚拟形象之间设置不同的交互逻辑和动态展示效果。Furthermore, different figure models are set for each figure in the same figure series. Different interaction logic and dynamic display effects are set between the 3D virtual images of different figure models.
在一些实施例中,以上3D虚拟形象之间还可以是交互逻辑相同,仅动态展示效果不同,或者交互逻辑不同,动态展示效果也不同,等。In some embodiments, the above 3D virtual images may have the same interaction logic but different dynamic display effects, or may have different interaction logic and different dynamic display effects, etc.
其中,交互逻辑包括但不限于:点触交互、手势交互、语音交互等;Among them, the interaction logic includes but is not limited to: touch interaction, gesture interaction, voice interaction, etc.;
动态展示效果包括但不限于:3D虚拟形象动作、3D虚拟形象特效等,所述动态展示效果渲染在相机显示界面中所述手办的对应位置,例如前方或周边位置。Dynamic display effects include but are not limited to: 3D avatar actions, 3D avatar special effects, etc. The dynamic display effects are rendered at the corresponding position of the figure in the camera display interface, such as the front or peripheral position.
步骤4、对用户收集的手办进行环绕拍摄,获取手办类型、各个手办之间的空间坐标与方位信息;并根据拍摄获取的手办类型,调用预先构建的手办3D虚拟形象,根据拍摄获取的各个手办之间的实际空间坐标与方位信息将所述手办3D虚拟形象放置于对应的虚拟空间坐标与方位。Step 4. Take a surround shot of the figures collected by the user to obtain the figure type, spatial coordinates and orientation information between each figure; and based on the type of figure obtained through the shooting, call the pre-built 3D virtual image of the figure, and based on The actual space coordinates and orientation information between each figure obtained by shooting are placed to place the 3D virtual image of the figure at the corresponding virtual space coordinates and orientation.
所述手办3D虚拟形象、各个3D虚拟形象之间的空间坐标关系与方位关系、各个3D虚拟形象之间的交互逻辑和对应的动态展示效果,可以是均存储于云端;用户通过客户端与云端进行通信连接和数据交互。The 3D virtual image of the figure, the spatial coordinate relationship and orientation relationship between each 3D virtual image, the interaction logic between each 3D virtual image, and the corresponding dynamic display effect can all be stored in the cloud; the user communicates with the 3D virtual image through the client The cloud performs communication connections and data interaction.
用户通过手机客户端能够看到在现实空间中出现的手办,客户端可以通过手机摄像头获取用户的手势,并通过AI能力识别用户的手势类型,比如招手、握拳、比心之类的动作,根据识别到的手势动作,让手办3D虚拟形象摆出相对应的动作,以此来达到互动的效果。Users can see the figures appearing in the real space through the mobile phone client. The client can obtain the user's gestures through the mobile phone camera, and use AI capabilities to identify the user's gesture type, such as waving, making fists, comparing heart movements, etc. According to the recognized gesture movements, the 3D virtual image of the figure is allowed to perform corresponding movements to achieve an interactive effect.
对于同一个手办系列,如果用户收集的手办越齐全,其能够展示的动态效果就越丰富;例如,如果仅拍摄单一手办,则可触发显示该单一手办对应的3D虚拟形象和交互动作;如果拍摄两个以上手办,则可触发该组手办对应的3D虚拟形象、各个手办的交互动作、以及各个手办之间的交互动作。For the same figure series, if the user collects more complete figures, the richer dynamic effects it can display; for example, if only a single figure is photographed, the display of the 3D virtual image and interaction corresponding to the single figure can be triggered. Action; if you shoot two or more figures, the 3D virtual image corresponding to the set of figures, the interactive actions of each figure, and the interactive actions between each figure can be triggered.
步骤5、实现手办3D虚拟形象与用户之间的互动。Step 5. Realize the interaction between the 3D virtual image of the figure and the user.
在一些实现场景中,可以是根据手办的收集个数、不同型号的组合,解锁各个手办3D虚拟形象的增强现实(augmented reality,AR)效果。In some implementation scenarios, the augmented reality (AR) effect of the 3D virtual image of each figure can be unlocked based on the collection number of figures and the combination of different models.
示例性地,首先用户需要选择要识别的系列手办,根据所选系列调用对应的识别模型;其次,通过在相机预览界面生成识别框引导用户在指定的识别框中识别手办。一般情况下,根据所选择手办系列,会自动在相机预览界面中划定识别区域(也即生成识别框),用户需要将待识别手办置于识别框内。进一步地,调用该系列手办对应的目标检测模型,检测识别框内的手办。该目标检测模型是使用对应的手办型号的数据专门训练而成,能够特定识别系列中的每个手办,并返回识别框中出现的手办类型以及手办个数。假设当前这个手办系列有八款手办型号,则该目标检测模型的输入就是检测框内的图像,输出结果就是检测框内的手办的外包矩形框,以及其对应在八类手办型号中的哪一类。根据检测结果返回的手办类型以及手办个数来调取云端对应各个手办型号的3D虚拟形象,获取各个手办型号的3D虚拟形象的空间坐标,并在对应的空间坐标上展示所述3D虚拟形象,生成AR特效。假如当前识别到的手办有3款,则用户可以选择观看3款手办对应的3D虚拟形象达成的AR特效,也即3款手办对应的3D虚拟形象的动态展示效果,和/或与用户之间交互的动态展示效果,和/或三款3D虚拟形象之间的交互动态效果;用户也可以选择只观看其中一款对应的AR特效。如果用户首次集齐了全部型号手办,显示全收集达成的AR特效,如全部手办型号各自对应的3D虚拟形象的动态展示效果,这些3D虚拟形象之间能够基于预先设置的交互逻辑生成动态展示画面;相应地,在识别到用户首次集齐了全部型号手办的情况下,可以是生成相应成就徽章,以提升用户的收集兴趣。For example, first, the user needs to select a series of figures to be recognized, and call the corresponding recognition model according to the selected series; secondly, the user is guided to identify the figures in the specified recognition box by generating a recognition frame on the camera preview interface. Under normal circumstances, according to the selected figure series, the recognition area will be automatically delimited in the camera preview interface (that is, a recognition frame will be generated), and the user needs to place the figure to be recognized in the recognition frame. Further, the target detection model corresponding to the series of figures is called to detect the figures within the recognition frame. This target detection model is specially trained using the data of the corresponding figure models. It can specifically identify each figure in the series and return the type and number of figures that appear in the recognition box. Assuming that there are currently eight figure models in this series of figures, the input of the target detection model is the image in the detection frame, and the output result is the outer rectangular frame of the figure in the detection frame, and its corresponding figure in the eight types of figures. In which category. According to the type and number of figures returned by the detection results, the 3D virtual image corresponding to each figure model is retrieved from the cloud, the spatial coordinates of the 3D virtual image of each figure model are obtained, and the above information is displayed on the corresponding spatial coordinates. 3D virtual image, generate AR special effects. If there are 3 figures currently recognized, the user can choose to watch the AR special effects achieved by the 3D avatars corresponding to the 3 figures, that is, the dynamic display effect of the 3D avatars corresponding to the 3 figures, and/or with The dynamic display effect of interaction between users, and/or the dynamic effect of interaction between three 3D virtual images; users can also choose to only watch the corresponding AR special effects of one of them. If the user collects all models of figures for the first time, the AR special effects achieved by the entire collection will be displayed, such as the dynamic display effect of the 3D virtual images corresponding to all the figure models. These 3D virtual images can generate dynamics based on preset interaction logic. Display screen; accordingly, when it is recognized that the user has collected all models of figures for the first time, corresponding achievement badges can be generated to enhance the user's interest in collecting.
在一些实现场景中,还可以是根据手办的摆放姿态,展示不同的动态展示画面。例如根据手办立放或平放姿态,相应展示立放或平放的3D虚拟形象,以丰富手办3D虚拟形象的展示效果。In some implementation scenarios, different dynamic display screens can also be displayed according to the posture of the figures. For example, according to the standing or flat posture of the figure, the 3D virtual image of the standing or flat display is displayed accordingly to enrich the display effect of the 3D virtual image of the figure.
本申请实施例还提供了一种3D虚拟形象处理装置。请参照图3,图3是本申请实施例提供的一种3D虚拟形象处理装置的结构图,如图3所示,3D虚拟形象处理装置300包括:An embodiment of the present application also provides a 3D virtual image processing device. Please refer to Figure 3, which is a structural diagram of a 3D virtual image processing device provided by an embodiment of the present application. As shown in Figure 3, the 3D virtual image processing device 300 includes:
获取模块301,用于获取包括目标对象的第一预览图像;Acquisition module 301, used to acquire a first preview image including the target object;
第一确定模块302,用于根据所述第一预览图像确定第一信息,所述第一信息包括如下至少一项:所述目标对象在实际空间的第一空间位置、所述目标对象在实际空间的朝向、所述目标对象的数量、所述目标对象的姿态;The first determination module 302 is configured to determine first information according to the first preview image. The first information includes at least one of the following: the first spatial position of the target object in the actual space, the first spatial position of the target object in the actual space. The orientation of the space, the number of the target objects, and the posture of the target objects;
第二确定模块303,用于基于所述第一信息确定所述目标对象对应的3D虚拟形象的交互信息和/或动态展示信息;The second determination module 303 is configured to determine the interaction information and/or dynamic display information of the 3D virtual image corresponding to the target object based on the first information;
其中,所述交互信息用于实现所述3D虚拟形象与用户之间的交互,所述动态展示信息用于生成所述3D虚拟形象的动态展示画面。Wherein, the interaction information is used to realize the interaction between the 3D virtual image and the user, and the dynamic display information is used to generate a dynamic display screen of the 3D virtual image.
可选地,请进一步参照图4,所述装置还包括执行模块304,用于:Optionally, please further refer to Figure 4. The device also includes an execution module 304 for:
基于所述动态展示信息生成并展示所述3D虚拟形象的动态展示画面;和/或,Generate and display a dynamic display screen of the 3D virtual image based on the dynamic display information; and/or,
在获取到用户交互指令的情况下,基于所述交互信息生成响应指令,以通过所述响应指令实现所述3D虚拟形象与用户之间的交互。When a user interaction instruction is obtained, a response instruction is generated based on the interaction information, so as to realize interaction between the 3D virtual image and the user through the response instruction.
可选地,所述获取模块301还用于:Optionally, the acquisition module 301 is also used to:
在显示第一预览图像的情况下,在所述第一预览图像中生成识别框;When the first preview image is displayed, generating an identification frame in the first preview image;
获取所述第一预览图像的所述识别框中的目标对象。Obtain the target object in the recognition frame of the first preview image.
可选地,所述获取模块301还用于:Optionally, the acquisition module 301 is also used to:
在显示第一预览图像的情况下,获取所述第一预览图像中的待识别对象;When the first preview image is displayed, obtain the object to be recognized in the first preview image;
获取所述待识别对象所属的对象类别;Obtain the object category to which the object to be identified belongs;
基于所述对象类别确定目标检测模型;Determine a target detection model based on the object category;
在所述目标检测模型识别所述待识别对象与目标对象匹配的情况下,将所述待识别对象作为所述目标对象,以获取包括所述目标对象的第一预览图像,其中,不同的对象类别对应不同的所述目标检测模型。When the target detection model recognizes that the object to be recognized matches the target object, the object to be recognized is used as the target object to obtain a first preview image including the target object, wherein different objects Categories correspond to different target detection models.
可选地,在所述第一信息包括所述目标对象的姿态的情况下,所述执行模块还用于:Optionally, in the case where the first information includes the posture of the target object, the execution module is further configured to:
获取所述目标对象的姿态,所述目标对象的姿态包括立放姿态和平放姿态;Obtaining the posture of the target object, the posture of the target object includes a standing posture and a lying posture;
基于所述目标对象对应的3D虚拟形象的动态展示信息,展示所述3D虚拟形象与所述立放姿态或所述平放姿态匹配的动态展示画面。Based on the dynamic display information of the 3D virtual image corresponding to the target object, a dynamic display picture matching the 3D virtual image with the standing posture or the flat posture is displayed.
可选地,在所述第一信息包括所述目标对象的数量的情况下,所述第二确定模块303还用于:Optionally, in the case where the first information includes the number of target objects, the second determination module 303 is also used to:
根据所述目标对象的数量,确定所述目标对象的3D虚拟形象与所述数量对应的交互信息和/或动态展示信息。According to the number of the target objects, interaction information and/or dynamic display information corresponding to the 3D virtual image of the target object and the number are determined.
可选地,所述目标对象对应的3D虚拟形象在虚拟三维空间包括至少一个第二空间位置,不同的所述第二空间位置对应不同的交互信息和/或不同的动态展示信息;和/或,Optionally, the 3D virtual image corresponding to the target object includes at least one second spatial position in the virtual three-dimensional space, and different second spatial positions correspond to different interaction information and/or different dynamic display information; and/or ,
在所述目标对象的数量为至少两个的情况下,至少两个所述目标对象各自对应的3D虚拟形象在虚拟三维空间包括至少一个相对位置关系,不同的所述相对位置关系对应不同的交互信息和/或不同的动态展示信息。When the number of the target objects is at least two, the 3D virtual images corresponding to the at least two target objects include at least one relative position relationship in the virtual three-dimensional space, and different relative position relationships correspond to different interactions. information and/or different dynamic display information.
可选地,所述装置还包括构建模块,用于:Optionally, the device further includes a building module for:
获取环绕所述目标对象进行拍摄得到的多个图像帧;Obtaining multiple image frames obtained by shooting around the target object;
提取每一个所述图像帧的关键点,并将所述关键点映射至虚拟三维空间中,获取所述关键点在所述虚拟三维空间中的空间方位信息;Extract the key points of each image frame, map the key points to the virtual three-dimensional space, and obtain the spatial orientation information of the key points in the virtual three-dimensional space;
基于所述空间方位信息,构建所述目标对象在所述虚拟三维空间中的3D虚拟形象。Based on the spatial orientation information, a 3D virtual image of the target object in the virtual three-dimensional space is constructed.
可选地,所述第二确定模块303还用于:Optionally, the second determination module 303 is also used to:
获取第一输入信息;Get the first input information;
在基于所述第一信息确定所述3D虚拟形象在虚拟三维空间的第二空间位置的情况下,根据所述第一输入信息确定所述3D虚拟形象的交互信息和/或动态展示信息。When the second spatial position of the 3D virtual image in the virtual three-dimensional space is determined based on the first information, interaction information and/or dynamic display information of the 3D virtual image is determined based on the first input information.
本申请实施例中,所述装置能够对手办、玩具等这类目标对象设置相应的交互信息和/或动态展示信息,从而使得目标对象能够基于对应的3D虚拟形象实现与用户之间的交互,或是能够展示目标对象3D虚拟形象的动态展示画面,从而能够有效提升目标对象与用户之间的互动性,使得目标对象与用户之间的交互更为灵活,也能够有效丰富目标对象的展示效果,有效提升目标对象的用户体验度。In the embodiment of the present application, the device can set corresponding interaction information and/or dynamic display information for target objects such as figures, toys, etc., so that the target object can interact with the user based on the corresponding 3D virtual image. Or a dynamic display screen that can display the 3D virtual image of the target object, which can effectively improve the interaction between the target object and the user, make the interaction between the target object and the user more flexible, and also effectively enrich the display effect of the target object. , effectively improve the user experience of the target object.
本申请实施例中的3D虚拟形象处理装置300可以是电子设备,也可以是电子设备中的部件,例如集成电路或芯片。该电子设备可以是终端,也可以为除终端之外的其他设备。示例性的,电子设备可以为手机、平板电脑、笔记本电脑、掌上电脑、车载电子设备、移动上网装置(Mobile Internet Device,MID)、增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR)设备、机器人、可穿戴设备、超级移动个人计算机(ultra-mobilepersonal computer,UMPC)、上网本或者个人数字助理(personal digital assistant,PDA)等,本申请实施例不作具体限定。The 3D virtual image processing device 300 in the embodiment of the present application may be an electronic device or a component of the electronic device, such as an integrated circuit or a chip. The electronic device may be a terminal or other devices other than the terminal. For example, the electronic device may be a mobile phone, a tablet computer, a notebook computer, a handheld computer, a vehicle-mounted electronic device, a mobile Internet device (MID), or augmented reality (AR)/virtual reality (VR). ) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook or personal digital assistant (personal digital assistant, PDA), etc., the embodiments of this application are not specifically limited.
本申请实施例中的3D虚拟形象处理装置300可以为具有操作系统的装置。该操作系统可以为安卓(Android)操作系统,可以为ios操作系统,还可以为其他可能的操作系统,本申请实施例不作具体限定。The 3D virtual image processing device 300 in the embodiment of the present application may be a device with an operating system. The operating system can be an Android operating system, an ios operating system, or other possible operating systems, which are not specifically limited in the embodiments of this application.
本申请实施例提供的3D虚拟形象处理装置300能够实现图1所述方法实施例实现的各个过程,并能达到相同的技术效果,为避免重复,这里不再赘述。The 3D virtual image processing device 300 provided by the embodiment of the present application can implement each process implemented by the method embodiment described in Figure 1 and can achieve the same technical effect. To avoid duplication, the details will not be described here.
本申请实施例还提供了一种电子设备。请参见图5,图5是本申请实施例提供的一种电子设备的结构图,如图5所示,所述电子设备包括:处理器400、存储器420及存储在所述存储器420上并可在所述处理器400上运行的程序或指令,处理器400,用于读取存储器420中的程序或指令;所述电子设备还包括总线接口和收发机410。An embodiment of the present application also provides an electronic device. Please refer to Figure 5. Figure 5 is a structural diagram of an electronic device provided by an embodiment of the present application. As shown in Figure 5, the electronic device includes: a processor 400, a memory 420 and data stored on the memory 420 and capable of The program or instructions run on the processor 400, and the processor 400 is used to read the program or instructions in the memory 420; the electronic device also includes a bus interface and a transceiver 410.
收发机410,用于在处理器400的控制下接收和发送数据。Transceiver 410 for receiving and transmitting data under the control of processor 400.
其中,在图5中,总线架构可以包括任意数量的互联的总线和桥,具体由处理器400代表的一个或多个处理器和存储器420代表的存储器的各种电路链接在一起。总线架构还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路链接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口提供接口。收发机410可以是多个元件,即包括发送机和收发机,提供用于在传输介质上与各种其他装置通信的单元。处理器400负责管理总线架构和通常的处理,存储器420可以存储处理器400在执行操作时所使用的数据。In FIG. 5 , the bus architecture may include any number of interconnected buses and bridges, specifically one or more processors represented by processor 400 and various circuits of the memory represented by memory 420 are linked together. The bus architecture can also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are all well known in the art and therefore will not be described further herein. The bus interface provides the interface. Transceiver 410 may be a plurality of elements, including a transmitter and a transceiver, providing a unit for communicating with various other devices over a transmission medium. The processor 400 is responsible for managing the bus architecture and general processing, and the memory 420 can store data used by the processor 400 when performing operations.
其中,处理器400,用于读取存储器420中的程序或指令,执行如下步骤:Among them, the processor 400 is used to read the program or instructions in the memory 420 and perform the following steps:
获取包括目标对象的第一预览图像;Obtaining a first preview image including the target object;
根据所述第一预览图像确定第一信息,所述第一信息包括如下至少一项:所述目标对象在实际空间的第一空间位置、所述目标对象在实际空间的朝向、所述目标对象的数量、所述目标对象的姿态;First information is determined according to the first preview image, and the first information includes at least one of the following: the first spatial position of the target object in the actual space, the orientation of the target object in the actual space, the The number and posture of the target object;
基于所述第一信息确定所述目标对象对应的3D虚拟形象的交互信息和/或动态展示信息;Determine the interaction information and/or dynamic display information of the 3D virtual image corresponding to the target object based on the first information;
其中,所述交互信息用于实现所述3D虚拟形象与用户之间的交互,所述动态展示信息用于生成所述3D虚拟形象的动态展示画面。Wherein, the interaction information is used to realize the interaction between the 3D virtual image and the user, and the dynamic display information is used to generate a dynamic display screen of the 3D virtual image.
可选地,处理器400,还用于读取存储器420中的程序或指令,执行如下步骤:Optionally, the processor 400 is also used to read the program or instructions in the memory 420 and perform the following steps:
基于所述动态展示信息生成并展示所述3D虚拟形象的动态展示画面;和/或,Generate and display a dynamic display screen of the 3D virtual image based on the dynamic display information; and/or,
在获取到用户交互指令的情况下,基于所述交互信息生成响应指令,以通过所述响应指令实现所述3D虚拟形象与用户之间的交互。When a user interaction instruction is obtained, a response instruction is generated based on the interaction information, so as to realize interaction between the 3D virtual image and the user through the response instruction.
可选地,处理器400,还用于读取存储器420中的程序或指令,执行如下步骤:Optionally, the processor 400 is also used to read the program or instructions in the memory 420 and perform the following steps:
在显示第一预览图像的情况下,在所述第一预览图像中生成识别框;When the first preview image is displayed, generating an identification frame in the first preview image;
获取所述第一预览图像的所述识别框中的目标对象。Obtain the target object in the recognition frame of the first preview image.
可选地,处理器400,还用于读取存储器420中的程序或指令,执行如下步骤:Optionally, the processor 400 is also used to read the program or instructions in the memory 420 and perform the following steps:
在显示第一预览图像的情况下,获取所述第一预览图像中的待识别对象;When the first preview image is displayed, obtain the object to be recognized in the first preview image;
获取所述待识别对象所属的对象类别;Obtain the object category to which the object to be identified belongs;
基于所述对象类别确定目标检测模型;Determine a target detection model based on the object category;
在所述目标检测模型识别所述待识别对象与目标对象匹配的情况下,将所述待识别对象作为所述目标对象,以获取包括所述目标对象的第一预览图像,其中,不同的对象类别对应不同的所述目标检测模型。When the target detection model recognizes that the object to be recognized matches the target object, the object to be recognized is used as the target object to obtain a first preview image including the target object, wherein different objects Categories correspond to different target detection models.
可选地,在所述第一信息包括所述目标对象的姿态的情况下,处理器400,还用于读取存储器420中的程序或指令,执行如下步骤:Optionally, in the case where the first information includes the posture of the target object, the processor 400 is also configured to read the program or instructions in the memory 420 and perform the following steps:
获取所述目标对象的姿态,所述目标对象的姿态包括立放姿态和平放姿态;Obtaining the posture of the target object, the posture of the target object includes a standing posture and a lying posture;
基于所述目标对象对应的3D虚拟形象的动态展示信息,展示所述3D虚拟形象与所述立放姿态或所述平放姿态匹配的动态展示画面。Based on the dynamic display information of the 3D virtual image corresponding to the target object, a dynamic display picture matching the 3D virtual image with the standing posture or the flat posture is displayed.
可选地,在所述第一信息包括所述目标对象的数量的情况下,处理器400,还用于读取存储器420中的程序或指令,执行如下步骤:Optionally, in the case where the first information includes the number of target objects, the processor 400 is also configured to read the program or instructions in the memory 420 and perform the following steps:
根据所述目标对象的数量,确定所述目标对象的3D虚拟形象与所述数量对应的交互信息和/或动态展示信息。According to the number of the target objects, interaction information and/or dynamic display information corresponding to the 3D virtual image of the target object and the number are determined.
可选地,所述目标对象对应的3D虚拟形象在虚拟三维空间包括至少一个第二空间位置,不同的所述第二空间位置对应不同的交互信息和/或不同的动态展示信息;和/或,Optionally, the 3D virtual image corresponding to the target object includes at least one second spatial position in the virtual three-dimensional space, and different second spatial positions correspond to different interaction information and/or different dynamic display information; and/or ,
在所述目标对象的数量为至少两个的情况下,至少两个所述目标对象各自对应的3D虚拟形象在虚拟三维空间包括至少一个相对位置关系,不同的所述相对位置关系对应不同的交互信息和/或不同的动态展示信息。When the number of the target objects is at least two, the 3D virtual images corresponding to the at least two target objects include at least one relative position relationship in the virtual three-dimensional space, and different relative position relationships correspond to different interactions. information and/or different dynamic display information.
可选地,处理器400,还用于读取存储器420中的程序或指令,执行如下步骤:Optionally, the processor 400 is also used to read the program or instructions in the memory 420 and perform the following steps:
获取环绕所述目标对象进行拍摄得到的多个图像帧;Obtaining multiple image frames obtained by shooting around the target object;
提取每一个所述图像帧的关键点,并将所述关键点映射至虚拟三维空间中,获取所述关键点在所述虚拟三维空间中的空间方位信息;Extract the key points of each image frame, map the key points to the virtual three-dimensional space, and obtain the spatial orientation information of the key points in the virtual three-dimensional space;
基于所述空间方位信息,构建所述目标对象在所述虚拟三维空间中的3D虚拟形象。Based on the spatial orientation information, a 3D virtual image of the target object in the virtual three-dimensional space is constructed.
可选地,处理器400,还用于读取存储器420中的程序或指令,执行如下步骤:Optionally, the processor 400 is also used to read the program or instructions in the memory 420 and perform the following steps:
获取第一输入信息;Get the first input information;
在基于所述第一信息确定所述3D虚拟形象在虚拟三维空间的第二空间位置的情况下,根据所述第一输入信息确定所述3D虚拟形象的交互信息和/或动态展示信息。When the second spatial position of the 3D virtual image in the virtual three-dimensional space is determined based on the first information, interaction information and/or dynamic display information of the 3D virtual image is determined based on the first input information.
本申请实施例中,电子设备能够对手办、玩具等这类目标对象设置相应的交互信息和/或动态展示信息,从而使得目标对象能够基于对应的3D虚拟形象实现与用户之间的交互,或是能够展示目标对象3D虚拟形象的动态展示画面,从而能够有效提升目标对象与用户之间的互动性,使得目标对象与用户之间的交互更为灵活,也能够有效丰富目标对象的展示效果。In the embodiment of the present application, the electronic device can set corresponding interaction information and/or dynamic display information for target objects such as figures, toys, etc., so that the target object can interact with the user based on the corresponding 3D virtual image, or It is a dynamic display screen that can display the 3D virtual image of the target object, thereby effectively improving the interaction between the target object and the user, making the interaction between the target object and the user more flexible, and effectively enriching the display effect of the target object.
本申请实施例还提供一种可读存储介质,所述可读存储介质上存储有程序或指令,该程序或指令被处理器执行时实现上述图1所述方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。Embodiments of the present application also provide a readable storage medium. Programs or instructions are stored on the readable storage medium. When the program or instructions are executed by a processor, each process of the method embodiment described in Figure 1 is implemented, and can To achieve the same technical effect, to avoid repetition, we will not repeat them here.
其中,所述处理器为上述实施例中所述的电子设备中的处理器。所述可读存储介质,包括计算机可读存储介质,如计算机只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等。Wherein, the processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes computer readable storage media, such as computer read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk, etc.
本申请实施例另提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现上述图1所述方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。An embodiment of the present application further provides a chip. The chip includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the method described in Figure 1. Each process in the example can achieve the same technical effect. To avoid repetition, we will not repeat it here.
应理解,本申请实施例提到的芯片还可以称为系统级芯片、系统芯片、芯片系统或片上系统芯片等。It should be understood that the chips mentioned in the embodiments of this application may also be called system-on-chip, system-on-a-chip, system-on-a-chip or system-on-chip, etc.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。此外,需要指出的是,本申请实施方式中的方法和装置的范围不限按示出或讨论的顺序来执行功能,还可包括根据所涉及的功能按基本同时的方式或按相反的顺序来执行功能,例如,可以按不同于所描述的次序来执行所描述的方法,并且还可以添加、省去、或组合各种步骤。另外,参照某些示例所描述的特征可在其他示例中被组合。It should be noted that, in this document, the terms "comprising", "comprises" or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article or device that includes a series of elements not only includes those elements, It also includes other elements not expressly listed or inherent in the process, method, article or apparatus. Without further limitation, an element defined by the statement "comprises a..." does not exclude the presence of additional identical elements in a process, method, article or apparatus that includes that element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, but may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved. Functions may be performed, for example, the methods described may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以计算机软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus the necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is better. implementation. Based on this understanding, the technical solution of the present application can be embodied in the form of a computer software product that is essentially or contributes to the existing technology. The computer software product is stored in a storage medium (such as ROM/RAM, disk , optical disk), including several instructions to cause a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of this application.
上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above-mentioned specific implementations. The above-mentioned specific implementations are only illustrative and not restrictive. Those of ordinary skill in the art will Inspired by this application, many forms can be made without departing from the purpose of this application and the scope protected by the claims, all of which fall within the protection of this application.
Claims (12)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310879539.8A CN116912463A (en) | 2023-07-18 | 2023-07-18 | 3D virtual image processing method, device, electronic device and readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310879539.8A CN116912463A (en) | 2023-07-18 | 2023-07-18 | 3D virtual image processing method, device, electronic device and readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116912463A true CN116912463A (en) | 2023-10-20 |
Family
ID=88350667
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310879539.8A Pending CN116912463A (en) | 2023-07-18 | 2023-07-18 | 3D virtual image processing method, device, electronic device and readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116912463A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118227009A (en) * | 2024-04-11 | 2024-06-21 | 北京达佳互联信息技术有限公司 | Object interaction method, device and electronic device based on virtual image |
-
2023
- 2023-07-18 CN CN202310879539.8A patent/CN116912463A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118227009A (en) * | 2024-04-11 | 2024-06-21 | 北京达佳互联信息技术有限公司 | Object interaction method, device and electronic device based on virtual image |
CN118227009B (en) * | 2024-04-11 | 2024-12-10 | 北京达佳互联信息技术有限公司 | Article interaction method and device based on virtual image and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10573060B1 (en) | Controller binding in virtual domes | |
US11893301B2 (en) | Colocated shared augmented reality without shared backend | |
US11673054B2 (en) | Controlling AR games on fashion items | |
KR20180121494A (en) | Method and system for real-time 3D capture and live feedback using monocular cameras | |
CN111694430A (en) | AR scene picture presentation method and device, electronic equipment and storage medium | |
GB2583848A (en) | Virtualization of tangible interface objects | |
CN109325450A (en) | Image processing method, image processing device, storage medium and electronic equipment | |
US11991469B2 (en) | Skeletal tracking for real-time virtual effects | |
US11688136B2 (en) | 3D object model reconstruction from 2D images | |
US10740957B1 (en) | Dynamic split screen | |
CN110389703A (en) | Acquisition methods, device, terminal and the storage medium of virtual objects | |
CN108416832B (en) | Media information display method, device and storage medium | |
US20230267687A1 (en) | 3d object model reconstruction from 2d images | |
US11832015B2 (en) | User interface for pose driven virtual effects | |
US20240331245A1 (en) | Video processing method, video processing apparatus, and storage medium | |
CN105468249B (en) | Intelligent interaction system and its control method | |
CN116912463A (en) | 3D virtual image processing method, device, electronic device and readable storage medium | |
US20220319059A1 (en) | User-defined contextual spaces | |
CN113194329B (en) | Live interaction method, device, terminal and storage medium | |
US20220319125A1 (en) | User-aligned spatial volumes | |
CN114425162A (en) | Video processing method and related device | |
EP4314999A1 (en) | User-defined contextual spaces | |
Zikang et al. | Real-time Gestures in Handheld Augmented Reality with Markerless Tracking for Multiplayer 3D Game | |
CN113873162A (en) | Shooting method, shooting device, electronic equipment and readable storage medium | |
CN119234412A (en) | Choice of context-based augmented reality experiences |
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 |