arcore-unity-sdk icon indicating copy to clipboard operation
arcore-unity-sdk copied to clipboard

Augmented Images: Not being able to add images runtime when using Instant Preview

Open patrickdemooij9 opened this issue 6 years ago • 5 comments
trafficstars

SPECIFIC ISSUE ENCOUNTERED

Currently I can't add augmented images to the augmented images database. I currently wait until the session is tracking and then try to add the image so the augmented database located in the session config the following way: session.SessionConfig.AugmentedImageDatabase.AddImage("TestImage", testTexture);

testTexture is a Texture2D that is the same as image 001 from the example. The texture has read/write enabled and uses RGB 24 bit for formatting.

I have tried the following things:

  • Adding the images on an empty image database.
  • Creating the image database myself with ScriptableObject.Instantiate and then adding the image to it.
  • Waiting 5 seconds after the session is tracking and then adding the image.

None of the above work for me. I also made a new project, thinking that maybe I messed with some configurations, but I am able to recreate the problem.

Error: image

VERSIONS USED

  • Unity: 2018.3.0f2
  • ARCore SDK for Unity: 1.6
  • Device manufacturer, model, and O/S: Editor
  • ARCore: 1.7.190128146 On Windows, use: adb shell pm dump com.google.ar.core | findstr /i "packages: versionName" On macOS, use: adb shell pm dump com.google.ar.core | egrep -i versionName\|packages:
  • Output of adb shell getprop ro.build.fingerprint: samsung/dreamltexx/dreamlte:8.0.0/R16NW/G950FXXS4CRLC:user/release-keys

STEPS TO REPRODUCE THE ISSUE

  1. Create a new project with the versions specified above
  2. Open the AugmentedImages example
  3. Open the ExampleController
  4. Add the following code with the other variables:

private bool addedNewDatabase; [SerializeField] private Texture2D testTexture;

  1. Add the following code in the update after the check for if the application is tracking.
if (!addedNewDatabase)
            {
                ARCoreSession session = FindObjectOfType<ARCoreSession>();
                //session.SessionConfig.AugmentedImageDatabase = ScriptableObject.CreateInstance<AugmentedImageDatabase>();
                session.SessionConfig.AugmentedImageDatabase.AddImage("TestImage", testTexture);
                addedNewDatabase = true;
                return;
            }

  1. Add the 001 example texture to the inspector for the testTexture. Enable the write/read attribute and use the RGB 24 bit formatting. It will give another error otherwise
  2. Run the application, it will give an error in the editor window.

WORKAROUNDS (IF ANY)

ADDITIONAL COMMENTS

patrickdemooij9 avatar Mar 04 '19 16:03 patrickdemooij9

I am facing the same issue when i try to do it in editor, but it works well after building to an android device

EngMetwally avatar Mar 06 '19 19:03 EngMetwally

Just tried to make this work again, but it seems like it isn't an Instant Preview only problem. I debugged the whole code while on the android mobile and it doesn't return anything from "nativeSession.AugmentedImageDatabaseApi.AddImageAtRuntime". It just gets stops in that function.

patrickdemooij9 avatar Apr 04 '19 07:04 patrickdemooij9

The image part of ARCore needs some attention...

vjleo avatar Apr 09 '19 02:04 vjleo

Any update on this?

v-octal avatar Aug 31 '19 08:08 v-octal

Did you got the soluiton for this problem ?

janeshvar avatar Apr 24 '20 06:04 janeshvar