Reading brightness value from a specific point

Apr 8, 2008 at 4:12pm

Reading brightness value from a specific point

Hello.

I just started to learn jitter, and I have a couple of questions.

I want to read brightness value from a specific point and control the brightness of other clips with this value. Is it possible? Actually, I want two points from a clip and control two other clips.

And one more thing is that I want to capture 720 480 anamorphic DV and do something with jitter and project it in 720 480 anamorphic.
I changed aspect ratio in compression settings in jit.qt.grab, but I don’t know how to change the jit.pwindow or jit.window.

I hope someone would help me. Thank you :)

eejin

#36797
Apr 8, 2008 at 5:28pm

> I want to read brightness value from a specific point and control the brightness of other clips with this value. Is it possible? Actually, I want two points from a clip and control two other clips.

do you want the relative brightness of a clip at a particular point in time, or the brightness of one pixel of a clip?

if it’s the former, take a look at the second output of jit.3m, as well jit.histogram.
if it’s the latter, the getcell message to jit.matrix should do the trick.

to control brightness, look at jit.brcosa or jit.scalebias. if you’re feeling randy, might be time to take a look at slab processing. make sure you’ve done all the tutorials first.

> And one more thing is that I want to capture 720 480 anamorphic DV and do something with jitter and project it in 720 480 anamorphic.
> I changed aspect ratio in compression settings in jit.qt.grab, but I don’t know how to change the jit.pwindow or jit.window.

to size a jit.window either provide the width and height as arguments after the name argument, or send it the size message. jit.pwindow requires a right-click, get-info to set the size. all of this is covered in the respective help files.

-rob

#126472
Apr 9, 2008 at 4:42am

Thank you for your help.
I meant a particular pixel on a clip.
I’ll try the way you suggested.

As for the second question, I know how to size a jit.window, but the problem is that I can’t change the aspect ratio. This makes my image look stretched vertically. because I’m using 16:9 DV camera. Anybody can help me?

#126473
Apr 9, 2008 at 9:05pm

just size the movie, grab or window object to the correct aspect
ratio by writing in the correct dimensions… etc

max v2;
#N vpatcher 232 79 832 479;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 82 221 181 196617 jit.window blah @rect 50 50 370 230;
#P newex 78 180 129 196617 jit.matrix 4 char 320 180;
#P newex 78 143 105 196617 jit.qt.movie 320 180;
#P newex 77 98 98 196617 jit.qt.grab 320 180;
#P pop;

On Apr 9, 2008, at 12:42 AM, Lee-jin Kim wrote:

>
> Thank you for your help.
> I meant a particular pixel on a clip.
> I’ll try the way you suggested.
>
> As for the second question, I know how to size a jit.window, but
> the problem is that I can’t change the aspect ratio. This makes my
> image look stretched vertically. because I’m using 16:9 DV camera.
> Anybody can help me?
>
>

#126474
Apr 11, 2008 at 5:58am

Thanks for your help.
I made 16:9 window. But still what confuse me is when I make the jit. window to fullscreen, it just change the shape to fill the entire screen no matter what the size of the jit. window is.

Actually, my notebook has 16:9 monitor, so now Even though my jit.window is 4:3, it displays the image 16:9 when it goes to fullscreen. But as I’m planing to display the final though a projector, I’m worried what it would look like.

I’ll use the projector as the second monitor. So the patch on the notebook monitor and the output image on the projector screen…

Please give me any advice. And I’m sorry I didn’t test it with a projector yet.

#126475
Apr 11, 2008 at 6:45am

Hello there,

I managed to read the alpha and RGB values from a particular point on a clip. But I’m yet confused how to apply these to control other clips

I understand that jit brcosa controls brightness, but what calculation with 4 values would do the best results cause jit.brcosa require one value?

As I’m writing this question, I’m realizing what I want to do is realtime color correction, not only the brightness control.
Is it too much or too heavy?

here, I have my patch.

If I could add the remainder which I take A from B back to the values of the whole pixels on the clip A. I guess it would do.
Is there an object like that? jit. scalebias does this? I read the help menu but I got a vague understanding of it

