Dr. Hamel and I explored the possibilities of tracking multiple instances of the same colour today.
Right now, we have the centre location of every color detected (this would be one large rectangle if there were multiple instances of the same colour present). To approach this, we delved into #computer_vision for #jitter!
cv.jit. was developed by Jean-Marc Pelletier for computer vision application in max/msp/jitter. The object we dealt with most was cv.jit.blobs.bounds. If every instance of the same colour is treated as it's own independent #blob.
Some new [objects] and terms I played with and learned today:
[cv.jit.blobs.bounds] - finds the bounds for each blob/individual components!
But how to get the location of each blob for my instrument?
It didn't seem like it'd be complicated but I didn't know the names of the objects required to extract this data. Luckily, Dr. Hamel came to the rescue!
So the matrix information coming out of cv.jit.blob.bounds is sent out to a blobAnalysis subpatch where the list of data is checked to see if 1. blobs are present and 2. if they are, pass the blob data onwards!
Some new [objects] and terms I played with and learned today:
[jit.iter] - outputs a list of data for each data cell in every plane
[zl] - processes a list! (Here we use both [zl.sum] to output a sum of numbers in a list and [zl.group n] to display the last n items in a list.
[change] - filters out repeated numbers
[join] - finds the bounds for each blob/individual components!
Now we can detect multiples of the same colour!
Next up: extracting the data to visually locate individual blobs.
Comments