• Hi all,

    I am working on a patch for an installation. In this installation, the system analyze objects colors in a Video-In input (from an usb camera) detecting colors in some little areas in which objects will be put, and consequentially managing videos. 
    Now I am using "typical" red, green and blue surfaces to be recognized from the camera, printing them with the more "pure" RGB as I can have printing, just changing the luma (in particular in green). In the izzy patch, I use the video in watcher increasing saturation on it and converting yuv to rgb, then Chopper (to isolate desired area) and the Measure Color actor. The system is working, but sometimes the colours are not corretcly recognized. Any suggestion for colours I can use for objects, for the best results?
    thanks in advance
  • Izzy Guru

    I went about it a different way for the two installs I have running in the museum at work...

    I used the chroma key (with about a 5% varience on the hue each side) then going into an eyes actor. So my patch looks for colour and size.
    I am tracking red and blue only but I did originally create the patch to track up to 6 colours.
  • Izzy Guru

  • Thanks Graham :)

    in fact, I actually don't need to track colours, because the places in which people can put the coloured objects are fixed, not moving. Just have to recognize them! 
    I need to measure colour in those places with best results, and depending on the colour detected and the place in which is, the system plays videos... I am wondering about my system, if is the best, also for performance: I will have 6 "fixed" points to scan, and in every point people can put the object (just one at time) and this object can be in three colour (so, I have to decide colors we will use). By now, I am working with Red, Green and Blue...
    Do you think I have to use chroma key before "measure colour" so I can be more precise and selective? Do you think this will affect performances (with 5 points, each of those with a "scan area", chop pixels, chroma key, 3 different measure colours, video projector, and so on...)?
  • Izzy Guru

    I am not 100% sure - I need to think about this.

    Not needing to track them is good and saves a lot of problems. Just undecided what is the best method for you.... I will think about it...
  • Tech Staff

    I have done a bit with color detection, mostly to run lighting via DMX.
    Your setup sounds solid..

    How are you testing the color values after Measure Color?
    Maybe you need to adjust the range of values you are looking at?? I think this is where you might find the tuning you are looking for.

    it can't hurt to trying the chroma key, and I can't see any harm other than processing speed..
    if it helps, and processing speed is an issue, you could scale down the image to start with, your test areas shouldn't really be effected..(I scale to 60X40 (testing many region) for some of my tests and its still very effective)

  • Hi Dusx,

    Effectively, I have to recognize solid colors, actually I boost a little the saturation, after I analyze them with Measure Colour actor and I observe a specific range (of course strongly influenced from the ambient light conditions). Thank you for your suggestion to reduce the image to start with (video in source), it is already yet reduces as pass through a chop pixel actor, used to scan only some little areas of interest...
  • Izzy Guru


    I would also check the camera and set it to manual. In automatic mode the camera tends to change aperture and white balance.


  • good idea michel. thanks :)

  • Hi everyone,

    today during a "massive" test I've discovered performance problems: after a while, performance decrease much (performance monitor says near 40-70 cycles).
    I have no idea on why -and so- on how to reduce them, I have tried to
    * don't use the yuv to RGB actor for the video in watcher
    * puts video in a DV PAL compressions for the test videos (very little, however)
    * use a chopper fast actor instead the normal chopper actor to "select" the area in which measure color
    but the performances remains very slow. I don' know how can I improve the patch in order to increase performances, my suspect is somewhere in the patch architecture is slowing performance and/or the camera input (an old macally camera, an economic usb-camera) is slowing the patch... can anyone help me? 
    I attach the patch (I've tried to clean and make it understadable...)
    thanks folks


  • Tech Staff

    I just gave it a test (had to replace fast chopper with standard, since i didn't have it in my install).
    I can report cycles that bounce between  80 and 200.. seems that they drop while and video is loading.. so the more switching happening the more they will be low..
    Since you have many videos switching (via color and counters) I think a big part of the equation is file size.
    What length, resolution, and codec are the video files.?
    I replaced them with 30 sec loops at 640x480, photo jpeg, and my frame rate is a solid 29.9/30 FPS
    VPO is low (20 ish) when the NON color video is playing and higher (upto 50ish) when a color video is playing, this seems to be 'possibly' due to feeding an up and down ramp to the intensity value of the projector simaltaniously. You may wan to take another look at the logic there, I suspect the comparators being set to always are having some unexpected results.
    All in all since the framerate is constant for me, I would say performance is fine, I am not showing the slowdown you are (again this could be a video resolution thing).

  • Hi DusX,

    thanks for your test! 
    Now, after keeping the mac off for an hour (not sleepig, really shut down), performance seems quite different, better. 
    I will try this night and after others testing I will post results...

  • Hi all,

    working with color detect I developed an user actor I want to share, maybe can be useful for someone...
    it is basically based on color detect, but allows to simply fix desired colour ranges, also provides to "force" results every n time
    there are some inputs and outputs "empty", cause I've used them just for visually organize inputs (and outputs)

  • here is the actor