Augmented Reality image tracking with SwiftUI, RealityKit and ARKit 4.

Overview

ARImageTracking

This is an Augmented Reality Xcode project that uses Apple's newest RealityKit framework and ARKit 4 features, to dynamically track a moving image in the real world. It is written in SwiftUI.

The example video and image used in my project is of an iPhone Xs screen recording and iPhone Xs box. Do swap the video and image out to whatever you want to track and overlay. I've commented the entire project to help you adapt the code to your needs!

Contributions are welcome. Tested on iOS 14.3 and requires an iDevice with an A12 chip or higher to run.

You might also like...
 A library that allows you to generate and update environment maps in real-time using the camera feed and ARKit's tracking capabilities.
A library that allows you to generate and update environment maps in real-time using the camera feed and ARKit's tracking capabilities.

ARKitEnvironmentMapper Example To run the example project, clone the repo, and run pod install from the Example directory first. Installation ARKitEnv

This library uses ARKit Face Tracking in order to catch user's smile.
This library uses ARKit Face Tracking in order to catch user's smile.

SmileToUnlock Make your users smile before opening the app :) Gif with the demonstration Installation Cocoapods The most preferable way to use this li

Funny app with the fitting of sunglasses Used SwiftUI and RealityKit
Funny app with the fitting of sunglasses Used SwiftUI and RealityKit

Reality-Glasses-2021 on SwiftUI Funny app with the fitting of sunglasses. Used SwiftUI and RealityKit Interface and Features: Simple Intuitive Design

This package enables easy, convenient fading in and fading out in RealityKit.

RKFade This package enables easy, convenient fading in and fading out in RealityKit. Be sure to call FadeSystem.register() (Not FadeSystem.registerSys

An example project showing how to extract and color anchor geometry in RealityKit
An example project showing how to extract and color anchor geometry in RealityKit

RealityKit - Extracting anchor geometry to create a custom Mesh An example project showing how to extract anchor geometry from ARMeshAnchor, create a

A collection of additional geometries ready for use in RealityKit 2
A collection of additional geometries ready for use in RealityKit 2

RealityGeometries By default, the only shapes available in RealityKit are a Sphere, Cuboid and Plane (with 4 vertices). Until iOS 15 the only clean wa

RealityKit Bool Demo with Euclid

RealityKit Bool Demo with Euclid A demo subtracting RealityKit meshes with a bool operation using Euclid. First a RealityKit MeshResource is converted

A sample project demonstrating a usecase for the DrawableQueue API in RealityKit 2.
A sample project demonstrating a usecase for the DrawableQueue API in RealityKit 2.

RealityKit 2 DrawableQueue: Animated (transparent) GIFs A sample project demonstrating a usecase for the DrawableQueue API in RealityKit 2 – which cur

This is a minimal AR Portal app that uses the RealityKit's occlusion materials to hide the inner space
This is a minimal AR Portal app that uses the RealityKit's occlusion materials to hide the inner space

AR Simple Portal This is a minimal AR Portal app that uses the RealityKit's occlusion materials to hide the inner space. Xcode 13.2.1 Target: iOS / iP

Comments
  • some fixes

    some fixes

    First of all thank you for this repo! :)

    It did help me understand how to get RealityKit working with SwiftUI and ImageTracking!

    I found that when running it on my iPhone the main view was cropped (sorry for the cable mess...

    screenshot

    To fix this I added this in the .plist

    	<key>UILaunchScreen</key>
    	<dict/>
    

    and then I added the sizes of the video to match the sizes of the image. This might be unwanted though if you plan to use different videos

    // size of video plane depending of the image
    			let width: Float = Float(imageAnchor.referenceImage.physicalSize.width * 1.1)
    			let height: Float = Float(imageAnchor.referenceImage.physicalSize.height * 1.1)
    
                //Sets the aspect ratio of the video to be played, and the corner radius of the video
                let videoPlane = ModelEntity(mesh: .generatePlane(width: width, depth: height, cornerRadius: 0.3), materials: [videoMaterial])
    
    
    opened by multitudes 0
Owner
Richard Qi
iOS & Web Dev | NUS Computer Science
Richard Qi
ARDicee - Simple augmented reality app using SceneKit and ARKit

ARDicee Simple augmented reality app using SceneKit and ARKit Requirements Xcode

donggyu 3 Feb 4, 2022
Furniture E-Commerce Augmented Reality(AR) app in iOS powered by ARKit

HomeMax-iOS Furniture E-Commerce Augmented Reality(AR) app in iOS powered by ARKit and SceneKit. Inspired by IKEA place app. Description Experience on

Ikmal Azman 5 Oct 14, 2022
ARID - Augmented Reality app using Apple’s ARKit framework which can recognise faces of famous scientists

ARID Augmented Reality app using Apple’s ARKit framework which can recognise fac

Hemanth 0 Jan 12, 2022
Smart Online Shopping iOS App with Augmented Reality (AR) and simple Social Media features using SwiftUI and Google Firebase Cloud Services

Table of contents App Demo How to Run Context Content How it's written Inspiration App Demo AR.online.shopping.iOS.demo.mp4 How to Run First make sure

Ashkan Goharfar 13 Nov 1, 2022
It is a music and podcast creation system that enables users to create multiple tracks using AR(Augmented Reality).

AR-Studio It is a music creation system enables users to create multiple tracks using AR(Augmented Reality). Introduction AR Studio turns your iPad, a

Ayush Singh 5 Dec 3, 2022
Develop simple and fun Augmented Reality (AR) iOS apps

AR-Dice Simple and fun to use iOS app made to make Augmented reality (AR) be in

Dishant Nagpal 1 Feb 23, 2022
Browse the streets of Los Angeles on an Augmented Reality historical walking tour.

Ruscha AR 0.3 Browse the streets of Los Angeles on an Augmented Reality historical walking tour. Explore Hollywood through the photos of Ed Ruscha. Th

Rick van Voorden 2 Jul 9, 2022
An augmented reality (AR) ghost hunting simulation for iPhone

ARanormal An augmented reality (AR) ghost hunting simulation for iPhone About ARanormal was the first game by Jesdo Software, released for iPhone in O

Jesse Douglas 1 Nov 2, 2021
Placing Virtual Objects in Augmented Reality

Placing Virtual Objects in Augmented Reality Learn best practices for visual feedback, gesture interactions, and realistic rendering in AR experiences

Yuchao 279 Dec 11, 2022
A library that allows you to generate and update environment maps in real-time using the camera feed and ARKit's tracking capabilities.

ARKitEnvironmentMapper Example To run the example project, clone the repo, and run pod install from the Example directory first. Installation ARKitEnv

SV Hawks 91 Dec 4, 2022