#P button 343 66 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P message 475 101 29 196617 stop;
#P message 435 104 33 196617 start;
#P newex 336 102 52 196617 metro 50;
#P button 520 110 15 0;
#P user jit.pwindow 342 196 82 62 0 1 0 0 1 0;
#P message 397 107 30 196617 read;
#P newex 347 142 105 196617 jit.qt.movie 320 240;
#P newex 548 232 57 196617 print right;
#P message 475 138 76 196617 getcell 109 35;
#P newex 447 183 129 196617 jit.matrix 4 char 320 240;
#P button 24 66 15 0;
#P message 156 101 29 196617 stop;
#P message 116 104 33 196617 start;
#P newex 17 102 52 196617 metro 50;
#P button 201 110 15 0;
#P user jit.pwindow 23 196 82 62 0 1 0 0 1 0;
#P message 78 107 30 196617 read;
#P newex 28 142 105 196617 jit.qt.movie 320 240;
#P newex 229 232 57 196617 print right;
#P message 156 138 76 196617 getcell 109 35;
#P newex 128 183 129 196617 jit.matrix 4 char 320 240;
#P connect 11 1 13 0;
#P connect 17 0 12 0;
#P connect 12 0 11 0;
#P connect 14 0 16 0;
#P connect 14 0 11 0;
#P connect 20 0 14 0;
#P connect 19 0 14 0;
#P connect 15 0 14 0;
#P connect 18 0 14 0;
#P connect 21 0 18 0;
#P connect 0 1 2 0;
#P connect 6 0 1 0;
#P connect 1 0 0 0;
#P connect 3 0 5 0;
#P connect 3 0 0 0;
#P connect 7 0 3 0;
#P connect 4 0 3 0;
#P connect 8 0 3 0;
#P connect 9 0 3 0;
#P connect 10 0 7 0;
#P window clipboard copycount 22;

#126476
Apr 11, 2008 at 5:37pm

Quote: eejin wrote on Thu, 10 April 2008 23:58
—————————————————-
> Thanks for your help.
> I made 16:9 window. But still what confuse me is when I make the jit. window to fullscreen, it just change the shape to fill the entire screen no matter what the size of the jit. window is.
>
> Actually, my notebook has 16:9 monitor, so now Even though my jit.window is 4:3, it displays the image 16:9 when it goes to fullscreen. But as I’m planing to display the final though a projector, I’m worried what it would look like.

you have to scale the vidoeplane based on your aspect ratio. then just set the erase_color of the gl.render to black, which will give you the black bars at the top and bottom.
a potentially easier method is to export your movies in the aspect ratio of the projector, but pre-matted at 16:9.

#126477
Apr 11, 2008 at 5:42pm

Quote: eejin wrote on Fri, 11 April 2008 00:45
—————————————————-
> I managed to read the alpha and RGB values from a particular point on a clip. But I’m yet confused how to apply these to control other clips
>
> I understand that jit brcosa controls brightness, but what calculation with 4 values would do the best results cause jit.brcosa require one value?

totally depends on what you want to do. adding the values or averaging them are possibilities of how to turn 4 values into 1.

> As I’m writing this question, I’m realizing what I want to do is realtime color correction, not only the brightness control.
> Is it too much or too heavy?

not too heavy for the computer, but pretty heavy for a beginner. your best bet is to find vade’s v001 shader pack, as that is one the best possible ways to do realtime color correction with jitter.

#126478
Apr 14, 2008 at 9:30am

Thank you for your help.
But I don’t understand many things. I’m sorry I’m such a beginner.
As for the 16:9 issue, I better use gl.render, because I’m using live camera, and I can’t prematte the source.

What do you mean by “scale videoplane” Do you mean sizing the jit.window. I made the jit.window like

jit.window eejin @size 720 405

720 405 is 16:9

And what is “set the erase_color of the gl.render to blacks”?
I made jit.gl.render, but I don’t know even where to put this? before jit.window or after it?
and I don’t know how to set the attribute. Is it like

jit.gl.render @erase_color black????

Could please explain more step by step, please?

In addition, what is vade’s v001 shader pack?
Does this work like a plug in in other programs like after effect ? Where can I find it?

#126479
Apr 14, 2008 at 12:55pm

Hello, rob
Could you reply to one more question?
When you use “getcell”, you input “getcell X Y” to jit.matix,
and then if you print from the right outlet of the matrix, you can see the info like “cell 0 0 val 255 31 190 33″

And from that point, how can you put the last 4 list(alpha, R,G,B) into the number box, so you can start to do some calculation?

I’m reading tutorials by my self, but it’s pretty hard for me.

Thank you in advance.

eejin

#126480
Apr 14, 2008 at 5:46pm

i’ll do my best to answer your questions, but you really need to do the tutorials (at least the ones specific to what you’re trying to achieve), study the help files, and study the html reference files.

> What do you mean by “scale videoplane” Do you mean sizing the jit.window. I made the jit.window like

