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?
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?