Archive: Water & Blur


14th November 2004 00:15 UTC

Water & Blur
I ever wanted to know, why you get this strange grey veil, when you combine trans/water with heavy blur. And why does this combination work with medium or light blur?


14th November 2004 04:06 UTC

Because the water filter is a 2D diamond-shaped convolution combined with a time-dependant subtraction which is simulating the surface of a very thin layer of water when you iterate it. Adding a heavy blur upsets the convolution because its mask is also diamond shaped, and alters the whole feedback loop.

Maybe that wasn't the answer you were looking for.

Dynamic systems are often unstable, messing around with trans/water gets you unstable stuff, which is sometimes ugly, sometimes pretty.


14th November 2004 10:22 UTC

Ah, i understand! So if you could convert the diamond-shaped convolution into 3D and make it a octohedron then perhaps the two convolutions sum up in the gaps of their grid so that you would have constructive interference, but only if you add a phase-shift about h/pi*2 (for h = Planck constant).

Joking apart, thanks for the explanation! I got the simple one and will think about the first part for the next days... ;)


14th November 2004 22:55 UTC

Well while were at it, what is the convo setting for water then? I think UnConeD was coughing at the other thread about that :rolleyes:


14th November 2004 23:37 UTC

dunno..
was playing with some diamond shapes in the trans/convolution filter but it only gave me this grey veil i talked about but nothing like water. So the convo settings that imitate a water-effect must be more difficult than just a diamond shape, (if its possible anyways).


15th November 2004 17:29 UTC

Originally posted by Tuggummi
Well while were at it, what is the convo setting for water then? I think UnConeD was coughing at the other thread about that :rolleyes:
There is no 'setting' for water in the convo filter, as coned just said if you had bothered to read his post "...combined with a time-dependant subtraction".

I sometimes wonder why the convo filter is called a convo filter because it doesnt actually convolve two signals in any domain... at least it doesnt appear to.

Most people just use it as a 'controlled blur' anyway

15th November 2004 17:55 UTC

Most people just use it as a 'controlled blur' anyway
Amen to convo glow! :D

15th November 2004 21:24 UTC

Would it be possible to make a "tweakable" water ape in any way? Sometimes it would be nice if you could set the direction the waves spread out, for example.


16th November 2004 15:47 UTC

I had the idea of making a propper convolution filter, that is a codable ape that you enter a 2D signal to be convolved with the framebuffer... but I think 99% of AVS'rs wouldnt know what to do with it. To most people it would just be a dynamic controlled blur :p


16th November 2004 18:20 UTC

Originally posted by PAK-9
but I think 99% of AVS'rs wouldnt know what to do with it.
including me ;)

But probably this isn't what i was looking for. I had a ape in mind which offers control about the "water" in the form of sliders. So that you are able to set the "amplitude of the waves", the directions they spread on the screen, the amount of color-splitting or something like that (like water-bumb does for example). Hope you get what i mean...

16th November 2004 20:09 UTC

To most people it would just be a dynamic controlled blur :p
Convo-glow that pulsates on beat!? OMG! I WANT THAT! :D

16th November 2004 23:19 UTC

Um. Convolution does convolve two signals: the 2D signal of the picture, and the 2D signal of the convolution mask.


17th November 2004 00:07 UTC

