Code Monkey home page Code Monkey logo

arkit-depth-renderer's Introduction

arkit-depth-renderer

Displays the depth values received by the front-facing camera. The depth values are applied to a heat map and multiplied with the camera's color image. The resulting image is then used as the background for the augmented reality scenekit scene.

Screenshot of example

This example builds upon the official Creating Face-Based AR Experiences demo and is free to use. The original demo code is here.

Overview

  • See additions to ViewController.swift
  • Depth frames can be accessed by any object that conforms to ARSessionDelegate using the session(_ session: ARSession, didUpdate frame: ARFrame) method.
  • To align SceneKit rendering with the depth image, we use frame.displayTransform to get a matrix that is used to properly align the projection.
  • The raw frame data can be fed into Core Image for manipulation, for example with CIImage(cvImageBuffer: depthBuffer)
  • Once in Core Image, a temperature gradient can be applied, and the color image can be multiplied in using filters (see Core Image docs).

Depth frames are not received as quickly as color frames are. As a result, the camera feedback is not as fast as a photo preview would normally be. I haven't been able to find a way to manipulate the camera configuration to increase the rate at which the depth images are received.

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.