# 2D/3D object AR capability (2D/3D Marker AR)

# Method Definition

2D / 3D Marker AR capabilities, which can identify pre-set target objects (defined as Markers, including 2D plane objects and 3D objects), perform visual tracking and positioning, and achieve AR functions by rendering virtual objects around the target object.

# Methodal differences

  1. 2D Marker,For flat objects only, users upload a downward image of a flat object as a target object, and the algorithm recognizes the flat object when it runs and renders the related virtual object. A 2D marker can be understood as a special 3D marker.
  2. 3D Marker,Compared with 2D Marker, it can identify 3D objects, not restricted to flat objects, and has a wider range of use. Before the algorithm runs, it needs to manually make the 3D Marker's identification target file (.map file), and then load the file for identification when the algorithm is running.

# Use the tips

  1. Before you can use the addMarker interface, you need to declare that marker tracing is enabledwhencreateVKSession.Namely wx.createVKSession ({track: {marker: true}})
  2. You can addmultiple Marker images, but you cannot add the same marker image repeatedly.
  3. In v2 mode, plane recognition is combined with marker detection, allowing`to identify multiple markers simultaneously and output multiple 2d / 3d marker recognition results (require base library version 3.0.0),Pose information returned before a target disappears from view is still validly available, using for flat AR capabilities, and related examples in-house.

# Identify object specifications

In order to improve the quality of Marker and ensure the recognition effect of the algorithm, please read the Marker specification document Marker specification

# 3D Marker Recognition Target File Map Generation

Currently only theinterface via the Weixin Mini Program example-VisionKit Visual ability-3DMarkerARpage generated.

# Generate task state parsing

  1. Ready - Uploaded, but the builder has not returned the results yet. 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)
  2. Generate failure - indicates the cause of the error on the error prompt
  3. Done - The build is complete. The default product will only be available for 30 days. Please download it yourself.

# Time consumed by service:

  1. The current version of the 30s video takes about 20 minutes, please wait for the algorithm to return to the model.
  2. The service handles only one task at a time. Multiple tasks performed at the same time may result in the failure of subsequent tasks. It is recommended that idle hours be generated at peak times.

# There are the following requirements for incoming videos:

  1. The length breadth ratio is 16: 9 or 4: 3, with short edges greater than 480 px.
  2. The target object is easy to distinguish from the background object, and the target object is placed at a certain distance from the background. The ground surface is easy to differentiate from the object. A white sheet of paper can be placed on the ground surface.
  3. The target object is preferable to be a rigid object, which will not undergo larger morphological changes on its own, and objects that are easily deformed are not suitable for use as identification objects.
  4. Video moves at a steady pace to avoid blurring. When shooting a target recognition surface around an object, you need to ensure that the camera has enough flat movement
  5. Marker object requirements are similar to 2D image requirements, with rich detail, avoid repeating a single texture, no reflection, no highlights
  6. Shooting video features rich texture, if the marker itself is weak, you can add texture objects in the background
  7. It is not recommended to use transparent objects, which produce poor results.

# Advice for incoming videos:

  1. Video frequency format: video frame rate 30fps, resolution recommended 1080p
  2. Video length: The recommended length of the video is 20 s ~ 30s, more than 30 s will be truncated, too short will lead to poor marker effect

# 3D Marker Source Video Reference

demo-marker3d

# Program Examples

The following interfaces can be experienced in Interface - VisionKit Visual Capabilities in the Weixin Mini Program Interface Capabilities demo

# 2D Marker Capabilities

  1. Basic 2D Marker Ability Example Basic 2D Marker Recognition Example.
  2. Horizontal + 2D Marker capability example Horizontal AR combined with 2D Marker recognition example.
  3. Horizontal + Additional Capability Examples Horizontal AR combines multiple additional capability examples.

# 3D Marker Capabilities

  1. Example of using 3D Marker capabilities Example of generating, calling, and testing 3D Markers.

# 3D Marker Case Default Recognition General Effect

demo-marker3d

# 3D Marker Case Default Identification Source Video Reference

demo-marker3d

# 3D Marker Case Default Recognition Picture

demo-marker3d

# Example of application scenarios

2D examples:

  1. Workcard AR
  2. Tickets AR
  3. Art Painting AR

marker2d

Examples of 3D objects:

  1. Beverage, cosmetic bottles and other containers AR
  2. Doll AR

Beverage, cosmetic bottles and other containers AR

Doll AR