Color Analyzing
  • audiovisualist
    junior Member
    Posts: 9
    Joined: Mon Jun 13, 2005 7:48 pm
    Contact:

    Color Analyzing

    by audiovisualist » Mon May 31, 2010 11:26 pm

    Hello,

    just a question. Is it possible to prepare a module with python script to analyze the color code of the preview window? Cause I will use DMX to send color information to an external light machine.

    Is there any way to realize it or should I try something like processing?

    I've seen an older post but that does not help me so far.

    Thanks for your comments.

    Enrico
  • Vibber
    super8 member
    Posts: 166
    Joined: Tue Sep 20, 2005 1:02 pm

    by Vibber » Tue Jun 01, 2010 10:08 am

    I'm a bit unsure if you mean

    1. Send the 'mean value' of the color of your image/movie ie. calculate the overall color of all the pixels in your image/move

    or

    2. Send the current r/g/b values of your color sliders

    No 1 will be tricky if at all possible whereas 2 should be quite easy. I haven't done no 2 myself but I know that it can be done with the existing DMX module.

    As to no 1 the problem is that you can't build modules that 'read' the pixels in your image. Actually I don't see any way to do this in M8 - Quartz Composer or Processing is probably the way to go
  • User avatar
    The Midi Thief
    master
    Posts: 483
    Joined: Thu Sep 29, 2005 7:19 pm
    Location: Stockholm, Sweden
    Contact:

    by The Midi Thief » Tue Jun 01, 2010 10:36 pm

    I was looking at this (what Vibber describes as no 1). As far as I know, you can't do it Modul8 but it's color analysis itself is possible in Processing. I'm however not sure how you access Modul8's video stream.

    If you do color analysis, think it through first. I didn't when I attempted this in Processing. If you do an average of an image you will most likely get a mushy grey color, not so fun to pass on to your lighting system. So how are you going to select your color? Look for the most dominant one? The brightest? You have to find an algorithm that works (there are probably ones written already) or maybe use a color picker.
  • audiovisualist
    junior Member
    Posts: 9
    Joined: Mon Jun 13, 2005 7:48 pm
    Contact:

    by audiovisualist » Tue Jun 01, 2010 10:49 pm

    hello Fry_up & Vibber,

    thanks for your posts. Regarding No.1 (that what I mean) I'v been looking further in the web for an alternative. I think with python and a image library it should be possible. But did you think i can import an image lib? and if yes, were should i store the lib? In m8 folders or in my python folders?

    I will see what future brings.
    If I found a solution I will post it.
  • User avatar
    The Midi Thief
    master
    Posts: 483
    Joined: Thu Sep 29, 2005 7:19 pm
    Location: Stockholm, Sweden
    Contact:

    by The Midi Thief » Tue Jun 01, 2010 11:00 pm

    Install your python library in /library/Python/2.3/site-packages/
    (the library folder straight on your hd not the one in your user's folder). Modul8 uses an older version of Python. If the library is built for a later version you might run in to some problems. They might be solvable but you have to know a bit of Python (or do good research) to fix it.

    But even if you do this, I don't know how you would access M8's video stream. But if you figure it out, pleas let us know.
  • Vibber
    super8 member
    Posts: 166
    Joined: Tue Sep 20, 2005 1:02 pm

    by Vibber » Tue Jun 01, 2010 11:22 pm

    I have the same doubts as Fry_up - how to access Modul8's video stream. That's not possible I think. The makers of Modul8 have not provided access for that...

    So you'd have to use some external application like a screen grabber (to get the video stream) and analyze that. And then it gets really complicated I guess.
  • Vibber
    super8 member
    Posts: 166
    Joined: Tue Sep 20, 2005 1:02 pm

    by Vibber » Tue Jun 01, 2010 11:26 pm

    Another route:
    Get into VDMX instead and build some custom Quartz Composer patches for analyzing the image + sending the DMX

    I haven't done it but I know that VDMX integrates far better with Quartz Composer than Modul8 does and that both things (DMX and analyzing color) are doable in a Quartz patch.
  • User avatar
    The Midi Thief
    master
    Posts: 483
    Joined: Thu Sep 29, 2005 7:19 pm
    Location: Stockholm, Sweden
    Contact:

    by The Midi Thief » Tue Jun 01, 2010 11:29 pm

    But hey, Vibeke, didn't you fiddle around with some some app that sends the screen output somewhere...? I know there are ways to route the output to an isight for example. If you can capture the output somehow with another app, you could probably pick it up in Processing or Quartz Composer (as a quicktime dv-stream or iSight) and makes some color analysis there. Then either send DMX from any of those programs (if possible) or send data back to Modul8 that sends the DMX to the lighting system. But after that whole chain the colors might have changed long time ago... there will be a latency of some kind. I'm kind of just shooting ideas here...
  • audiovisualist
    junior Member
    Posts: 9
    Joined: Mon Jun 13, 2005 7:48 pm
    Contact:

    by audiovisualist » Tue Jun 01, 2010 11:34 pm

    Hi Fry_up and Vibber,

    thanks again for your good comments. I'm your meaning and I think that it will not be possible to get the vid.out signal from modul8. My idea was, as been suggested by you, to start a separate app that analyze my screen or a part of it.

    But nevertheless I think I've got a solution and thank you both for your help.
  • audiovisualist
    junior Member
    Posts: 9
    Joined: Mon Jun 13, 2005 7:48 pm
    Contact:

    by audiovisualist » Tue Jun 01, 2010 11:37 pm

    @Fry_up,

    regarding python. Did you know the version of the python language used in M8 2.6.1??
  • User avatar
    The Midi Thief
    master
    Posts: 483
    Joined: Thu Sep 29, 2005 7:19 pm
    Location: Stockholm, Sweden
    Contact:

    by The Midi Thief » Tue Jun 01, 2010 11:42 pm

    Vibber wrote:Another route:
    Get into VDMX instead and build some custom Quartz Composer patches for analyzing the image + sending the DMX

    I haven't done it but I know that VDMX integrates far better with Quartz Composer than Modul8 does and that both things (DMX and analyzing color) are doable in a Quartz patch.


    Crap, why do you have to make things so easy when we could stick to Modul8 and complicate things?! Yes, VDMX would be much simpler since you can pass the video output through a Quartz Composer filter. But I'm not so sure that you can send DMX through Quart Composer. I've looked in to this before. There is a rather new plugin that lets you read DMX but not sending. And then the what ever software you have, it needs to be able to talk to your usb to dmx box. Remember that Modul8 only works with one Entec model at the moment. People have however sent dmx with qx but nobody says it's working great and I haven't seen a public plugin for it.
  • User avatar
    The Midi Thief
    master
    Posts: 483
    Joined: Thu Sep 29, 2005 7:19 pm
    Location: Stockholm, Sweden
    Contact:

    by The Midi Thief » Tue Jun 01, 2010 11:44 pm

    audiovisualist wrote:@Fry_up,

    regarding python. Did you know the version of the python language used in M8 2.6.1??


    Yes it's 2.3. I thought they might have upgraded, but no. I installed a library recently in the same path that I described earlier and that was the way to make it work in 2.6.1-
  • audiovisualist
    junior Member
    Posts: 9
    Joined: Mon Jun 13, 2005 7:48 pm
    Contact:

    by audiovisualist » Tue Jun 01, 2010 11:55 pm

    Hello Fry_up,

    I will try to install the image lib into the folder you've been described and then I will see if it will work.

    Talk to you soon.....
  • User avatar
    david
    garageCube team
    Posts: 217
    Joined: Tue Jan 08, 2008 1:14 am
    Location: Antibes, France

    by david » Wed Jun 02, 2010 8:29 pm

    Hi all,

    Modul8 is "using" Python 2.3 because it is the version that is bundled with OSX Tiger (10.4).

    As Modul8 supports Tiger/Leopard/SnowLeopard, we have to stick with this "older" version.

    Concerning image analysis to generate DMX outputs, we are currently working on a LedMapper feature in Modul8 2.7.

    Concerning DMX features, 2.7 will also add support for Art-Net.

    Regards.

    David
    David * GarageCUBE team * Modul8 developer

Who is online

Users browsing this forum: No registered users and 18 guests