Originally posted by: Moth3r
That code is all double dutch (sorry Arnie!) to me as well. Damn forum software.
Putting it simply, for people with simple brains like me:
Lets say you have a frame of video, so many pixels, each pixel has a value for Y, U and V. (Could also work in RGB?)
Draw a bar chart - or histogram - for the Y (luminance) values; the x axis as the values from 0 to 255 and the y axis is the number of pixels having that particular Y value. The shape you end up with is governed by the "look" of the image; Mike Verta gives a good editorial on his page here (read the bit titled "crunch time".
A probability density function produces a curve that approximates to the shape of the graph (the function called the normal distribution is the one most people have heard of).
The process that Laserman is describing is a method of generating a function that produces a curve approximating to video 1's histogram, then adjusting the values of video 2 so that they match this curve.
I would love to see someone with coding ability take this on and come up with an AVISynth filter. Have you tried the AVISynth development forum at doom9 to see if there's any interest?
That code is all double dutch (sorry Arnie!) to me as well. Damn forum software.

Putting it simply, for people with simple brains like me:
Lets say you have a frame of video, so many pixels, each pixel has a value for Y, U and V. (Could also work in RGB?)
Draw a bar chart - or histogram - for the Y (luminance) values; the x axis as the values from 0 to 255 and the y axis is the number of pixels having that particular Y value. The shape you end up with is governed by the "look" of the image; Mike Verta gives a good editorial on his page here (read the bit titled "crunch time".
A probability density function produces a curve that approximates to the shape of the graph (the function called the normal distribution is the one most people have heard of).
The process that Laserman is describing is a method of generating a function that produces a curve approximating to video 1's histogram, then adjusting the values of video 2 so that they match this curve.
I would love to see someone with coding ability take this on and come up with an AVISynth filter. Have you tried the AVISynth development forum at doom9 to see if there's any interest?
Good summary Moth3r, yes it will work in RGB, (I did it for RBG, haven't tried it with YUV) effectively with the matrix transforms you are pushing it through other colourspaces on the way, (The more rotations the closer the match) it would really just be up to the programmer what they wanted to support as an input.
If you look at the graphs on the last pages of the article you can see that with every rotation the graphs look more like each other (i.e. they approach convergence) with enough rotations they actually *do* converge and both images will have the exact same pdf. I find this stunning, and couldn't believe it when I first read the article, but they go on to give the proof and it is simple and elegant.
Now someone with a far bigger brain than mine could find the optimal rotations to get you there, but in practice a random selection of rotations will do.
Thanks for the link to Mike's page, I hadn't read all that before, interesting about the music.