Giter Club home page Giter Club logo

arwebb's Introduction

  1. Chinese README

  2. Chinese Source Code Analysis

Updated

Date    Update
2021-12-11 New: Added a Image Tracker using OpenCV WebAssembly. Please see the "Image AR using OpenCV".
2021-08-15 New: Added a video mask mode for image AR. This is a CSS 3D transformation, which does not require three.js.
2021-07-21 New: This project is the same as https://github.com/sanyuered/WeChat-MiniProgram-WebAR, but it is a pure front-end website.

Visit a live example

https://sanyuered.github.io/WebAR/

Introduction of Web AR

This is a Web AR Demo.

We can create AR effects by using "tracking.js" and "jsfeat" library.

The "tracking.js" brings computer vision algorithms and techniques into browser environment. The "jsfeat" is also a JavaScript computer vision library. We can do real-time image and face detection.

tracking.js and JSFeat

Index Page of the WeChat Mini-program

avatar

Image AR and 3D Mask

Use the demo to scan a pattern image below.

avatar

A cat beard is on the pattern image.

avatar

A effect of translating and scaling.

avatar

A effect of rotating.

avatar

Image AR using OpenCV

This is the same as above. Supports image rotation.

The image is rotated by 30 degrees.

avatar

The image is rotated by 90 degrees.

avatar

Image AR and Video Mask

Use the demo to scan a rotating image below.

avatar

A video player is on and aligned with the image.

avatar

How to replace the 2D mask "cat beard"

You may replace the default url of a image for 2D mask.

File: /package_image_tracker/photo/photo.js and /package_image_tracker/camera/camera.js

const modelUrl = '../../assets/cat_beard.png';

How to replace the pattern image

File: /package_face_tracker/utils/imageBusiness.js

const patternImageUrl = '../../assets/face_pattern.jpg';

A pattern image is below.

avatar

How to put a image on an other position

Select a track point on a pattern image, the point is used to set the "cat beard" image.

File: /package_image_tracker/utils/modelBusiness.js

// a index of a track point on a pattern image
const trackPoint = { 
    x: 186, // the width of the pattern image is 375
    y: 140, // the height of the pattern image is 375
};

arwebb's People

Contributors

mrdysbv avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.