Fredo schrieb:
> I have an image that I'm told I need to do a best fit linear filter on,
but
> I'm not exactly sure what that means and searches on it keep leading me
to
> linear regression, which I don't think is what I want, but maybe it is.
>
> Can someone give me some help here? If it's a linear regression and the
> pixel brightness (they're 8-bit greyscale) is X, what is Y?
>
> Thanks.
Coming from
comp.graphics.algorithms
it seems you forgot to copy this phrase:
'I have an image that I need to normalize the brightness on.'
I don't know any algorithm for brightness normalization, but it
is possible to achieve a reasonable brightness automatically.
My suggestion: try something like Photoshop's Auto Contrast.
The darkest pixels (excluding the darkest 0.5 %) are mapped to 0.
The brightest pixels (excluding the brightest 0.5%) are mapped to
255.
For a pass****t photo we can assume that the background is light
(as far as I know), and that it consumes a more or less fixed
percentage
of the area. Then we can use the mean gray value of the image as a
reference for normalization, for instance:
1. the head plus background: Gray=183, L*=74 (of 100)
2. the head without background: Gray=138, L*=57
The Lab lightness L* for the the head alone is expected near to 50.
If the value should differ considerably, then we can apply either a
power function y=round(255*(x/255)^a) with a>1 for brighter and a<1
for darker, or a quadratic polynomial with banana-like shape.
The exponent (a) or the polynomial coefficients can be calculated,
if required.
It would be very helpful to test strategies by Photoshop (as I did).
Mean values are found by 'Histogram'. Background can be excluded
by a coarse selection.
Hope this helps a little.
Best regards --Gernot Hoffmann


|