# 2D/3D object AR capabilities (2D/3D Marker AR)
# Definition of method
2D/3D Marker AR capability, able to identify pre-set target objects(Defined as a marker, including 2D planar objects and 3D objects), visual tracking and positioning, rendering virtual objects around the target object, so as to achieve the AR function.
# Method difference
2D Marker
, only for flat objects, the user uploads a plane object's overhead image as the target object, the algorithm runs to identify the plane object, and render the relevant virtual object. 2D Marker can be understood as a special 3D Marker。3D Marker
, compared to 2 D Marker, can identify 3D objects, not limited to planar objects, has a wider range of use, algorithm before running, need to manually produce 3D Marker identifies the target file (.map file), and then the algorithm runtime loads this file for identification.
# Using Tips
- use addMarker Before the interface, you need to use the
createVKSession The time to declare open marker Track
The. Namely wx.createVKSession({ track: { marker: true } }) - Can be added
many Marker picture
, but cannot be repeated to add the same marker Pictures. - in v2 Mode, using the Plane recognition and Marker detection Combining, allowing
Simultaneous identification of multiple Marker
, can output multiple 2d at the same time/3d marker Identification results (base library version 3.0.0 required)), The pose information returned before the target disappears from the field of view is still valid and usable. Flat AR Capability Expansion And related examples from within.
# Specification for identifying objects
In order to improve the quality of Marker and ensure the effect of algorithm recognition, please read the Marker specification document carefully. [Marker Specification ](https://developers.weixin.qq.com/miniprogram/dev/api/ai/Visionkit /VKSession.addMarker.html)
# 3D Marker Identify the target file map generate
Currently only allowed through Small Program Example of interface
- VisionKit Visual Capabilities
- 3DMarkerAR
Page generation.
# Generate Task State Parsing
- In preparation - Uploaded, but the build server has not yet returned results. It is recommended to wait 20 minutes before uploading the next video (not updated results, you can manually delete this task, but it is best to wait about a day)
- Generate failure - Will indicate the reason for the error on the error message
- Completed - Generation is complete, the default product retains only 30 Please download it yourself.
# Service time:
- Current version 30s The video takes about 20 minutes, please wait for the algorithm to return the model.
- This service only deals with one task at the same time, multiple tasks at the same time may lead to the failure of subsequent tasks, it is recommended to generate a peak at idle time.
# There are the following requirements for incoming video:
- Video length breadth ratio 16:9 or 4: 3, the short side is greater than 480px
- The target object is easy to distinguish from the background object, at the same time the target object is placed at a certain distance from the background object, and the bottom surface is easy to distinguish between the object, and the bottom surface can be placed a piece of white paper.
- The target object is preferably a rigid body, which will not deform greatly, and objects that are easy to deform are not suitable for recognition.
- The video moves at a uniform speed to avoid blurring, and the target recognition surface is shot around the object, which needs to ensure that the camera has enough pan movement.
- Marker object requirements and 2D image requirements are similar, with rich details, avoid repeating a single texture, no reflection, no highlights
- Feature textures are rich in shooting video. If marker The problem itself is weak, you can add texture objects in the background appropriately
- It is not recommended to use transparent objects, which generate poor results.
# Suggestions for incoming video:
- Video frequency format: video frame rate 30fps, resolution recommended 1080p
- Video Length: Recommended Video Length at 20 s30s, more than 30 s will be truncated. Too short a time will cause marker Poor results
# 3D Marker Source Video Reference
# Program Examples
The following interfaces are available at Mini Program interface capability demo to hit the target interface - VisionKit Visual Capabilities Experience in
# 2D Marker ability
- [Basics 2D Marker Example of Ability](https://github.com/WeChat mini-program /miniprogram-demo/tree/master/miniprogram/packageAPI/pages/ar/2dmarker-ar ) Basics 2D Marker Identify examples.
- [Level + 2D Marker Example of Ability](https://github.com/WeChat mini-program /miniprogram-demo/tree/master/miniprogram/packageAPI/pages/ar/plane-ar-v2-marker ) Horizontal AR Combination 2D Marker Identify examples.
- [Level + Additional capacity Example](https://github.com/WeChat mini-program /miniprogram-demo/tree/master/miniprogram/packageAPI/pages/ar/plane-ar-v2-options) Horizontal AR Combination Multiple examples of additional capabilities.
# 3D Marker ability
- [3D Example of marker capability usage ](https://github.com/WeChat mini-program /miniprogram-demo/tree/master/miniprogram/packageAPI/pages/ar/3dmarker ) 3D Marker Build, invoke, and test examples of.
# 3D MarkerCase Default recognition Approximate effect
# 3D MarkerCase Default recognition Source Video Reference
# 3D MarkerCase Default recognition picture
# Application Scenario Examples
2D examples:
- Workcard AR
- Tickets AR
- Art Painting AR
Examples of 3D objects:
- Beverage, cosmetic bottles and other containers AR
- Doll AR