Table of Contents

Image cloud recognition WeChat Mini Program developer guide

This chapter mainly introduces the common functions and implementation methods of combining EasyAR cloud recognition with WeChat Mini Programs.

Function and usage

WeChat Mini Program XR-FRAME is an XR/3D application development solution officially launched by WeChat. It uses hybrid rendering technology to achieve near-native performance, combining visual effects with development convenience, enabling rapid construction of AR applications. The framework supports core functions such as image tracking, 3D model loading, animation control, video playback, and particle effects. The development mode is primarily based on WXML templated programming, requiring only a small amount of logic code to achieve high-quality visual effects.

EasyAR cloud recognition (CRS) service focuses on image search scenarios for massive image libraries, achieving efficient target recognition through cloud algorithms. It features high cost-effectiveness and low access barriers, allowing developers to quickly integrate and complete feature development.

Data flow

flowchart TB  

B[API or EasyAR Web] --> A[Cloud recognition CRS] <--> D[Device-side WeChat Mini Program]  

C[Virtual content] <--> D[Device-side WeChat Mini Program]  

The combination of XR-FRAME and cloud recognition removes the limitation on the number of target images for local devices, addressing the need for large-scale applications.

Implementation process

  1. Cloud recognition service call‌

    • Initiate an image recognition request via the EasyAR cloud recognition (CRS) API
    • Process the recognition results (success/failure, handle Meta, etc.)
  2. Tracking image configuration‌

    • Dynamically set xr-ar-tracker based on the trackingImage in the recognition results
  3. Virtual resource loading‌

    • Parse the resource identifier in the Meta data
    • Download 3D models or videos and other virtual assets using xr-asset
    • Add virtual assets to the scene and configure resource properties (e.g., scaling, initial position, etc.)
  4. AR content presentation‌

    • Spatially bind virtual assets with recognition markers
    • Achieve mixed-reality rendering effects
    • Handle user interaction events (e.g., clicks, drags, etc.)

Common functions

After obtaining cloud recognition results, the commonly used AR functions in WeChat Mini Programs include the following:

  • Only recognize and display the recognition results
  • Only recognize and display videos, animations, models, or scripts associated with the recognition target
  • Recognition + tracking to overlay videos, animations, models, or scripts