Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. We are looking for your feedback about Templates! Tell us about your experiences by taking our survey.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

How to know Image Target position ?

Discussion in 'Vuforia' started by Kiupe, Jul 12, 2018.

  1. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    528
    Hello,

    I'm trying to figure out how to know Image Target (printed image) position ? In the current small test I'm working on the player can hold 2 or 3 images (printed images) and I need to know their positions - actually I want to know which image is at the left, the middle and the right.

    I tried to use the TrackableBehaviour.gameObject.transform.position but without success. Values don't feel "right".

    Is this possible ? How would you do that ?

    Thanks
     
  2. henriqueranj

    henriqueranj

    Joined:
    Feb 18, 2016
    Posts:
    156
    Hi Kiupe, I would recommend for you to try out different World Center Modes settings in the Vuforia Behaviour (Component in the Camera for AR). I can assume that you're getting "not right" values due to using "First Target" as your World Center.

    Personally, for multi target tracking I prefer to use the Device (or previously named as Camera) as the World Center Mode.
     
    ruoshan likes this.
  3. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    528
    Hi,

    Actually I do use "Device" as World Center Mode. When I talk about weird values is because those value don't seems to really changed that much when moving images. I tried to change the size of the Image Target but without really success.

    Using only two images and comparing the position the debug always return the same image as the left one even when I switched their position.

    TrackableBehaviour.gameObject represent the object which has the TrackableEventHandler component but does that object position really match/mimic the "print image" position/movement ?

    Thanks
     
  4. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    528
    Hello,

    I attached screenshots made when trying to track 2 images and detect which one is at the left position and which one is at the right position.

    Device : OnePlus 5T
    Center World Mode : DEVICE
    Tracking mode : POSITIONAL
    Fusion mode : Optimized from Image Targets and VuMarks
    Focus mode = CameraDevice.FocusMode.FOCUS_MODE_CONTINUOUSAUTO

    I noticed that tracking is quite not accurate, when moving the image the associated gameObject does not follow quicky and the position is often wrong.

    I compare game object position to check which one is at the left position and display the result in a text at the top of the screen. As you can see the result does not "match" the image (print) positions.

    Screenshot_20180713-094252.jpg Screenshot_20180713-094303.jpg Screenshot_20180713-094317.jpg Screenshot_20180713-094330.jpg Screenshot_20180713-094342.jpg

    Is it possible to accurately track an image and be sure that game object tracking an image will have a position that reflect the image position ?

    Thanks
     
  5. henriqueranj

    henriqueranj

    Joined:
    Feb 18, 2016
    Posts:
    156
    Hi Kiupe, I've been noticing that the new Vuforia 7.2.20 has been dealing with positions in a strange way (at least for me with model based tracking).

    However, I advice you to see which position are being set to the image trackers position in the Inspector, check it live while you play in the Editor so you can better understand the coordinates reference. It may be that your reference sizes for the markers is too small and therefore, the values may be awkward.

    For calculation of how one marker relates to another in direction, I advice to calculate the distance vector between marker positions (direction = position1 - position2) and then get the normalised vector: https://docs.unity3d.com/ScriptReference/Vector3-normalized.html
     
  6. hienvic97

    hienvic97

    Joined:
    Mar 19, 2020
    Posts:
    3
    Hi Kiupe, did you find the solution?
     
  7. jaluakbar

    jaluakbar

    Joined:
    May 12, 2020
    Posts:
    1
    Hi Kiupe, did you find the solution?
     
  8. samidr8

    samidr8

    Joined:
    Jan 25, 2019
    Posts:
    1
    I have the same concern. Is there any solution?
     
unityunity