Hi guys, why is adding new Augmented Images at runtime not available inside of a build on Android devices ? The documentation clearly states that it can be done, while I'm not able to compile a build that has this feature.
Adding new images at runtime is not exposed in Unity API right now. Can I ask is there any use case in particular that you need to add new image at runtime? Be aware, adding image at runtime is a time consuming behavior.
@bopangzz Adding or changing the image in the app will make the app more dynamic not only for the user. As developer we dont have to build a new app everytime, just for changing an image, if its desired from user.
Yes, the idea is to download images from the server at runtime and to generate targets from those images.
It would be great to see this feature implemented or the ability to change the image database at runtime once downloaded from a server.
We are also eagerly awaiting this to be available
Is there a way to solve this problem with assets (fill asset with augment image database and load this component)?
Would also be interested in finding a way to achieve this or have this feature implemented. Any known workaround?
We have a solution in house that we'll be rolling out with our updated templates next month along with authoring support for the markers.
Would love to know when it will be rolling out....
We actually just rolled it out in our Explore AR 1.4 template--this supports both ARKit and ARCore dynamic image targets in Unity:
https://github.com/motive-io/Explore-AR
Unfortunately there's no editor support for them, you'll have to put it on a device to get it working.
Hi, ARCore SDK for Unity 1.5.0 has been released and this issue should be fixed. Please feel free to comment if you still experience it.
.
Hi, is there any example for ARKIT 1.5.0 how to set up "AugmentedImages at Runtime" in Unity or is there some documentation available how to make it work?Thanks in advance.
since this feature had been added, and I have had a (really) minor issue with it,
I'm just posting to let everyone know that the supported Texture formats are RGB24 and RGBA32 .
in my project, the loaded texture defaulted to ARGB32, and it took me some time to figure out that it was the issue.
Source - (_ConvertTextureToGrayscaleBytes )
Also textures need to have read/write checkbox enabled
Confirmed working, however, it seems assignment of another AugmentedImageDatabase to the session config also works during runtime which is handy. I would like to construct a database with one image by using AddImage and then assigning this to config, but I cannot seem to get this working on target device. Has anyone tried this before?
(edit:) solved it by having a delay between construction of database and addition of image (~ 1 second), must be a small bit of processing going on so you can't do it in the same frame
Is there a way to know that the image am currently scanning is not in the AugmentedImageDatabase that is currently assigned to session. something like a "database scan complete with no image found" callback ?
Adding a texture to the image database at runtime doesn't seem to work. ARCore says the image has been added to the session.config.augmentedImageDatabase (the image database count goes up +1 and the AddImage method returns a valid index number).
However, when you actually try scanning for the image, the Update() function used in the AR Image example is unable to find it, with 0 AugmentedImage's being returned via Session.GetTrackables
However, if we make the database in the editor and add the image that way, everything works.
Anyone have any advice or willing to send a link to a confirmed working demo scene using dynamic image targets? I've tried a lot of different tests and scoured the internet but I need help. Our app heavily depends on this feature.
Any progress in this? I am trying to update the database during runtime with images picked from the user's Gallery, but it doesn't work anyway. As everyone said, the database returns a positive number when adding images at runtime.
Comment if someone could achieve adding image targets during runtime.
I am also trying to do this since I want to update the database during runtime so I can create a test app for our designers to check different markers and how well they work. I don't get why people continue to call this closed when this is not working.
Any update on this?
I'm not even getting positive numbers on the latest version. It just keeps returning -1.
I've enabled read/write feature, set texture format to RGBA24, tried it with new AugmentedImageDatabase at runtime(using ScriptableObject), tried it with existing AugmentedImageDatabase, tried it in the editor, tried the build on android, tired it in instant preview but no luck.
Is there something that I'm missing?
So, I got this working!
If anyone is still struggling with this, here's the solution:
AugmentedImageDatabase newDatabase= ScriptableObject.CreateInstance<AugmentedImageDatabase>();newDatabase.AddImage(name, image). You can do this by passing a counter check-in Update function and delay the addition of images by around 40-50 frames.Due to some reason, if you add the images in start function, most of the times, it returns -1 because I think that native session is still not initialised (LifecycleManager.Instance.NativeSession).
Can we add the database image from gallary or server, and render the assets provided with the image. I want to fetch the 3D model from url and render it on the added image.
Thanks
Is there a way to do this in android studio?
Sorry. I am very new to ARCore ,only started working with android studio for a month and I am also a begginer. Any help is welcome :)
I tried unity but it seemed more difficult than android studio ( correct me if I am wrong but unity works with c# , which I don't know yet).
Do you guys know or have an example of adding an image from the user's phone gallery to the augmented images database at runtime? What I would like to do is to add a button in the beginning (before the ARCore session starts) of the app so the user can configure the databse.
So, I got this working!
If anyone is still struggling with this, here's the solution:
- Create a new database:
AugmentedImageDatabase newDatabase
= ScriptableObject.CreateInstance<AugmentedImageDatabase>();- Make sure that all the images which you are using, have Read/Write enabled and format = RGB 23 bit.
- Make sure that there's a delay between the start of your scene and the call of the function
newDatabase.AddImage(name, image). You can do this by passing a counter check-in Update function and delay the addition of images by around 40-50 frames.Due to some reason, if you add the images in start function, most of the times, it returns -1 because I think that native session is still not initialised (
LifecycleManager.Instance.NativeSession).
how you do the create new database script, do you use the script AugmentedImageDatabase or do you reedit the AugmentedImageDatabaseContextMenu script to adjust your need, i tried adjust the script AugmentedImageDatabaseContextMenu, can insert new image target, but somehow the texture missing, but if the texture in there, the quality become calculating.......
Most helpful comment
@bopangzz Adding or changing the image in the app will make the app more dynamic not only for the user. As developer we dont have to build a new app everytime, just for changing an image, if its desired from user.