16/9 = 1.77
jit.gl.videoplane @scale 1.77 1. 1.
you can then use the z position value to move zoom it in and out, or play with the transform_reset attribute.

> And what is “set the erase_color of the gl.render to blacks”?
> I made jit.gl.render, but I don’t know even where to put this? before jit.window or after it?
> and I don’t know how to set the attribute. Is it like

jit.gl.render @erase_color 0. 0. 0. 1.

> In addition, what is vade’s v001 shader pack?
> Does this work like a plug in in other programs like after effect ? Where can I find it?

http://001.vade.info/?page_id=20
but i wouldn’t recommend looking at those until you understand the basics.

> When you use “getcell”, you input “getcell X Y” to jit.matix,
> and then if you print from the right outlet of the matrix, you can see the info like “cell 0 0 val 255 31 190 33″
> And from that point, how can you put the last 4 list(alpha, R,G,B) into the number box, so you can start to do some calculation?

however you want. add them up and scale the value to whatever it needs to be, is one possible easy method.
3*255=765 (ignoring the alpha value here)
so send the summed output to [scale 0 765 0. 1.] to scale it from 0. to 1. a very crude measure of brightness.

#126481
Apr 15, 2008 at 11:54am

Thank you, rob
Of course I’ll read the tutorials later, but for now I have a show coming and I don’t have much time to read one by one.
Actually, I’m trying to find what chapters I should look at, and to read those chapters first, but I can’t even figure out what those are yet.

I have several problems unsolved. Maybe I’ll give up couple of things. However I really need to achieve 16:9 image.

So, could you please take a look at my patch and let me know where I should put the jit.gl.videoplane and jit.gl.render?

Thank you so much in advance. :) Maybe I’m asking you too much.

#P user jit.pwindow 435 559 74 50 0 1 0 0 1 0;
#P user jit.pwindow 793 247 74 50 0 1 0 0 1 0;
#P user jit.pwindow 175 238 74 50 0 1 0 0 1 0;
#P user jit.pwindow 462 239 74 50 0 1 0 0 1 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 2;
#P message 859 620 80 196617 ; max hidecursor;
#P message 756 619 85 196617 ; max showcursor;
#P window setfont “Fixedwidth Serif” 10.;
#P window linecount 1;
#P newex 755 561 212 1441802 sel 0 1;
#P window linecount 2;
#P message 756 587 98 1441802 ; max showmenubar;
#P message 857 587 98 1441802 ; max hidemenubar;
#P window linecount 1;
#P message 643 626 83 1441802 fullscreen $1;
#P toggle 649 599 15 0;
#P newex 649 577 62 1441802 select 32;
#P newex 649 556 40 1441802 key;
#P window setfont “Sans Serif” 9.;
#P newex 410 623 162 196617 jit.window tricom @size 720 480;
#B color 5;
#P comment 758 94 100 196617 movie 2;
#P message 824 144 27 196617 stop;
#P message 787 145 31 196617 start;
#P toggle 733 93 15 0;
#P window setfont “Fixedwidth Serif” 10.;
#P newex 733 115 53 1441802 metro 50;
#P newex 733 174 130 1441802 jit.qt.movie 720 480;
#P message 746 145 34 1441802 read;
#P window setfont “Sans Serif” 9.;
#P message 232 148 27 196617 stop;
#P message 198 148 31 196617 start;
#P window setfont “Fixedwidth Serif” 10.;
#P newex 402 352 222 1441802 jit.scissors @rows 1 @columns 16;
#B color 5;
#P window setfont “Sans Serif” 9.;
#P newex 419 165 195 196617 jit.qt.grab 720 480 @vmode 2 @unique 1;
#P message 538 136 44 196617 settings;
#P comment 448 113 105 196617 live camera;
#P message 503 135 31 196617 close;
#P message 472 135 28 196617 open;
#P toggle 419 111 15 0;
#P newex 419 135 52 196617 metro 50;
#P window setfont “Fixedwidth Serif” 10.;
#P newex 711 352 222 1441802 jit.scissors @rows 1 @columns 16;
#B color 5;
#P newex 108 356 222 1441802 jit.scissors @rows 1 @columns 16;
#B color 5;
#P newex 378 518 209 1441802 jit.glue @rows 1 @columns 16;
#B color 5;
#P toggle 144 96 15 0;
#P newex 144 118 53 1441802 metro 50;
#P newex 144 177 130 1441802 jit.qt.movie 720 480;
#P message 157 148 34 1441802 read;
#P window setfont “Sans Serif” 9.;
#P comment 172 97 100 196617 movie 1;
#P connect 32 1 34 0;
#P connect 32 1 30 0;
#P connect 19 0 7 0;
#P connect 19 0 37 0;
#P connect 32 0 33 0;
#P connect 32 0 31 0;
#P fasten 28 0 29 0 654 617 645 617 645 595 648 595;
#P fasten 28 0 32 0 654 617 752 617 752 563 760 563;
#P fasten 22 0 19 0 792 168 738 168;
#P fasten 18 0 19 0 751 170 738 170;
#P connect 20 0 19 0;
#P fasten 23 0 19 0 829 168 738 168;
#P connect 21 0 20 0;
#P connect 27 0 28 0;
#P connect 26 0 27 0;
#P connect 7 15 5 15;
#P connect 7 14 5 14;
#P connect 7 13 5 13;
#P connect 15 12 5 12;
#P connect 15 11 5 11;
#P connect 15 10 5 10;
#P connect 15 9 5 9;
#P connect 15 8 5 8;
#P connect 15 7 5 7;
#P connect 14 0 15 0;
#P connect 14 0 35 0;
#P connect 15 6 5 6;
#P connect 6 5 5 5;
#P connect 5 0 25 0;
#P connect 5 0 38 0;
#P connect 6 4 5 4;
#P connect 8 0 14 0;
#P hidden connect 13 0 14 0;
#P fasten 10 0 14 0 477 157 424 157;
#P fasten 11 0 14 0 508 157 424 157;
#P connect 9 0 8 0;
#P connect 6 3 5 3;
#P connect 29 0 25 0;
#P connect 6 2 5 2;
#P connect 6 1 5 1;
#P connect 6 0 5 0;
#P connect 2 0 6 0;
#P connect 2 0 36 0;
#P connect 3 0 2 0;
#P fasten 1 0 2 0 162 173 149 173;
#P fasten 16 0 2 0 203 171 149 171;
#P fasten 17 0 2 0 237 170 149 170;
#P connect 4 0 3 0;
#P window clipboard copycount 39;

