AR image detection question

Hello,

I trying to develop on ARKit with image detection. I succeded to detect one image like in the article of joe Graf (https://docs.unrealengine.com/en-us/UE-Dev-Blog/ARKit-15-Image-Detection-in-UE4-420)
But I stumble in front of several problem

  • When try to have several image in the database for candidate image, I add a switch that spawn a different class actor according to the Friendly Name return by the ARTracked Image from the geometries, but it always take the last one in the switch, and never spawn the other one. Maybe it’s me and I dind’t understand the Event Tick, how it works. I also try to transform it in a function and promote the friendly name and the class that will spwand, and duplicate in series the function on the Event Tick and it’s the same it only take the last one.
  • How can I update the position of the spawnd class after it’s spawnd when the image is moved in the real world, or when the ARSession update the anchor postion.

Hi, verify that you have different classes for different images and that you did not miss a break in a switch statement.
If you only want to have one object per image, then spawn one when the image is initially detected, and update a position of that actor on later detections.

I would suggest not doing it this way. I haven’t found a seamless way to update a tracking position of a candidate image as of yet. But calling for it to be moved each time it is recognised by your device doesn’t work out of the box. It seems to update every half second or so providing you with a very jagged user experience that doesn’t really achieve what you want.

However I do think this is the correct route to go down as with the transform pin, Unreal does a good job of getting the position correct. It’s more a case of the rate at which it refreshes the image transform. If this can be increased, you may be able to get what we’re both looking for.

You could use smoothing updates and not set the position straight from what has been detected.

I am having a similar problem. I paired it down to the following simple bp

When I look at either image first I get a clean print string.

But after I look at the second image it prints both the first switch and the second switch string. Is there a way to fix this so it is only calling one element of the switch at a time? I have tried with do once as well as branch statements.

You could, but it would not make it real time nor would it work very well. It wouldn’t move along with the image it would instead move around a second later once the image is recognised again. The lag would make the experience infuriating. The rate at which that image is tracked needs to be increased somehow and that’s not available out of the box.

did you find a solution to your problem ??

GetAllARGeometries returns all the candidate images you have set, not just the tracked ones. On each Tick, for each one of them, you should check the IsTracked flag to check whether or not it is currently being tracked by the camera.

1 Like