Contrast, brightness, saturation

hi there !

I got a little problem, I’m trying to control contrast and brightness (and maybe also saturation) on a video stream coming from the VideoIn node but I didn’t manage to do it propoerly.

In fact I tried to do it with the VideoTexture Node (the one with additional options , It works, but not as was expected.

Here is a little schema of my patch :

VideoIN
|
|
|
ColorTracker
|
|
|
Contour
|
|
|
VideoTexture (and Renderer)

And so, I would like to add more contrast and brightness to the videostream from VideoIN before Colortracker work on it (to clean the tracking in fact) but (logically) when I modify contrast on videoTexture, It don’t change anything on the tracking ( because VideoTexture is at the end of the chain I think)

So I would like to know how I can modify videostream’s contrast and brightness before colortracking ? (Maybe with some shaders, but I’m not familiar with pixelshaders, so I don’t know where to look at)

So If anyone has an idea, it would be very nice to tell me about it ^^

The only way to do it I think is to prerender the video steam, and use a shader to adjust contrast etc, then use an asvideo from the dxtexture and put that into the colour tracker, unless you code in which case you do alter the code of the colour tracker freeframe!

ok thanks :)

I’ve tried it, but then there is another problem.
Now, when I modify contrast (or other inputs) on the videotexture node, it doesn’t change anything in the renderer, but when I link the videotexture to a Filestream node loading a video file from my hard disk (like in the exemple) it works °_°.

So videotexture don’t modify the videostream from my webcam (from the VideoIn node) but works on video file.
Weird.

Do you have an idea of what I should try or do ( or what I missed about that ?)

I don’t know what cam ur using - but if u use a usb webcam u should do the colorcorrection in the driver -> properties pin.

thanks for your help :)

in fact I’m using an UniBrain Fire-i Cam (little firewire cam) but I don’t use directly the Fire-i driver in the VideoIn node, I use Splitcam driver (because I have 3 VideoIn nodes in my patch, I’m tracking 3 different colors at the same time, so I got 3 “trees” like the one I drew in my first post).

The fact is that splitcam can’t control saturation and brightness (but can control a bit contrast , also weird) on the fire-i driver, and I can’t use directly the fire-i application to do that (because splitcam is using the fire-i driver at the same time).
So the only solution is to modify directly contrast, saturation and brightness in vvvv.

I’ve tried on the VideoIn node (there is some parameters in the inspektor for contrast, saturation… , but It didn’t modify anything too )

I’ve read in the forum that it’s possible with a freeframe video filter (I know the freeframe nodes like contour, colortracker, traunter, camshift tracker… but no one modify contrast or saturation) so I didn’t find out clearly what it was about, and also with some shader, but I’m not into pixelshaders yet (I’ve to study a bit )) ) so I don’t know where to look or if there is existing shaders which do that kind of effects.

So if anyone has an idea, my ears (or my eyes in that case) are wide opened ^^

Hi there !

I’ve found something very interesting, in the filegallery, the RGBcontrast fx, it does what I was looking for (So I’m very happy :) ), I’ve tried it and it works really good !

But I still have a problem (I’m sorry, I’m annoying, but I’m learning by mistakes, the best way ;) ), anyway the fact is that I got a hole in my chain now :

here it is :

VideoIn
|
|
VideoTexture
|
|
RGBcontrast_2 (ex9 output)
|
|
???
|
|
Colortracker (directshow input)
|

I know that AsVideo works good to link texture outputs to directshow inputs, but here I want to Link a EX9 outputs (from RGBcontrast or renderer) to a directShow input (the colortracker).

Is there a way to do that ?

i’m afraid you will have to prerender the shader output, just like catweasel meant:

RGBContrast >>>> Renderer (EX9) >>>> AsVideo >>>> ColorTracker

no asrenderer shehulded ? ;-P

thanks for the answer ^^

but I didn’t find any output pins on the renderer that I can link to the AsVideo node (The only renderer output pin is a EX9output, and AsVideo ask for Texture)

How can I convert EX9output to texture ?

edit : Ah ! I just found how to do it : with the DX9Texture Node ! Great :) (but my patch will become very fat, I hope my cpu will handle it correctly °_° )

yep diki thanks :)
|
|
V

whoops…
DX9Texture (EX9.Texture) it is.
(that’s what i get from pseudopatching in my head)

but there are a lot of freemframe plugins in the wild have a look here. I think it should be no problem to find a color correction freeframe plugin!

… I’m also thinking about buying the UniBrain Fire-i Cam, can you tell me more about speed, latency, picture quality …

Thanks for the link I’ll have look :)

About the unibrain fire-i cam, it’s really a good product (and in fact it’s the only cheap firewire cam available, so there I can’t compare it with other firewire cam) but it’s really better than usb cam :

  • First (and the most interesting part) you can put different kind of lenses on it (I bought it with a wild angle lens, very good to build “lightning-table”, like the reactable for exemple) And you can do focus manually (also very useful)

About quality, before, I was using a creative liveCam Optia (a very good usb webcam) and the unibrain is really better about latency (thanks to the firewire), about image, it’s not tremendous, but it’s quite better (less grain) but You can use unibrain in 640/480 at 15/20 fps (which is not possible with most of the webcam) and a good 30 fps in 320, but don’t expect to use it like a classic cam, image is not as good as an analog cam.

It’s a very good product if you want to use it in a video analysis purpose (for example color tracking, like I’m trying to do ^^ ) because the color sensor is very good (nothing to do with the poor color sensor put in webcams) an you can play easily with saturation, contrast and brightness (and other kind of color parameters) without getting grain.

If you have other question, ask :)

also note that the ColorTracker can track several colors at the same time. see its helppatch. you may not need 3 VideoIn-ColorTracker…“trees” at all.

Yes I know ^^

In fact after each colortracker I have a Contour node which detect shapes keyed by each colortracker (one for black, one for red and one for blue) and I’m sending information about red, blue and black shapes separatly to PureData. so in fact, I may not need 3 colortrackers, but I need 3 Contour nodes (one for each color)

that’s why I think I need to track separatly these colors. (I can be wrong, but I didn’t find another way to do that)