#126482
Apr 15, 2008 at 3:29pm

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P comment 26 496 288 196617 for a screen that’s not proper aspect ration , must use z value;
#P number 87 528 35 9 0 2 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 87 556 101 196617 transform_reset $1;
#P flonum 241 523 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 191 554 99 196617 pak position 0. 0. 0.;
#P newex 224 596 335 196617 jit.gl.videoplane tricom @dim 1 1 @scale 1.77 1 1 @position 0. 0. -0.78;
#P newex 94 55 52 196617 r thebang;
#P newex 74 403 52 196617 s thebang;
#P newex 45 425 211 196617 jit.gl.render tricom @erase_color 0. 0. 0. 1.;
#P user jit.fpsgui 99 364 60 196617 0;
#P newex 45 338 66 196617 t b b erase b;
#P toggle 45 287 15 0;
#P newex 45 313 57 196617 qmetro 20;
#P user jit.pwindow 447 477 74 50 0 1 0 0 1 0;
#P user jit.pwindow 805 165 74 50 0 1 0 0 1 0;
#P user jit.pwindow 187 156 74 50 0 1 0 0 1 0;
#P user jit.pwindow 474 157 74 50 0 1 0 0 1 0;
#P window linecount 2;
#P message 871 538 80 196617 ; max hidecursor;
#P message 768 537 85 196617 ; max showcursor;
#P window setfont “Fixedwidth Serif” 10.;
#P window linecount 1;
#P newex 767 479 212 1441802 sel 0 1;
#P window linecount 2;
#P message 768 505 98 1441802 ; max showmenubar;
#P message 869 505 98 1441802 ; max hidemenubar;
#P window linecount 1;
#P message 655 544 83 1441802 fullscreen $1;
#P toggle 661 517 15 0;
#P newex 661 495 62 1441802 select 32;
#P newex 661 474 40 1441802 key;
#P window setfont “Sans Serif” 9.;
#P newex 418 561 162 196617 jit.window tricom @size 720 480;
#B color 5;
#P message 836 62 27 196617 stop;
#P message 799 63 31 196617 start;
#P window setfont “Fixedwidth Serif” 10.;
#P newex 745 92 130 1441802 jit.qt.movie 720 480;
#P message 759 50 94 1441802 read dozer.mov;
#P window setfont “Sans Serif” 9.;
#P message 244 66 27 196617 stop;
#P message 210 66 31 196617 start;
#P window setfont “Fixedwidth Serif” 10.;
#P newex 414 270 222 1441802 jit.scissors @rows 1 @columns 16;
#B color 5;
#P window setfont “Sans Serif” 9.;
#P newex 431 83 195 196617 jit.qt.grab 720 480 @vmode 2 @unique 1;
#P message 550 54 44 196617 settings;
#P message 515 53 31 196617 close;
#P message 484 53 28 196617 open;
#P window setfont “Fixedwidth Serif” 10.;
#P newex 723 270 222 1441802 jit.scissors @rows 1 @columns 16;
#B color 5;
#P newex 120 274 222 1441802 jit.scissors @rows 1 @columns 16;
#B color 5;
#P newex 390 436 209 1441802 jit.glue @rows 1 @columns 16;
#B color 5;
#P newex 156 95 130 1441802 jit.qt.movie 720 480;
#P message 170 50 100 1441802 read dishes.mov;
#P window setfont “Sans Serif” 9.;
#P comment 26 475 282 196617 try a transform_reset of 1 OR adjusting the z position value;
#P connect 37 0 2 0;
#P connect 37 0 9 0;
#P connect 37 0 14 0;
#P connect 24 1 22 0;
#P connect 24 1 26 0;
#P connect 24 0 23 0;
#P connect 24 0 25 0;
#P fasten 20 0 21 0 666 535 657 535 657 513 660 513;
#P fasten 20 0 24 0 666 535 764 535 764 481 772 481;
#P connect 14 0 5 0;
#P connect 14 0 29 0;
#P connect 9 0 10 0;
#P connect 9 0 27 0;
#P connect 3 0 38 0;
#P connect 3 0 30 0;
#P connect 2 0 4 0;
#P connect 2 0 28 0;
#P connect 39 0 38 0;
#P connect 41 0 38 0;
#P connect 42 0 41 0;
#P connect 33 0 35 0;
#P connect 33 2 35 0;
#P connect 40 0 39 3;
#P connect 33 3 34 0;
#P connect 33 1 36 0;
#P connect 31 0 33 0;
#P connect 32 0 31 0;
#P fasten 12 0 2 0 249 88 161 88;
#P fasten 11 0 2 0 215 89 161 89;
#P fasten 1 0 2 0 175 91 161 91;
#P connect 4 0 3 0;
#P connect 4 1 3 1;
#P connect 4 2 3 2;
#P connect 21 0 17 0;
#P connect 4 3 3 3;
#P fasten 7 0 9 0 520 75 436 75;
#P fasten 6 0 9 0 489 75 436 75;
#P hidden connect 8 0 9 0;
#P connect 4 4 3 4;
#P connect 4 5 3 5;
#P connect 10 6 3 6;
#P connect 10 7 3 7;
#P connect 10 8 3 8;
#P connect 10 9 3 9;
#P connect 10 10 3 10;
#P connect 10 11 3 11;
#P connect 10 12 3 12;
#P connect 5 13 3 13;
#P connect 5 14 3 14;
#P connect 5 15 3 15;
#P connect 18 0 19 0;
#P connect 19 0 20 0;
#P fasten 16 0 14 0 841 86 750 86;
#P fasten 13 0 14 0 764 88 750 88;
#P fasten 15 0 14 0 804 86 750 86;
#P window clipboard copycount 44;

