Forums > Jitter

cv.jit.HSflow

January 12, 2007 | 10:41 am

Hi,
this is maybe a stupid question, but does anyone know how to get some values out of cv.jit.HSflow? I mean to get values of the different colors/movement?

Thanks


January 12, 2007 | 5:53 pm

On Jan 12, 2007, at 11:41 AM, Tomi Dufva wrote:

>
> Hi,
> this is maybe a stupid question, but does anyone know how to get
> some values out of cv.jit.HSflow? I mean to get values of the
> different colors/movement?

Here’s one example that shows what cv.jit.hsflow does for each pixel:

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 34 37 48 196617 loadbang;
#P window setfont "Sans Serif" 14.;
#P user ubumenu 120 342 58 196622 0 0 1 1;
#X setrgb 0 0 0 255 192 25 234 234 234 222 225 223 141 141 141 112
112 112;
#X add up;
#X add down;
#X prefix_set 0 0 0;
#X pattrmode 1;
#P window setfont "Sans Serif" 9.;
#P newex 120 317 27 196617 > 0.;
#P window setfont "Sans Serif" 14.;
#P user ubumenu 48 343 58 196622 0 0 1 1;
#X setrgb 0 0 0 255 192 25 234 234 234 222 225 223 141 141 141 112
112 112;
#X add left;
#X add right;
#X prefix_set 0 0
0;
#P window setfont "Sans Serif" 9.;
#P newex 48 318 27 196617 > 0.;
#P newex 48 292 82 196617 unpack 0. 0.;
#P user jit.pwindow 122 171 82 62 1 1 0 0 1 0;
#P newex 34 242 53 196617 jit.3m;
#P newex 34 200 70 196617 cv.jit.HSflow;
#P newex 34 172 66 196617 jit.rgb2luma;
#P flonum 109 79 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 109 99 42 196617 rate $1;
#P message 169 87 86 196617 read redball.mov;
#P flonum 68 79 35 9 0.5 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 34 79 15 0;
#P newex 34 99 57 196617 qmetro 10;
#P newex 34 136 141 196617 jit.qt.movie 80 60 @unique 1;
#B color 5;
#P comment 59 271 191 196617 mean Horizontal and mean Vertical flow;
#P window linecount 4;
#P user com 190 298 129 196617 40;
#K set 0 29800 25970 25888 29544 28533 27748 8290 25888 28526 25888
28015 29285 8291 24947 25914 8253 15664 11808 26982 8308 26725 29285
8297 29472 28271 8296 28530 27002 28526 29793 27695 30309 29300 26979
24940 8301 28534 25965 25966 29696;
#K end;
#P user panel 39 264 288 112;
#X brgb 105 159 105;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P connect 17 0 18 0;
#P connect 9 0 8 0;
#P connect 6 0 4 1;
#P connect 5 0 4 0;
#P fasten 4 0 3 0 39 129 39 129;
#P fasten 7 0 3 0 174 126 39 126;
#P fasten 8 0 3 0 114 126 39 126;
#P connect 10 0 11 0;
#P connect 11 0 12 0;
#P connect 12 1 14 0;
#P fasten 3 0 13 0 39 160 128 160;
#P connect 3 0 10 0;
#P connect 14 0 15 0;
#P connect 15 0 16 0;
#P connect 14 1 17 0;
#P fasten 19 0 7 0 39 66 174 66;
#P connect 19 0 5 0;
#P window clipboard copycount 20;

best,
nesa


January 15, 2007 | 10:56 am

^Thanks a lot!

Very nice!
Would you/anyone now if there could be more values with it, not just 1/0 ? It would be great.
Thanks!


January 15, 2007 | 3:39 pm

> ^Thanks a lot!

You’re welcome, but bear in mind that this example shows what
cv.jit.hsflow does for _each_ pixel, meaning that there are actually
4800 (80×60) such results coming out of the object. The values
comming out are not restricted to 1/0, that’s what I mapped them to
for the sake of simplicity.

> Would you/anyone now if there could be more values with it, not
> just 1/0 ? It would be great.

sure, here you go:

#P user multiSlider 215 355 13 56 -0.209 0.224 1 2937 15 0 0 2 0 33 0;
#M frgb 206 206 206;
#M brgb 107 107 107;
#M rgb2 127 127 127;
#M rgb3 222 225 223;
#M rgb4 37 52 91;
#M rgb5 74 105 182;
#M rgb6 112 158 18;
#M rgb7 149 211 110;
#M rgb8 187 9 201;
#M rgb9 224 62 37;
#M rgb10 7 114 128;
#P user multiSlider 48 401 157 10 -0.1872 0.319 1 2936 15 0 0 2 0 33 0;
#M frgb 107 107 107;
#M brgb 206 206 206;
#M rgb2 127 127 127;
#M rgb3 222 225 223;
#M rgb4 37 52 91;
#M rgb5 74 105 182;
#M rgb6 112 158 18;
#M rgb7 149 211 110;
#M rgb8 187 9 201;
#M rgb9 224 62 37;
#M rgb10 7 114 128;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#N vpatcher 10 59 610 459;
#P window setfont "Sans Serif" 9.;
#P newex 50 83 55 196617 slide 2. 2.;
#P newex 50 113 27 196617 i;
#P newex 50 50 122 196617 zmap -0.209 0.224 0 10;
#P inlet 50 30 15 0;
#P outlet 50 135 15 0;
#P connect 1 0 2 0;
#P connect 2 0 4 0;
#P connect 4 0 3 0;
#P connect 3 0 0 0;
#P pop 1;
#P newobj 229 367 36 196617 p map;
#N vpatcher 10 59 610 459;
#P window setfont "Sans Serif" 9.;
#P newex 50 78 55 196617 slide 2. 2.;
#P newex 50 102 27 196617 i;
#P newex 50 50 128 196617 zmap -0.1872 0.319 0 10;
#P inlet 50 30 15 0;
#P outlet 50 124 15 0;
#P connect 1 0 2 0;
#P connect 2 0 4 0;
#P connect 4 0 3 0;
#P connect 3 0 0 0;
#P pop;
#P newobj 48 352 36 196617 p map;
#P newex 34 240 108 196617 jit.op @op * @val 10.;
#P newex 34 37 48 196617 loadbang;
#P window setfont "Sans Serif" 14.;
#P user ubumenu 229 389 157 196622 0 0 1 1;
#X setrgb 0 0 0 255 192 25 234 234 234 222 225 223 141 141 141 112
112 112;
#X add allmighty;
#X add flying;
#X add catapulted;
#X add jumping;
#X add on its toes;
#X add on its knees;
#X add head to the ground;
#X add falling into well;
#X add into abyss;
#X add fallen;
#X prefix_set 0 0 0;
#X pattrmode 1;
#P user ubumenu 48 378 157 196622 0 0 1 1;
#X setrgb 0 0 0 255 192 25 234 234 234 222 225 223 141 141 141 112
112 112;
#X add kommunist;
#X add a lot to the left;
#X add left;
#X add a bit left;
#X add hardly left;
#X add hardly right;
#X add a bit right;
#X add right;
#X add a lot to the right;
#X add nazi;
#X prefix_set 0 0
0;
#P window setfont "Sans Serif" 9.;
#P newex 48 327 191 196617 unpack 0. 0.;
#P user jit.pwindow 122 171 82 62 1 1 0 0 1 0;
#P newex 34 265 53 196617 jit.3m;
#P newex 34 200 70 196617 cv.jit.HSflow;
#P newex 34 172 66 196617 jit.rgb2luma;
#P flonum 109 79 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 109 99 42 196617 rate $1;
#P message 169 87 86 196617 read redball.mov;
#P flonum 68 79 35 9 0.5 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 34 79 15 0;
#P newex 34 99 57 196617 qmetro 10;
#P newex 34 136 141 196617 jit.qt.movie 80 60 @unique 1;
#B color 5;
#P comment 59 306 191 196617 mean Horizontal and mean Vertical flow;
#P window linecount 4;
#P user com 327 308 129 196617 40;
#K set 0 29800 25970 25888 29544 28533 27748 8290 25888 28526 25888
28015 29285 8291 24947 25914 8253 15664 11808 26982 8308 26725 29285
8297 29472 28271 8296 28530 27002 28526 29793 27695 30309 29300 26979
24940 8301 28534 25965 25966 29696;
#K end;
#P user panel 39 299 429 119;
#X brgb 105 159 105;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P fasten 14 1 22 0 234 349 220 349;
#P connect 14 1 20 0;
#P connect 14 0 19 0;
#P fasten 14 0 21 0 53 349 43 349 43 395 46 398;
#P connect 20 0 16 0;
#P connect 19 0 15 0;
#P connect 18 0 12 0;
#P connect 11 0 18 0;
#P connect 17 0 5 0;
#P fasten 17 0 7 0 39 66 174 66;
#P connect 3 0 10 0;
#P fasten 3 0 13 0 39 160 128 160;
#P connect 12 1 14 0;
#P connect 10 0 11 0;
#P fasten 8 0 3 0 114 126 39 126;
#P fasten 7 0 3 0 174 126 39 126;
#P fasten 4 0 3 0 39 129 39 129;
#P connect 5 0 4 0;
#P connect 6 0 4 1;
#P connect 9 0 8 0;
#P window clipboard copycount 23;


Viewing 4 posts - 1 through 4 (of 4 total)