Could someone please explain what Convolution and/or to convolve/convolute means. (excuse me, i'm not a native speaker but i haven't found the words in any dictionary yet :( ). I'd like to know what a convolution effect actually does when it "convolves two signals". I've got a very vague idea about the meaning; it seems to be something like "twisting the data around", but im not sure :confused: ? All i know is, that it's not a simple addition or multiplication, like:

pointA + pointB = pointC
or:
Pa * Pb = Pc

I'd be grateful for any explanaition!


18th November 2004 12:32 UTC

A convulation function is the amount that two data sources overlap. Avs's convulation filter takes the values RGB (0..1) of the pixels surrounding each pixel on the screen, compares them to the values you put in the convo map, and replaces what is on the avs screen with the resulting convulation.

i think....


18th November 2004 17:50 UTC

Well it depends on the context a little... In this case I would say we have 2 2D signals which are convolved together to form an output (another 2D signal) where...

output[x,y]= (a=sum from 0 to width of ( b=sum from 0 to height of ( input1(a,b) times input2(x-a,y-b) ) ))

(I say it depends on the context because for example another use is determining the operation of a system from its impulse response... where y(n) is the system ,h(n) is the impulse response and x(n) is the output... (this is all discrete so n is the sample number)

y(n)= k=sum from -inf to inf of (x(k) times h(n-k))

or y(n)=x(n) convolved with h(n)
)


18th November 2004 19:14 UTC

:confused: Thanks for the explanations, its getting a bit clearer now. unfortunately i find your formula a bit confusing, PAK. It would have been easier to read if you had explained the variables seperately (not inside of the formula) but never mind..


18th November 2004 21:16 UTC

boggling at pak's reply


18th November 2004 22:35 UTC

yeah, i wonder where i can get this book.


19th November 2004 09:18 UTC

yea sorry but I can't type epsilon with limits so its a bit confusing


19th November 2004 21:07 UTC

What a convolution does:

Given two data signals (let's say u[k] and v[k] where k is an index 0,1,2,3,...).

The convolution of u[k] with v[k] = y[k] = sum(i=-inf..+inf,u[k]*v[i-k]). What this means is, you flip one of the two signals around (set k = -k), you overlap it with the other signal and a certain offset 'i'. Then you multiply the corresponding values, and sum the result. This gives you /one/ value of y[k].

You can see this visually if you convolve u[k] = [1 2 1] with v[k] = [3 2]:


u[k] = [0 1 2 1 0] (extra zeros for padding)
flipped v[k]:
v[0-k] = [2 3 0 0 0]
multiply corresponding elements:
* = [0 3 0 0 0]
sum = 3
=> y[0] = 3

u[k] = [0 1 2 1 0]
flipped v[k]:
v[1-k] = [0 2 3 0 0] (note difference with previous i)
multiply corresponding elements:
* = [0 2 6 0 0]
sum = 8
=> y[1] = 8

u[k] = [0 1 2 1 0]
flipped v[k]:
v[2-k] = [0 0 2 3 0]
multiply corresponding elements:
* = [0 0 4 3 0]
sum = 7
=> y[2] = 7

u[k] = [0 1 2 1 0]
flipped v[k]:
v[3-k] = [0 0 0 2 3]
multiply corresponding elements:
* = [0 0 0 2 0]
sum = 2
=> y[3] = 2


For other values of i, u[k] and v[i-k] do not overlap with non-zero values.

So the convolution of [1 2 1] and [3 2] is [3 8 7 2].

You can see a convolution as taking multiple copies of one signal and weighting it with the values of the other. For example, convolving with [0 1 0] has no effect, because only a single copy of the signal is used.
Convolving with [0 2 0] multiplies the signal by 2.

If you convolve by [0.5 0.5], then you effectively take a copy of the signal, shift it one position, and average it with the unshifted signal. This has the effect of blurring the signal, and removing sharp points and edges. In other words, this is a "low pass" filter. A convolution with [0.5 -0.5] enhances sharp points and edges and fades away slow variations. This is a "high pass" filter.

You can do convolutions in 2D, where the input can be seen as 2 images. A convolution with
[1 1]
[1 1], has the effect of blurring the image in both the x and y directions.

Convolutions are essentially linear time-invariant systems or filters. These are simplified elements used in the description of electronics, such as in audio equipment and synthesisers. Using frequency analysis and fourier/z transforms, you can find out exactly how a certain filter affects the frequency spectrum. Or in reverse, you can design a filter that has a specified result on the frequency spectrum. In electronics, the signals are voltages and are continuous, in computers, we use digital signals and the signal is discrete in time and quantization. This is digital signal processing.

This falls under system theory, signal processing and such, which you can learn about when you study engineering.

21st November 2004 13:23 UTC

:eek:

I really understood that! Thanks very much UnConeD!!! Your Explanations are great :up:

And sorry PAK, i should have know what you wrote; you meant this:
__
| '
>
|__, right?

(Sorry, but it seemed O.K in the preview, should be a capital Greek epsilon)


21st November 2004 14:19 UTC

Capital greek epsilon: Ε
Capital greek sigma: Σ

It's not an E.


21st November 2004 14:40 UTC

Oh yes, sorry. :D
Different letters, but we all meant the same: the mathematical symbol for a sum.


23rd November 2004 13:54 UTC

oops, I meant sigma, knowledge of greek letters is not one of my fortés


23rd November 2004 21:03 UTC

as long as we know to use them correctly; who cares how they're called or spelled! :p


26th November 2004 07:23 UTC

UnConeD... that pedantic zebra lover