#126483
Apr 16, 2008 at 12:46pm

Thank you, rob

I really appreciate it. I’m so relieved now. I could check other things for my show.
I’ll keep in mind that your advice, I’ll read by my self later.
Thank you again.

eejin

#126484
Apr 26, 2008 at 5:08pm

How are you, rob

I came back asking your help.
I’m trying to make my patch able to record, the patch that you helped me with.
I attached jit.qt.record to the videoplane outlet. Is it wrong?
It asked me filename but, didn’t make even a file.

And I made message box like “write name 29.97 dvntsc lossless”
Is it ok? I’m using qmetro 20.

I’m looking forward your reply.

eejin

#126485
Apr 26, 2008 at 7:07pm

> I attached jit.qt.record to the videoplane outlet. Is it wrong?

yes.

look at examples/jitter-examples/render/jit.gl.render-tomatrix.pat

also check out the iShowU app for better performance.

and make sure you search the forum. there are several posts in the last year addressing this.

#126486
May 2, 2008 at 4:24pm

How are you, rob

I opened my show a couple of days ago. It doesn’t seem very successful but it’s still meaningful experience for me.
I thank you very much for your help.
I plan to study max/msp/jitter during this summer, realizing this is very useful. So I’ll come back here soon.

Thanks again.

eejin

#126487

You must be logged in to reply to this topic.