Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Color Tracker v1.0

Discussion in 'Assets and Asset Store' started by yezaldivar, Aug 24, 2016.

  1. yezaldivar

    yezaldivar

    Joined:
    Aug 24, 2016
    Posts:
    147
    Hi everyone, I would like to introduce you our new asset: ColorTracker v1.0

    Here are some interesting features included:

    • Allows to add multiple trackers with several color targets to the scene.
    • Variable accuracy options for color tracking.
    • Allows to adjust the tolerance to lighting changes.
    • No external dependencies. Full C# source code included!
    • Tracker allows to add/modify/remove color targets or change any other settings in real time.
    • Easy integration with the Unity input system for touchless user interfaces.
    • Runs in almost all platforms (tested in WebGL, Android, iOS, Windows Phone, Windows, Mac OS)
    • Suitable for Augmented Reality scenarios or NUI game logics.
    • Easy to use, incredibly scalable and you just need a few steps to get it working.
    • Demo scenes are included.

    So any comments or help needed we are here at your disposal!

     
    Last edited: Oct 19, 2016
    Malbers likes this.
  2. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,559
    Nice!! I like it
     
  3. yezaldivar

    yezaldivar

    Joined:
    Aug 24, 2016
    Posts:
    147
    Hi

    We just released the version 1.0.1 with some interesting features listed below

    - Now you can set different color tolerance by each target.
    - Added linearVelocity property to TrackerResult.
    - The center property in TrackerResult has changed to Vector3. (early preview for 3D estimation is now available)
    - Added isRunning property to ColorTracker.
    - Added ITrackerEventListener interface that allows to implement the delegate pattern and listen events generated by ColorTracker.
    - Updated Augmented Reality demo with depth estimation.(early preview)
    - Added device explorer to VideoCapture allowing to choose the video input source when multiple cameras are connected.
    - Added playOnAwake property to ColorTrackerPanel.
    - Improved inspector components.
    - New Fruit Cutter game included in demos.
    - Several code optimizations and cleanup.(speeded up to 1.5x)

    Check it out here
    https://www.assetstore.unity3d.com/en/#!/content/69812

     
    ethanwgross and Malbers like this.
  4. shasha2001

    shasha2001

    Joined:
    Mar 12, 2015
    Posts:
    1
    hi i habe buyed your asset i have issue with android its really laggy i dont know how to make it fast and i need to know some of the applications where i can use it actually i understand its just color tracking so it will be in 2d but is that possible if we can achieve 3d tracking with it somehow ?
     
  5. Malbers

    Malbers

    Joined:
    Aug 7, 2015
    Posts:
    2,559
    Hey there, Yoan is away on vacation until January 8th on Cuba so he won't be available until then.
    Cheers
     
  6. yezaldivar

    yezaldivar

    Joined:
    Aug 24, 2016
    Posts:
    147
    Hi there

    Sorry for taking so long to respond your question. Please first verify that you have installed the version 1.0.1 because it has a lot of improvements aimed to mobile platforms. You can use the accuracy presets (Fast, Balance, Optimal) to select the speed of your analysis (Fast is the fastest :) ). If those presets doesn't fit your needs then you can modify the source code in the ColorTracker.Start() method, changing the _downscaleAmount = 2 to 4 (see the picture below). Be aware that this will reduce the precision of the tracker but increase the speed drastically. Other optimization you can do is to avoid of calling ColorTracker.Compute() method in every frame. In the examples that we provide that function is called in every frame due they are generic demos but for your specific project you may decide to call that function every 66 millisecons (15 FPS) it will reduce the computation time by skipping some frames.

    In the version 1.0.1 there is a demo (04-Augmented Reality) that includes a very early approach to 3D sensing. You can use this as reference to your projects.

    In the package you will find 6 different examples (included a Fruit Slice game) about how you can use the plugin, and of course you are free to build thousands of new ways to used it.

    There is a new version that will be available very soon that includes other features like color mapping that you can use for building augmented reality over paintings or hand writing.

    Thank you for being interested in our asset and we are at your disposal if you have more questions.
     

    Attached Files:

  7. ethanwgross

    ethanwgross

    Joined:
    Jun 25, 2014
    Posts:
    83
    Just bought the arcolib asset and I can't wait to get started. I saw this after doing some further exploring and it looks great! However, is this asset's functionality already included with arcolib? or is it completely separate? Thanks for any feedback.
     
  8. yezaldivar

    yezaldivar

    Joined:
    Aug 24, 2016
    Posts:
    147
    Hey!
    Thanks for your comments. No, ColorTracker is not currently part of Arcolib but in a future it probably will be. There are a lot of devs using ColorTracker with Vuforia and for that reason I decided to make it part of Arcolib one day. Anyways it will continue being an individual asset with updates and support so the people can use it separately if they prefer.
     
    ethanwgross likes this.
  9. ethanwgross

    ethanwgross

    Joined:
    Jun 25, 2014
    Posts:
    83
    I could certainly see why you would want to keep them separate because It almost seems more convenient that way for people who only want one or the other. It really is kinda its own thing when you think about it and would be preferable at least for me to just buy it separate rather than pay an upgrade or something. I really appreciate the hard work you put into making this a reality for guys like me man and I will certainly consider picking this up as well. Thanks for the feedback!
     
    yezaldivar likes this.
  10. gianzelada

    gianzelada

    Joined:
    May 9, 2017
    Posts:
    1
    Hello,

    I'm developing an application to run on a single CPU (Windows 10) that will use five USB cameras (800X600 pixels). These five cameras will track about 40 objects with the same color simultaneously.

    Does ColorTracker support this application?
     
  11. yezaldivar

    yezaldivar

    Joined:
    Aug 24, 2016
    Posts:
    147
    Hi
    Color tracking algorithms are computationally expensive so you should reconsider to use a CPU with 4 cores if you are going to plug five cameras. ColorTracker can use as many cameras as you need (the amount of your board and CPU supports) you just have to set one tracker per each camera feed. But for color tracks you can only track targets with different colors, with the current approach it is not possible to track multiple objects with the same color, you can track multiple objects at the same time but with different colors. ColorTracker also provides the color map, with this feature you can get all regions with the same color. So if you decide to use ColorTracker you just have to set up your project with five camera input sources and five trackers. Be aware that detections has not any relationship between multiple video sources.
    Have a nice day!
     
    Malbers likes this.
  12. timmypowergamer

    timmypowergamer

    Joined:
    Mar 14, 2012
    Posts:
    17
    Hi,

    Just started using this today and I am running into a bit of trouble trying to get your VR headsets example working with a GearVR on a Samsung Galaxy S7 phone. Out of the box the example doesn't work at all, mainly because it is set up to work with the UICanvas in Screen space rather than World Space, which as far as I know doesn't work with VR (not even in Cardboard since 5.6, as I understand it. Though I may be wrong as I don't actually have a cardboard to test it with). I tried using the Augmented Reality renderer instead so it would position things in world space (minus the depth estimation), which got things somewhat working, however I am getting dismal performance compared to the example video you show above. In your video, the tracking stays fairly smooth and reasonably easy to control, but in my case it's very hard to get tracking in the first place, and when it does it jumps all over the place. I have the tracker set to optimal, using a hot-pink target against a near white background, with the best lighting I can muster. I have also tried reducing the amount Compute() is called by setting it up to run in a coroutine at 15-20fps, in case it was a problem with processing time, but nothing seems to help. Wondering if you have any ideas on what I may need to change or do differently?

    Thanks.
     
  13. yezaldivar

    yezaldivar

    Joined:
    Aug 24, 2016
    Posts:
    147
    Hi
    I really sorry that you are having so many issues with the asset, I will try to help you to achieve your goals. The first thing you can do is to add some calibration phase on your app where you get the color from the screen region just to be sure that the color target is the proper one. Colors look different from one sensor to other so you can also increase the tolerance in the target if you are sure that your target is prominent enough relative to the environment. Then the scene, I know it may be confusing that UIElments are in screen space, and as you said to use it in stereo mode it needs to be in world space, but this scene is meant to be a base to all VR projects without adding dependencies to specific VR SDK (even for those that doesn’t need stereo techniques) for that reason I decided to leave it in screen coordinates. You can use the Augmented Reality renderer if you want but also you can use the same UIElements in canvas just set the object layer to Default (to be visible to perspective camera) and switch the canvas to World Space, after some scale and position adjustments it should work great. The Compute() function is not too computationally expensive in this scenario but for VR control the resolution used to start the camera is important because the tracks are projected to screen points and if the camera resolution is 640x480 imagine the points projected to 1920x1080 will jump all over the place, causing the tracker to continuously lost the tracking. So to achieve a smooth control my advice is to start the camera in the highest resolution available in your system, use the UIElments in world space, and implement a calibration phase to get the color directly from camera feed. Keep using the optimal profile to avoid any downscale internally. Additionally I use KalmanFilter to remove some jitter in the tracks position but if you want you can replace this with a simple Vector3.Lerp, for certain scenarios it will provide better results, reducing the responsiveness but reaching better smoothing. Please if you continue having issues write me I will help you as soon as I can.
     
  14. timmypowergamer

    timmypowergamer

    Joined:
    Mar 14, 2012
    Posts:
    17
    Thanks for the fast reply. I'll try those suggestions and let you know how things go :)
     
  15. ina

    ina

    Joined:
    Nov 15, 2010
    Posts:
    1,085
    Hi, for your rear camera on iPad, it seems everything is inverted - how do you flip the camera?
     
  16. kinziacck

    kinziacck

    Joined:
    Apr 23, 2013
    Posts:
    1
    tried the 1.0.2 version with unity3d 5.6.1 android, 03 VR headsets + touches, the rear camera did not capture anythings and checking the colour after making the unity player settings to "Virtual reality supported"(true) -> Cardboard

    Also tested the "04 Augmented reality", it is work and the webcamtexture is shown in background if the virtual reality supported is true in player settings, the webcamtexture is not working.

    Thanks
     
  17. mrdavletdinov

    mrdavletdinov

    Joined:
    Jun 25, 2017
    Posts:
    4
    hello! i buyed your collor tracker.. good but in your video quality is better and it work very fast.. i have slideshow im my camera(( i set faster. what can i do.. and why camera have a scale.?
     
    Last edited: Jun 26, 2017
  18. lucasbenders

    lucasbenders

    Joined:
    Jun 12, 2015
    Posts:
    3
    Hello! I have a question regarding the Color Tracker plugin. It gets extremely slow when using the mobile camera running Android, making it almost impossible to use it on the device to track the colors. I already changed the downscale as you said and it did not help. I also bought Arcolib, and its Input Controller is much more complete, making the apps very light using Native Camera and 640x480px. Do you have any idea how to solve this problem? How to make the applications lighter using Color Tracker while using the camera as background? Thank you and congratulations for the amazing work.
     
  19. yezaldivar

    yezaldivar

    Joined:
    Aug 24, 2016
    Posts:
    147
    Hi sorry for my delayed answer. The provided demo is not meant to be used with virtual reality mode because in this mode Unity takes control of the camera and webcam texture may fail. It would be nice if you can include a color calibration scene to fetch the color before to go to the tracking scene, just to be sure the color is the same of your target. Colors may look different depending on the sensor (camera) used, so I think a calibration phase will fix your problem.
     
    Malbers likes this.
  20. yezaldivar

    yezaldivar

    Joined:
    Aug 24, 2016
    Posts:
    147
    Malbers likes this.
  21. yezaldivar

    yezaldivar

    Joined:
    Aug 24, 2016
    Posts:
    147
    Hi I assume you're trying the plugin in mobile device. When you run the algorithm in mobile devices there are two things to consider the screen resolution (if you are using ScreenInput) and the device processor. If your device screen resolution is too high you must increase the downscale to increase the performance. Also you can call the tracker.Compute function inside a different thread and use the tracker.GetLatestResult in the main thread this will give you better performance.
     
    Malbers likes this.
  22. yezaldivar

    yezaldivar

    Joined:
    Aug 24, 2016
    Posts:
    147
    Yes, the camera included in Arcolib is faster mainly because the processing is written in C++ which deliver a better performance than C#. Maybe you can use the best of both plugins and adapt the InputSource of Arcolib to ColorTracker due they are similar. Anyway I will improve the InputSource of ColorTracker in the coming version. Thank you for your comments.
     
    lucasbenders and Malbers like this.
  23. lucasbenders

    lucasbenders

    Joined:
    Jun 12, 2015
    Posts:
    3
    Nice, thanks! :)
     
  24. jeffery_koh

    jeffery_koh

    Joined:
    Jun 22, 2017
    Posts:
    4
    May I know how we can go about calling the ColorTracker.Compute() method only when we need?
    Or is there a way i only start the tracking when i only need it? Thanks
     
  25. mrdavletdinov

    mrdavletdinov

    Joined:
    Jun 25, 2017
    Posts:
    4
    How to determine the required indicator for me by color. Find it position. Is it possible to force a certain object to move instead of an indicator and for each color its object? for example red cube moves to red indicator position, blue to blue?
     
  26. jokosan

    jokosan

    Joined:
    May 6, 2015
    Posts:
    2
    hi , i am having trouble with detecting color on smartphone because the asset has not an color calibrator or something like that ,can you please add it in the new update ? it would help a lot, thanks.
     
  27. yezaldivar

    yezaldivar

    Joined:
    Aug 24, 2016
    Posts:
    147
    Hi
    Once you track the color target you can get its position and then apply a Lerp (linear interpolation) to other objects so they can go from their position to the indicator target position smoothly. Then indicator is just a visual reference to see where the targets are.
     
  28. yezaldivar

    yezaldivar

    Joined:
    Aug 24, 2016
    Posts:
    147
    I will add a calibration scene in coming version. Thanks for your feedback.
     
  29. yezaldivar

    yezaldivar

    Joined:
    Aug 24, 2016
    Posts:
    147
    Hi
    You can start/stop the tracker anytime during the game. When tracker is stopped the analysis is halted (even if you call Compute() function see the source code). But also you can increase the detection performance if you decide not calling the ColorTracker.Compute() function in every frame or calling it in another thread.
     
  30. mrdavletdinov

    mrdavletdinov

    Joined:
    Jun 25, 2017
    Posts:
    4
    i unerstand it but how i know that tracker is traking for example green color? and another blue color? i want to lerp my cubes for each color? if target have for example tag, green target.... or script with data of a color wich will be changed when instantiate. Answer please how can i do it?
     
  31. jeffery_koh

    jeffery_koh

    Joined:
    Jun 22, 2017
    Posts:
    4
    Hi
    I added the Interactive Item script for my application. It works fine with the debug statements printed "PointerDown called", "OnPointerUp called" and "OnPointerClick called". But when i tried to Add New Event Type, with my function added, it does not work. May I know what might be the problem. Thanks
     
  32. ddsinteractive

    ddsinteractive

    Joined:
    May 1, 2013
    Posts:
    28
    How do we setup the colortracker to move a 3D world object in space instead of linked to the canvas? I found an example using TSPS but we don't want to have another layer running behind our full screen app.

    Here is the example link:


    We are using an ortho camera for the colortracker with layer culling using the "Screen" setting but only showing the processed webcamtexture (openCV for the thresholding and contour finding). Then, we have a perspective camera with a top down view of our scene. The camera will be mounted above a floor and when the people walk through we want to track them and show a result on a floor projection.

    Anyone have any luck with this?
    Cheers,
    Monica


    ** UPDATE 10/01/17 **
    We are using Color Tracker along with OpenCV to do the mapping.
     
    Last edited: Oct 2, 2017
  33. Ajusay74

    Ajusay74

    Joined:
    Oct 20, 2014
    Posts:
    2
     
  34. RiccardoAxed

    RiccardoAxed

    Joined:
    Aug 29, 2017
    Posts:
    119
    Hi, I mainly work on Virtual Reality projects - GearVR, GoogleVR - and for my next VR project I've to develop a UI with hand interactions, so I would have a go with your plugin, more specifically using the procedure you did show in your "Touchless" video, so with my user wearing a glove with colored finger tips.

    I would ask you a couple of questions about your plugin:

    - Does it allow to know which tracker is following a specific color? My idea is to track just the user's forefinger and thumb, using two distinct colors, but of course I have to know a specific finger's position (let's say the "who is who").

    - What stage did you reach about depth estimation? Do you think it could be used to detect a Press gesture? I mean, user pointing wth his forefinger and slightly moving it away from camera - and back - like he was pressing a button.

    Thanks!

    Riccardo
     
  35. uhlv

    uhlv

    Joined:
    Nov 30, 2017
    Posts:
    2
    When you will release the second version?
     
  36. yezaldivar

    yezaldivar

    Joined:
    Aug 24, 2016
    Posts:
    147
    Hi
    Sorry for my delayed answer. Yes, it is possible to detect tracks ids (each color target represent a unique id) but you need to use different colors in each hand because the algorithm will track the best accumulation of color in the scene, for example if you use a red finger in both hands it will only track one of them.

    The depth estimation can be achieve using the color area but the changes must to be very prominent to be detected I don’t know if it works for tiny movements like select with the finger.
     
  37. yezaldivar

    yezaldivar

    Joined:
    Aug 24, 2016
    Posts:
    147
    I have been working trying to optimize the algorithm to make it faster but I have not finished. I am also evaluating the native implementation variant to take advantage of C++ fast memory operations. When I beat the performance issue I will release the new version.
     
  38. uhlv

    uhlv

    Joined:
    Nov 30, 2017
    Posts:
    2
    Good luck! If you can reduce the screen resolution somehow.. I think it will be faster. It doesn't required high resolution to track a simple color.
     
  39. ddsinteractive

    ddsinteractive

    Joined:
    May 1, 2013
    Posts:
    28
    We are having fun with the colorTracker package, thank you!
    We are working with one color at the moment for testing and are ready to add in a second or more colors. Is it possible to have a setting for a "buffer zone" around a tracker so that if there are two colors quite close in shade they don't "snap" to each other? For example, red and orange or blue and teal. Is that the threshold and how does that work?

    Thank you!
    Cheers,
    Monica
     
  40. ina

    ina

    Joined:
    Nov 15, 2010
    Posts:
    1,085
    Is it possible to get the color tracker working on the arkit device camera (not the unity webcam and not on-screen)
     
  41. ddsinteractive

    ddsinteractive

    Joined:
    May 1, 2013
    Posts:
    28
    Good day!
    Is there no solution to this question yet?

    Cheers,
    Monica

     
  42. ckyu

    ckyu

    Joined:
    May 8, 2014
    Posts:
    1
    Hi,

    I have used this colour tracker for my interactive project development, my project is playing with some wooden boxes (painted colours) as tracker points to connect the 3D models together in unity, but I have found this is only able to have one colour with only one tacker.
    So If I want to have 4 RED wooden boxes, can it be possible to have 4 trackers?
     
    Last edited: Feb 7, 2018
  43. Macode

    Macode

    Joined:
    Nov 28, 2013
    Posts:
    38
    Could you tell me if I can get the tracked color?
    I rely on ColorTrackerRenderer.OnPostRendermethod to get the data, but no way to match the data from the ColorTrackerPanel to the received data.
     
  44. vertexx

    vertexx

    Joined:
    Mar 18, 2014
    Posts:
    379
  45. yezaldivar

    yezaldivar

    Joined:
    Aug 24, 2016
    Posts:
    147
    Hi! for a more advanced approach, you can use the core module (please see the core folder/directory).
    The file ColorTracker.cs contains all the source code. But I think for detecting the color you can use the TrackerResult id after calling the ColorTracker.compute function, please see ColorTrackerRenderer.cs line 106. Each
    TrackerResult.id is going to be persistent among frames and contains the index in the same order as the registered colors to track. For example, if you registered red(1), green(2), and blue(3) as colors for tracking (those are the
    colorTargets (see ColorTrackerPanel.cs line 22), then if the tracker detects the green color, the TrackerResult.id will be 2 (because is the index +1 value) if you have multiple colors targets you can always use the TrackerResult.id to know from which color target that tracking result belongs to. Please look where in the ColorTrackerRenderer.OnPostRender function you can do your custom action. I hope this helps. The best for you!!
     

    Attached Files: