iOS-Depth-Sampler
  • December 23, 2024

Platform Language

Code examples of Depth APIs in iOS

Requirement


Use devices which has a dual camera (e.g. iPhone 8 Plus) or a TrueDepth camera (e.g. iPhone X)

How to build


Open ARKit-Sampler.xcworkspace with Xcode 10 and build it!

It can NOT run on Simulator. (Because it uses Metal.)

Contents


Real-time Depth

Depth visualization in real time using AV Foundation.

Real-time Depth Mask

Blending a background image with a mask created from depth.

Depth from Camera Roll

Depth visualization from pictures in the camera roll.

Plaease try this after taking a picture with the Camera app using the PORTRAIT mode.

Portrait Matte

Background removal demo using Portrait Effect Matte (or Portrait Effect Matte).

Plaease try this after taking a picture of a HUMAN with PORTRAIT mode.

Available in iOS 12 or later.

ARKit Depth

Depth visualization on ARKit. The depth on ARKit is available only when using ARFaceTrackingConfiguration.

2D image in 3D space

A demo to render a 2D image in 3D space.

AR occlusion

[WIP] An occlusion sample on ARKit using depth.

GitHub


View Github

#ios #iosswift #swift #swiftui
YOU MIGHT ALSO LIKE...
HybridCamera

[video width="192" height="416" mp4="https://swiftgit.com/wp-content/uploads/2024/12/68747470733a2f2f7261776769742e636f6d2f7374796c656b69742f696d672f6d61737465722f7669645f6564697465645f325f326d622e676966.mp4"][/video]

TakeASelfie

An iOS framework that uses the front camera, detects your face and takes a selfie. This api opens the front ...

MockImagePicker

Mock UIImagePickerController to simulate the camera in iOS simulator.

RAImagePicker

Description RAImagePicker is a protocol-oriented framework that provides custom features from the built-in Image Picker Edit.

YPImagePicker

YPImagePicker is an instagram-like photo/video picker for iOS written in pure Swift. It is feature-rich and highly customizable to match ...