Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Unified Coordinate System for String and QCAR

Discussion in 'Scripting' started by Elecman, Oct 15, 2011.

  1. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,369
    UCS supports Android, but only with marker recognition using Vuforia, so no SLAM.
     
  2. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    Ah, I understand now. Thanks for the clarification.

    PointCloud promised Android support over 2 years ago now, so I'm assuming they must have just scrapped all their plans for future support.

    You seem to be pretty well-versed in AR. So would you mind me asking one more question. Have you worked with Metaio, and if so what are your thoughts on their SLAM implementation? I've been looking for a SLAM SDK that seems to support Android and iOS out of the box, and they seem to be the only ones who do that.
     
  3. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,369
    I have just played around with Metaio a bit but I was not impressed. Tracking seems sloppy and certainly not worth the price they are asking for it.

    13th lab are also working on a new API called Rescape. Now that I am impressed with:


    They say they are working on Android support as well but the issue is not the platform itself but the sheer number of different cameras with each its own distortion parameters. IOS devices are less fragmented so they focus on that first.
     
  4. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    Thanks for the info on Metaio, I was contemplating using it due to the 3D Object tracking, but if its tracking is sloppy maybe I'll pass on it.

    Have you heard of the Xloudia SDK? It seems like it's newer and supports a lot of devices, but I've yet to see a community around it, or anyone mention using it.
     
  5. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,369
    I didn't hear of that. Thanks for the link.

    I had a look at it but I don't think it is suitable for UCS. First of all it is way too expensive. Second, it doesn't recognize binary markers so viewing distance is an issue. Third, it requires internet. It seems to be geared towards marketing only.
     
    Last edited: Nov 18, 2014
  6. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    Based on the fact you said Xloudia is geared towards marketing I'm guessing you wouldn't recommend it for AR games, so I'll forego that SDK.

    It looks like based on my frustration and multiple attempts to get Metaio's sample projects working in Unity, I'll probably use Vuforia and your UCS project. Do you know is the link to download your plugin on the first page of this forum up to date, or is there a better place to access the most up to date version of UCS?

    Finally, I saw your UCS project supports String. Are there any benefits to using String vs Vuforia based on your experience using them in Unity? The same question with Studierstube Tracker?

    Thanks for your wealth of information by the way. I'm part of the AR R&D at my smaller company, and you've really helped me out a lot.
     
    Last edited: Nov 19, 2014
  7. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,369
    The link on the first page of this thread is the most current one.

    I suppose you can still use Xloudia for AR games but I don't think users will be impressed with the fact that they constantly have to be connected to the internet. With AR games you usually only have to recognise a few markers so that makes marker recognition very fast and you don't need the power of the cloud for that. If you need to recognise hundreds of different picture based markers (even thousands of binary markers is still very fast) then you do need a faster solution but that is unlikely the case for AR games.

    Both Metaio and D-Fusion position themselves at the very best of what is available given their price. But with both of them I am not impressed at all. They have jittery tracking problems and last time I checked D-Fusion used a legacy video feed solution for Unity which is incredibly slow, with a near realtime version already being available for more then a year, including Unity source code examples. I reported this on their forum but user support seems non-existent.

    String is actually the very best available of picture based marker tracking in my opinion. It is incredibly fast and super stable. But unfortunately it has been discontinued. It looks like the team left their original employer. They are working on something better they say but so far no details.

    Vuforia is the second best available, especially considering it is free. It is based on StudierStube ES (mobile version) and they bought the exclusive rights to use it. Because of this, StudierStube ES is not being developed anymore but Vuforia is. StudierStube (desktop version) is also not being developed anymore and unless you know where to look (I can give you the contact), you can't get hold of the SDK either. That is a pity because it is the best binary marker desktop tracking solution out there by far.

    Either way, I think the future of AR games lies in SLAM based tracking. The tech isn't quite there yet but it is getting very close (see 13th Lab). And if the display tech presented by MagicLeap really exists, the future of AR isn't in phone and tablet experiences either. But we are talking several years ahead. For now I would say, go with Vuforia. Don't invest too much in marker tracking software because it will be outdated very soon. Instead, focus you efforts on content creation as that will remain the same for marker tracking, SLAM, and even VR.
     
    Last edited: Nov 19, 2014
  8. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    @Elecman, you have seriously been an incredibly helpful resource with regards to my exploration in AR. I would definitely be interested in a contact to the StudierStube desktop SDK. :)

    Do you know if there's any SDK that works with Unity that can work through a native Web Browser (not Unity Web Player) implementation? Right now one of my studio's requirements is to get a good AR game running on Windows 8 Phone in Unity, and because all the SDK's I know of only support iOS or Android, this has been a source of frustration for myself. My thought was perhaps to use a native Web Browser solution, but I wasn't sure if that was the best approach.
     
    Last edited: Nov 19, 2014
  9. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,369
    I have PM'd you the contact. bear in mind that the picture based markers with StudierStube Tracker (desktop) is not necessarily the best there is (I have never tested that) but the binary tracking is top notch.

    An AR SDK that works through a native web browser on any platform isn't really an option because it would be incredibly slow. Recognizing and tracking an image is extremely script heavy and the only way to do that fast enough is by running it in native code, making use of hardware accelerated vector functions where possible. For example, on Android you will have to run it in C++ and not in Java. So that is never going to work in a standard browser without a plugin. That is why you need to support each platform individually and since Windows Phone does't have a big market share, most SDK providers opt out of that. Maybe Vuforia will support WP one day, as it is a much requested feature.
     
  10. GhostSoar

    GhostSoar

    Joined:
    Nov 25, 2014
    Posts:
    4
    I have problem like it.I saw you have solved it.Can you share your test project?I can't solve it from different angle myself.Thanks a lot.
     
  11. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,369
    Have a look at the first post of this thread. It contains a link to the source code.
     
  12. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    Thanks for the PM, I was able to get a hold of your contacts.

    I had a question, that maybe you might be able to answer for me related to the project I'm working on.

    We want to have two separate AR markers (marker 1 & marker 2), in which marker 2 is offscreen from marker 1.

    If the player looks at marker 1 then a ball bounces from marker 1 to marker 2. We'd like it so that once the ball moves from marker 1 to marker 2 if the player moves the camera to view marker 2, which is offscreen from marker 1, that the ball itself is not lost in the players transition.

    Currently, it seems like if the world center is set as marker 1 in Vuforia, when the player moves the camera offscreen to watch the ball bounce to marker 2, the ball is lost. Thus, the only way I thought to accomplish this is though having the camera as the world center, but this also seems like it would have its own difficulties.

    With Vuforia's current state is it impossible to keep track of an object in world space if you tell the object to move from marker 1 to marker 2, if marker 1 is lost, and marker 2 is not yet found?
     
  13. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,369
    You can do this easily with UCS. When you record a scene, you can select which marker will be used as the world center. As long as one of the markers remains in view, it should work as you described, provided that the game logic works correctly of course.
     
  14. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    Ah, I see. Is there a way to setup the UCS scene ahead of time, instead of at run-time, which you do in the video demo?
     
  15. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,369
    Yes, you only have to record a scene once and then you can distribute the save file.

    You could also edit the save file ahead of time but that is undocumented and would be very difficult anyway since it is all quaternion based. I get this feature request a lot but I don't see how that is going to be more accurate than a recording.
     
  16. abdulthegamer

    abdulthegamer

    Joined:
    Sep 14, 2013
    Posts:
    4
    Hi @@Elecman,
    I have been using UCS since few days and i followed the instructions given in the documentation and it all worked successfully till the recording of targets and selecting a marker as origin. Then i need to draw a plane around the targets so i can make the objects on the plane. I extremely need your help. I have also installed Vectrosity 3 and have Unity 4.5.2.
    Questions i have :
    How to add plane on to the table like you have shown in the video?
    How to add geometry.?, Its saying first select 3 points.
    How do i select 3 points.? So instructions for it is not on manual and i could not figure it.
    Can you please help me by sending any manual or any video for the latest version.?
    It would be very helpful for me and others too.

    Thanks & Regards,
    Abdul Ahad.
     
  17. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,369
    Once the scene is recorded and saved, press the "Add Geometry" button.
    The green dots are connected to the corners of the markers. If they don't show up then Vuforia is not installed correctly.
    Select 3 dots (by tapping on it) and then press the "Add Plane" button.
    Save the scene and now go to game mode. The plane is there but you can't see it. It is just there for collision detection.

    Let me know if that helps.
     
    abdulthegamer likes this.
  18. abdulthegamer

    abdulthegamer

    Joined:
    Sep 14, 2013
    Posts:
    4
    Thanks for your answer .... Will try and let you know asap..
     
  19. falcorocks

    falcorocks

    Joined:
    Dec 10, 2014
    Posts:
    2
    Hi.
    I am new to Unity and Vuforia. I followed the UCS Manual several times in the last couple of days but the thing just won't work. I'm trying to use a set of Image Targets which work fine with Unity+VUforia.
    The problem is the app on my android device do absolutely nothing when targets are on sight. they don't become blue ecc. I have to do a project with multiple static markers and vuforia is not very accurate when I move around (crazy things happen to the 3d objects, some start to bend, other just flash and move).
    So when i first saw your video in the first page I thought UCS was a great solution regarding stability issue.
    My project is to reproduce a set of chair in an airplane.

    What should I do? Is UCS good for my project?
    BTW I'm not using ANY of the optional programs, just Unity and Vuforia, since I just need my own image targets.
     
  20. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,369
    First of all, make sure that the markers have a good tracking rating and that they track well in one of the Vuforia demo scenes. If your markers don't track well, UCS can't fix that. The main thing UCS does is stitch all markers together into a single coordinate system so that your 3d scene will always be visible as long as one of the markers is in view.

    That being said, the markers should at least show up blue. Did you change the name of the dataset?
     
  21. falcorocks

    falcorocks

    Joined:
    Dec 10, 2014
    Posts:
    2
    Markers work fine in other projects, they are rated 5/5. I changed the name of the data set.
    Is there a way i can give you a log or something so that you can understand what's wrong? Thank you for your time
     
  22. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,369
    Did you also changed the name of the dataset in the source to reflect this?

    You can send me your project if you want and I will have a look.
     
  23. broflex

    broflex

    Joined:
    Feb 14, 2015
    Posts:
    1
    Hi

    We are a group working on augmentation as a school project. We are trying to create a game where you can play pool in 3D. The idea is to have markers on the different surfaces you would like to interact with, e.g. floor, walls and ceiling.

    The idea is to create a see through rectangle and attach it to a surface, so that the balls can bounds off of it. As we need multiple rectangles to attach to different surfaces we need them to be positioned relative to their respective markers on the particular surface.

    Is there any easy way of setting the position of 3D objects relative to markers other than the one chosen to be the origin?
     
  24. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,369
    Yes, UCS supports that. Check the geometry creation section in the manual for further details.
     
  25. Heino

    Heino

    Joined:
    Jan 3, 2013
    Posts:
    6
    I downloaded USC to make it work with Vuforia 3.0.9 and it does seem to work with the four image targets I've created in the Image Database. When I start the USC scene from the editor and point my webcam at the printed image targets, I get four blue squares highlighting the image targets in my webcam feed. I also seem to be able to add squares and spheres to the targets, so I'm assuming everything work as intended.

    My problem is - I guess - that I don't really understand how I'm supposed to make use of USC :) Our setup is rather simple in that we simply have some 3D objects that we want to show in the world, according to where the image markers are. In a normal Vuforia scene with just one image target it is simply a matter of setting the 'world center' to the specific target we're looking for and then our 3D objects show up in the right place. However, since we want to be able to move the camera around - potentially losing tracking of the marker - we'd want several markers that would make up a world coordinate system, which I assume is what USC is doing. So what I want to do is simply lay out the image targets in a Unity scene in a specific pattern and then set up the 3D objects according to that layout. In our case we know that the markers are always placed with the same distance to each other in the real world, so they basically just act as four corners of a plane.

    I know it might sound a bit confusing, but basically we just want to use the markers to find a specific point in our Unity scene coordinate system. So when a certain marker is tracked, we know that it might represent i.e. the coordinate (0,0,0), while a certain other marker would be coordinate (10,0,0) and so forth. Would this be something to do with USC?
     
  26. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,369
    If you want to get the coordinates of a marker once the coordinate system has been unified, it should be possible, but I didn't design a specific API for that. I think the best way is to scroll throught the Hierarchy in the Editor and find out where your markers are so you can fetch the coordinates.

    If you want to make that process repeatable, you probably need to do some coding though.
     
  27. pixelshader

    pixelshader

    Joined:
    Dec 14, 2012
    Posts:
    17
    Hello,

    Does UGS work with Vuforia 4.0?
     
  28. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,369
    I didn't try this yet but let me know if it doesn't work.
     
  29. EmmyxD

    EmmyxD

    Joined:
    Apr 28, 2015
    Posts:
    3
    Hi!

    I just tried to use your UCS package with vuforia for unity version 4.0.105, unity version 5.0.1
    Using your manual I get an error message after first importing vuforia and than importing UCS (as stated in the manual)
    Assets/Scripts/Vuforia.cs(19,14): error CS0519: 'Vuforia' clashes with a predefined namespace

    Did I do something wrong? Or is it maybe caused by the new vuforia version?
     
  30. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,369
    Most likely UCS is incompatible with the latest Vuforia version. I will have a look. What is the full error?
     
  31. EmmyxD

    EmmyxD

    Joined:
    Apr 28, 2015
    Posts:
    3
    I'm really unexperienced in unity as well as programming, so sorry if I say something weird :)
    with full error you mean the code where the error refers to? When I double click the error in unity, this is what what opens in monodevelop
    upload_2015-4-28_14-32-35.png

    In Unity, this is what is shown:
    upload_2015-4-28_14-32-57.png
     
  32. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,369
    Oh, I see. I will have to rename the file Vuforia.cs and change all the references. It's a bit annoying that every time they update Vuforia, things break :-/

    By the way, if you are not a programmer I think UCS will not be of much value to you of course you can always have a play with it.
     
  33. EmmyxD

    EmmyxD

    Joined:
    Apr 28, 2015
    Posts:
    3
    I can imagine, it's also quite annoying that it doesn't seem to be possible to download earlier releases of Vuforia, so I'm kind of stuck with this one >.>

    And well I'm not a programmer but a designer, and I want to make a prototype using your code and a series of markers. I have some experience with Unity and Nyartoolkit, with which I did some programming, so I know the basics.. I hope to have enough knowledge to be able to use your tool, I'm very greatfull for people like you posting their codes and being this helpfull, because I often am able to understand these things and alter them where necessary, but not how to make them myself!

    That's why I'm interested and having a go at it :) To explain that a little bit haha
     
  34. Nguyen Huy Thach

    Nguyen Huy Thach

    Joined:
    Jan 14, 2013
    Posts:
    26
    Hi Elecman,
    Could you give me some suggestions on how to change the mesh of object in Special Effects\VidTexPatch. In your sample, the default mesh is a plane (lidTop), how to change to other mesh?

    Thank you in advance,
     
  35. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,369
    The only custom geometry which is supported is the build in Plane (not the quad). Any other type of geometry is not supported. This has to do with the special UV mapping done by the shader. If you want to use the plane, you can just modify the box example to use that.

    In theory it could work with any type of geometry but that has been on the to do list for very long already...
     
  36. Nguyen Huy Thach

    Nguyen Huy Thach

    Joined:
    Jan 14, 2013
    Posts:
    26
    Thank you for your reply,
    Can I modify the scale of lidTop to match the ratio of image marker? Currently, it only works with a square scale. Or do you have any suggestion if the marker is not square?
    Thanks.
     
  37. Nguyen Huy Thach

    Nguyen Huy Thach

    Joined:
    Jan 14, 2013
    Posts:
    26
    In addition, to extract the texture in the surface of the libTop object (only the texture of marker), I use a camera looking forward to libTop, then I get the texture from that camera, but the quality of the texture not very high.
    Do you know how to improve the quality of the extracted texture or any method to extract this texture?

    I am sorry if I asked you too many questions,
    Thank you very much.
     
  38. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,369
    The scale has to be uniform, like 1,1,1 2,2,2, etc. If you wan to have a different shape, you can do this using a different mesh but make sure that the UV mapping is the same as with the plane, just "cut off" the edges.

    If you want to increase the video texture quality you can only do that by changing the Vuforia settings. I think they introduced a high res setting some time ago, although I didn't look into that.
     
  39. Nguyen Huy Thach

    Nguyen Huy Thach

    Joined:
    Jan 14, 2013
    Posts:
    26
    Thank you very much, Elecman.
    I will try your suggestions and give feedback here.
     
  40. Nguyen Huy Thach

    Nguyen Huy Thach

    Joined:
    Jan 14, 2013
    Posts:
    26
    Dear Elecman,

    I can make it work with rectangle marker as your suggestion, just by change the mesh of libTop. However, I don't know how to make a separate project with only Video Texture Patch effect for only one marker without combining of multiple markers.
    I have read Special Effect class. I can understand this class, but to make the separate project, I also read Marker Recorder and ARWrapper classes, but they are complicated, and I could not understand all parts of these two classes.
    I have seen one of your post in Vuforia forum at this link (https://developer.vuforia.com/forum/general-discussion/camera-pstch-unity-3d). I have done as your comments but I am unlucky to get it work.
    I also upload this project to Dropbox at this link (https://www.dropbox.com/s/8e9ydc3y4alxrvw/TestVidTexPatch.zip?dl=0).

    Could you please give me some advice how to make a separate Unity project with just Video Texture Patch effect. Or if you have time please look at my project and give me you opinion.
     
  41. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,369
    What errors or image artifacts are you getting?
     
  42. Nguyen Huy Thach

    Nguyen Huy Thach

    Joined:
    Jan 14, 2013
    Posts:
    26
    I got no error, but the texture is not as expected. Please see the attached file.
    VidTexPatch.png
     
  43. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,369
    I see, something is wrong with the UV mapping. I see that happen quite a lot in custom projects. Make sure to check this:
     
  44. Nguyen Huy Thach

    Nguyen Huy Thach

    Joined:
    Jan 14, 2013
    Posts:
    26
    I have followed all of that, but I think the problem is not from here. I think the problem may be from some wrong settings because I always get correct result in your UCS sample scene, but always get wrong results in the custom projects.

    If you have time, please have a look at my project at https://www.dropbox.com/s/8e9ydc3y4alxrvw/TestVidTexPatch.zip?dl=0
    Thank you very much.
     
  45. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,369
    The project you send me you made on a Mac, right? I am on windows, so I can't import that unless you export your project as a unitypackage.
     
  46. Nguyen Huy Thach

    Nguyen Huy Thach

    Joined:
    Jan 14, 2013
    Posts:
    26
  47. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,369
    Ok, I had a look at your project.

    Noting this from the manual:
    I noticed that the camera you use is called backupCam, and that one is not facing down.

    I recommend that you start with the full UCS project and remove stuff you don't need step by step. With each step you check if everything works, and then remove some more.

    Edit:
    It also helps to have a look at the original UCS project with the VidTexPatch example in the Editor Scene View. There you can see what the orientation of the camera is, what that camera renders, where the video texture is, where the object with the special effect is, and how that all relates together.
     
    Last edited: May 23, 2015
  48. Nguyen Huy Thach

    Nguyen Huy Thach

    Joined:
    Jan 14, 2013
    Posts:
    26
    Elecman,
    I have tried starting with the full UCS project and remove step by step, but this is a big project and I get stuck on simplifying Marker Recorder and ARWrapper classes. I will try more.
    Thank you very much.
     
  49. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,369
    Yeah, I know. Maybe I will create a proper standalone AR shader project but I am very limited on time. The shader itself has some bugs which I tried to fix a few times but without any success. I myself can only get it to work in specific situations only. I wish it was easier to get it to work but unfortunately I am not much of a shader buff either.
     
    Nguyen Huy Thach likes this.
  50. smtabatabaie

    smtabatabaie

    Joined:
    May 6, 2013
    Posts:
    45
    Hi , I'm developing an application which uses a feature like Microsoft Office Lens, which is cropping the marker from an image captured by the camera and then skew it to get the image of the marker without perspective. It reminded me of UCS , are there any ways you suggest to develop such feature?
    Thanks very much