top of page

Learning from others...

andreahywong

Updated: Jan 10, 2019

Since CHIMIRA is in its early stages, what better way to get things started than from the discoveries and pre-existing methods of fellow programmers?!


Today's Task: track one colour!

Let's start super simple:


Here's how Programming for People approached colour tracking, starting with color identification:

This was a great resource to get started with colour tracking using the #suckah Max object to identify selected colors and Max #Jitter!


Some new [objects] and terms I played with and learned today:

  • [suckah] - allows you to select a color under suckah and produce its RGB values, or input screen coordinates to get that pixel's RGB values

  • [jit.op] - applies binary (requiring 2 operands) or urnary (requiring 1 operand) operators

  • [jit.rgb2luma] - converts RGB to monochrome (single channel of color. Grayscale is a common monochrome with extremes of black and white)

Following the video, I've gotten Max to track a light orange here! Having lower #thresholds seem to be important for the #accuracy of the tracked colour.


I always forget what the variables in an ARGB list represent, so here's to some #review from MUSC 119!


A = alpha, represents #opacity, ranges from 0.0 (transparent) to 1.0 (opaque)


R = red; G = geen; B = blue

These 3 variables represent how much of each of their corresponding colors is contributed to the resulting color as a whole (ranging from 0 to 255).


So: an #ARGB value of 0 0 255 0 is an opaque green.


Cool Fact #1: There are also other ways to represent color like HSL (hue, saturation, lightness), and using hexadecimals (# RRGGBB use hexadecimal numbers 00 - ff instead of integers 0 - 255). But I'm going to stick with just ARGB for now.

Using jit.findbounds to track a colour:

Some new [objects] and terms I played with and learned today:

  • [jit.findbounds] - scans a grid within a specified range (min and max) of ARGB values and outputs the x, y points of its boundaries containing the searched values! VERY useful for color tracking.

The jit.findbounds #helpfile was exactly what was needed for my current task: defining the bounds in which a specific color was located, or simply - tracking my color! The built-in videos in Max weren't giving me nice colors to track so I downloaded a more colorful video to test my patch.


Problems:

Unfortunately, I'm having some issues having the suckah object spit out the color I am actually selecting with my cursor.

Tracking a dancing blue pencil crayon.

There's a lot going on here, but firstly, I wasn't intending to track the blue pencil crayon and clicked elsewhere with my cursor. However, the lower left window displayed that blue was being tracked. My ARGB values in my message box (val 0 79 166 252) also show that this color should be pretty blue. So that's strange...


Even without the suckah acting strangely, I still have a problem with my tracked box of color in the lower right window:

  1. Assuming I've purposefully selected the blue pencil crayon on the largest upper right video window

  2. the bottom left video window displays my tracked colour as white

  3. the video window in the bottom right should only display a box that contains all of the blue colors but it's larger than I expected.

Several places that could've gone wrong:

  1. selection of color on suckah object

  2. threshold of values going into my bottom left tracking window

  3. max and min color ranges going into jit.findbounds object

  4. visual noise of some blue colors in other parts of the video detected and within the current display box

Hopefully I can solve these problems next time I work on CHIMIRA.

19 views0 comments

Recent Posts

See All

Comments


© 2019 by Andrea Wong

bottom of page