cv.jit saving presets/parameters zones?
I have used especially Pelletier’s patch uploaded where you draw in one of the windows to produce active zones for triggers etc in the webcam window.
I added a cellblock which works well.
I have set up a preset box and have tried to store the zone information but am having no luck – connecting to cv.jit.blobs and jit.matrix.zones
I also tried to open an image to use for zones but did not have luck there either. I am new so forgive if this is basic.
I would like to set up zones of activation for my webcam and be able to save these as presets or parameters(and /or load an image to use for zones)
I tried a parameter file also but did not have success there either.
Thanks for any advice on this.
----------begin_max5_patcher---------- 3390.3oc2cs0iiaaE94Y+UPXr.8RbLDot2GJ1z.TTDzBDflWZyFLfVhisxJI 5JQOyNIH+2KIORislwxijMEWMA6tdFQIQeNe7vyMdH2e8c2rXM+yr5En+B5G Q2byu9tatQ2jpgaZt9lEEzOmjSq0O1hBVcMcCawR3dB1mE51wssTtuHqLmIz ONoow63kh5regoZKdkSSq6nhjsYkatshkH.hH12QdajeTn5GtjU9KQX+UNne 5P2y2KZ6ebSqPShG2wftYwhmdgrTM8wW+yeMlr3H5ojVne5EeSUFMeg5F+16 dm5ikWIVTK3ULjoPDWWMhDRzHRj5SigHglEP1UwpYhSx23ywgZVK.Gq4MGsD fmSurnWerX6WOZQVo9Gca3T.feKwBO5soTAE5MzOcA.PI6AYu9BAhcUZB5Lv xwhCXx4jGv9ZXJHTKV35o9jzOX47RdN1rC5I7hB1A16.SqnczcU7BzOWrikK onLVE56Xzxu9eQqRFLdb1oGXWPSAViCf1Cb3XfChcfi+ImlhJn6.DghtKKmY FHH1Qy79fhBL9Bv.LAaGUiYE63UhB98Yrkn0zxMFRIIn6v2WKLD4aTkjXhic DQ9aOhRqnOHYMDuDI1lUi1IuJk+vRzi78nDZIJohQELo7yuvKYJ4oUnukmy2 WUinRiNzzTVJ5NdEJMqdWN8QYOk+3RYmIuWhXOMGsK6yrbz8z78L3cdXKUn6 eIMwpjudVo94+3B82gD5VKm2tiVIYb4C7wEqP+mFpglWyaIIM81RUn80J1P9 HYER4.DKMSnaX2t7rDpHiWtpk+yyJYI78khiU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RcyayPVJjImjBmcTzPF2BirJIEiG.MEaYQImAPSQtiinh IQJSh9v+k+DA08Y2qBfpkJLNV8j5qtVVAODVQehFaS.9Yee8Ln2IilSufn2f PpQNpGFpFJcgC2Mu.33XpyUvN2yKVKcnt3pAW2gH8FZ4QbxPGwsGQEQFzHNw pDk6Tn64ZAJ2YncigLcMxtBTwCYr6YF7l7wtAop0t9pEELjwNKaSZH9gDYWc AQCwesnfwYlLFqsHAmSYXYD5sWcsDq2PIVKBfccgnGZxt9f6NjvBh5SIAdZv I70nfeZnom800SPlibrq00ZXGr5Ao.t6UpzhqcHC7by45mY34bMgKOMnKNd9 EBOgLTZBaMbhL3TcPrFM45O.sZXaGR2.voQ5MFASVE2liTbvJu.WhW7RULUu r4qUCn4IebPW5zONzy0+EjOz7UR9AS.4S5h9NXeb3KIen4qU5w7j+0pydHgF ZWO4GRPXWCEIu32d2+GvT3iQF -----------end_max5_patcher-----------
you’ll need to use some sort of intermediate storage for the zones, even just number boxes. cellblock won’t work with preset as it’s way too complex of an object. plenty of other options, just get your values and scale as needed, store in number boxes, use preset on those to re-populate them back in. avoid stack overflows, you’ll probably need a "set $1" on each to do things, depending on how you set it up.
pattr will also work for these, but preset is quicker to set up. if you don’t need interpolation between stored slots, use preset.
come to think of it, if your values are already as matrices (which sounds like you’re putting them into jit.cellblock), you can store them in jit.matrixset too. tons easier especially if you have a lot of values to store.
thanks very much for your suggestions.
Somehow I had not thought of storing the zones
as matrices. I will look into the jit.matrixset
and other suggestions as well.
I appreciate it!
I got it working after some tweaking.The subpatches were throwing me. I have the matrixset now getting fed from the [p draw zones] which has turned the image into a 1 plane matrix gray from what I gather. I feed the matrixset back into the [jit.matrix zones] , bang it and it loads beautifully. Thanks very much.
I wish there were a way to just store and load the matrices without the file dialogue box routine. I’m thinking the best option there would be to make separate patches with different zones loaded already if I can swing that.
Do you think that would be best? I’m looking at something for possible live performance.
Thanks again for your assistance. I was happy to get it reading and writing the zones!
great to hear you got it working! the matrixset is well-suited for this.
If you want "sets of sets of matrices" :) then a different saved matrixset for each would be good. Though you can make them huge if you want, so you could access indices 0-99, 100-199, etc., all in one big one.
I personally wouldn’t use separate patches unless you want them running simultaneously, or if you want ones with different controls. To avoid the dialog box routine you should just be able to give the "read" and "write" messages the filename as the argument, no need for .matrixset extension. So while developing, save your banks, then you can loadbang them in with "read my_set_5" if there’s "my_set_5.matrixset" in the patch folder.
For more trickiness with saving and loading, like consecutive filenames, [sprintf] is your friend, as it could replace the "5" in the example above with a generated number.
Great ideas. I had used the readfile object in PD with a soundfile but had not thought of it with the matrixset. Very cool idea.
This is great as I think just a couple matrixset files would be nice to have for variety of response. I plan to have movement in the zones trigger sound work first and perhaps try to map a room with the webcam. I also want to tie in a midi foot pedal to trigger the load matrix sequences for a potential live event. We’ll see how it goes!
Thanks again for your very helpful comments and suggestions !
very cool, hope it works out! the MIDI foot pedal should be simple to use with [ctlin]. maybe it could cycle through the matrixset indices, etc…
For a recent project which needed quick reading of image files from a folder, jit.qt.movie was creating short but noticeable pauses in the overall action when changing to the next file. jit.matrixset makes switching virtually instantaneous, which was great to see (and is the reason it exists it seems :)
Forums > Jitter