PDA

View Full Version : Pixel based colour filter


soralf
6th June 2007, 15:44
Hello everybody.

Although I am a total newbie to AviSynth, I am looking for some (I think) advanced filter. I hope you can help me, however, I want to stress that I am new in this field and I do not understand advanced stuff without explanation, yet. So thanks for your understanding.

Here is my problem:
I want to search in each frame of a video clip pixels that have a red value above a certain threshold and, then, increase this red value for the output. Thus, I want to modify red pixels and make them more red.

Is this possible? Does such a filter exist? Personally, I think about a first filter creating an output where only those (defined) red pixels can be seen and a second filter that enhances the respective red information and creates the final output stream.

Can anyone help me on that topic?

THANKS A LOT!

Fizick
6th June 2007, 17:24
try look to masktools plugin.

neuron2
6th June 2007, 18:12
My HSV filter for VirtualDub will allow you to selectively boost the reds. If it isn't quite what you need, the source code is available and may help you to develop what you need.

http://neuron2.net/hue.html

BBugsBunny
6th June 2007, 18:29
You can do exactly that with my gradation curves filter for VirtualDub:
http://members.chello.at/nagiller/vdub/index.html
There is an avisynth filter, I think gicocu, that can read the curve files and process the video that way.
You could first edit the curve with the gradation curves filter in VirtualDub to meet your exact needs and then export the curve. The exported curve can be used afterwards in gicocu or you could do the filtering directly in VirtualDub.

In the curve edit window one axis is the input value, the other axis is the output value. This way you can define eg. on an red (input) value of 190 the red (output) value should be 213 and so on. My filter accepts different input formats (Adobe, CorelDraw curve files or a simple text file that can be created eg in Excel or Notpad) in the case that you don't want to use the filter's native curve edit window.
The newest beta version supports besides RGB some other color spaces (YUV,CMYK,HSV).

Wilbert
6th June 2007, 23:04
1) An AviSynth port of neuron2's hue filter: http://forum.doom9.org/showthread.php?p=588033#post588033

2) Get the latest v2.5.8 alpha and use Tweak: http://avisynth.org/mediawiki/Tweak Adjust the saturation while selecting the hue range which corresponds to red.

soralf
7th June 2007, 08:58
To all of you: thank you very much.
Since I have started to use AviSynth, I will follow Wilbert's suggestion and try Tweak (which already shows desired results).

Thanks.

G_M_C
7th June 2007, 10:04
[...] while selecting the hue range which corresponds to red [...]

I was meaning to ask about that; Is there a page,or tool that can help me visualize the hue-range and the "degree-value" ? I cant visualize what it works out to be atm ...

Wilbert
7th June 2007, 12:14
I was meaning to ask about that; Is there a page,or tool that can help me visualize the hue-range and the "degree-value" ? I cant visualize what it works out to be atm ...
Histogram(mode="color2")

Please read the corresponding documentation on http://avisynth.org/mediawiki/Histogram for the interpretation of the vectorscope.

G_M_C
7th June 2007, 15:21
Histogram(mode="color2")

Please read the corresponding documentation on http://avisynth.org/mediawiki/Histogram for the interpretation of the vectorscope.

:thanks:

Thx, a visualisation works better for me when i try to understand stuff like this :)