Log in

View Full Version : Opinions on luma based blurring.


sh0dan
1st August 2002, 11:35
I need some feedback on some tests I've been running for a new version of SmoothHiQ.

What I'm working on is variable thresholds, based on luma values. That means, that the threshold is adjusted based on the luma value of the current pixel. This is because the eye has different sensitivities at different luma values.

What I need some opinions on is _how_ to adjust thresholds, so it'll make the best result. There seems to be some contradictions on what the eye is most sensitive to. Some say dark luma values, some say light and some says it is luma=128.

I've done a test implementation:

double Lstepsize=(Lthreshold_max-Lthreshold)/256.0;
double Lval=Lthreshold;
double Cstepsize=(Cthreshold_max-Cthreshold)/256.0;
double Cval=Cthreshold;
for (i=0;i<256;i++) { // Build luma threshold table
lumatable[i]=(int)(Lval+0.5)|(((int)(Cval+0.5))<<16);
Lval+=Lstepsize;
Cval+=Cstepsize;
}

Lthreshold, Lthreshold_max - Lthreshold is applied at luma=0 and Lthreshold_max is when luma=255. Threshold is then linearly interpolated between them. Same with Cthreshold.

Don't mind the bit-packing, it's just for faster lookup-speed.

Is this a good way of doing it? Is there better alternatives? Would a logarithmic algorithm be better?

sh0dan
1st August 2002, 11:43
For you, who want to test it out, download a test-version

http://cultact-server.novi.dk/kpo/avisynth/SmoothHiQ_11_test.zip

Parameters are:

SmoothHiQ(Diameter, Luma Threshold, Chroma threshold, Amount, Maintain Difference,At_Max_luma_use_this_Luma_Threshold,At_Max_luma_use_this_Chroma_Threshold)

OK - so you now enter two thresholds - the first, ordinary, when the image is dark - and the second is how it should be, when the image is white. As usual there are seperate luma/chroma thresholds.

All threshold must be more than 0 (zero).