Building a Museum App with ARKit 2 | Ray Wenderlich

Have you ever stood at a museum exhibit and wanted to know more about the art or artifact than the little placard provides? There should really be an app for that. Well, you can make such an app with image and object detection and tracking in ARKit 2!


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/6957-building-a-museum-app-with-arkit-2

This is a GREAT tutorial!!

I do have a question. How can I detect when a detected image moves “off the screen”. For example, if displaying information for a really wide object, and want portions to be detected, as I move across the area, I want to remove the text when it off the screen, and when a new section that is recognized comes into frame, replace the text.

I am unsure how the app can detect that the image has moved outside of the camera view.

Any assistance would be really appreciated

I scanned the object and added to my project and even then the object is not being detected. didAdd never gets fired.

How detect when image out off the screen and remove video, then when detects add?

In general you shouldn’t have to remove nodes from the scene if they go off screen, unless (a) you are adding so many there is a memory concern or (b) that node is also removed from the real world.

Either way, this SO post should help figure that out: https://stackoverflow.com/questions/47828491/how-to-know-if-node-is-visible-in-screen-or-not-in-scenekit

The first place to start with figuring this out, is to use Apple’s scanning app and use the test button after the model is created to make sure that the detection works. Also as a starting point make sure you have the same lighting and background conditions. Also depending on the object and conditions and the detectinon can be a little finnicky and requires a fair amount of walking around the object, moving in and out, slowly.

@mkatz Can you please help with this when you get a chance? Thank you - much appreciated! :]

Are there any requirements on the video MP4 that is going in there? When I use the one provided it works fine, but anything else I try and include (even with the same name) just shows a blank element. It’s detecting the image, just not playing the video.

Is there an easy way to debug this in Xcode?

@mkatz Do you have any feedback about this? Thank you - much appreciated! :]

i don’t know the specifics about the video encoding, but i would try a separate app with just an avplayer in single view controller and see if it can play back there first.

This tutorial is more than six months old so questions are no longer supported at the moment for it. Thank you!