ARKit 2- Object Scanning

  • By: Akshay
  • Date: 25-02-2019

In iOS 12, Apple introduced ARKit 2.0 with some extreme AR features like Multiuser AR experience, 2D image detection and 3D object detection

Scanning Real-World Objects

“Record spatial features of real-world objects, then use the results to find those objects in the user’s environment and trigger AR content.” –Apple Documentation

There are two ways to add a ARReferenceObject to your app:

  • Add the scanning functionality to your app or make a separate scanning app.
  • Use Apple’s demo scanning app to quickly scan and export objects

1. Adding scanning functionality to your app.

Adding scanning functionality to your app is super convenient as everything can be done within the same app. This means you don’t have to export your reference objects and then add them to your app with every addition — it all happens in the same app.

Here is the basic flow:

  • Initiate a ARObjectScanningConfiguration to enable high-fidelity data collection that is needed for object scanning.
  • After scanning an object in a session with the above configuration,call createReferenceObject (transform:center:extent:completionHandler:) to specify the origin and location of the object, the centre of the bounding box, and then the width, height, and depth to extract starting at the centre of the bounding box.

2. Using Apple’s demo app to quickly scan and export objects

If you don’t want or even need to add the scanning functionality to your app, you can always just use Apple’s demo scanning app to quickly scan and export objects from that app.

For using Apple’s demo app follow the steps-

  • Prepare to scan. When first run, the app displays a box that roughly estimates the size of whatever real-world objects appear centered in the camera view. Position the object you want to scan on a surface free of other objects (like an empty tabletop). Then move your device so that the object appears centered in the box, and tap the Next button.
  • Define bounding box.Before scanning, you need to tell the app what region of the world contains the object you want to scan. Drag to move the box around in 3D, or press and hold on a side of the box and then drag to resize it. (Or, if you leave the box untouched, you can move around the object and the app will attempt to automatically fit a box around it.) Make sure the bounding box contains only features of the object you want to scan (not those from the environment it’s in), then tap the Scan button.
  • Scan the object.Move around to look at the object from different angles. The app highlights parts of the bounding box to indicate when you’ve scanned enough to recognize the object from the corresponding direction. Be sure to scan on all sides from which you want users of your app to be able to recognize the object. The app automaically proceeds to the next step when a scan is complete, or you can tap the Stop button to proceed manually.
  • Adjust origin.The app displays x, y, and z coordinate axis lines showing the object’s anchor point, or origin. Drag the circles to move the origin relative to the object. In this step you can also use the Add (+) button to load a 3D model in USDZ format. The app displays the model as it would appear in AR upon detecting the real-world object, and uses the model’s size to adjust the scale of the reference object. Tap the Test button when done.
  • Test and export.The app has now created an ARReferenceObject and has reconfigured its session to detect it. Look at the real-world object from different angles, in various environments and lighting conditions, to verify that ARKit reliably recognizes its position and orientation. Tap the Export button to open a share sheet for saving the finished.arobject file. For example, you can easily send it to your development Mac using AirDrop, or send it to the Files app to save it to iCloud Drive.

Subscribe For Our Newsletter And Stay Updated

Recent blogs

b2all marketers
Energized by tech innovations, individuals today have very high expectations about what makes a great customer experience and fail...
ARKIT 2
In iOS 12, Apple introduced ARKit 2.0 with some extreme AR features like Multiuser AR experience, 2D image detection and 3D object...
Drupal lightning
Drupal 8 gives developers and content authors full flexibility to shape their websites and applications that meets their vision. It...

Contact US

Take me there

This website uses cookies to offer you an enhanced website experience. We collect information about how you interact with our website to provide personalized services to you. To find out more, see our Privacy Policy

×