Re: best fit linear filter





DharmaFog schrieb:
On Jul 26, 12:34 am, ti_chris <tiChri...@xxxxxxxxx> wrote:
On Jul 24, 7:11 pm, DharmaFog <Agile.Asp...@xxxxxxxxx> wrote:



On Jul 22, 12:18 pm, "Fredo" <fr...@xxxxxxxxxxx> wrote:

I have an image that I need to normalize the brightness on. The image is
greyscale 8-bit. I'm told I need to do a best fit linear filter. How do I do
this? Is this just a linear regression? If so, I need X&Y values and I'm not
sure what should be X vs. what should be Y. I assume one of them is the
pixel brightness. What's the other?

Thanks

It's actually an exercise in simple ratios.

First find the maximum and minimum gray scale for the
image you want to normalize, i.e., the range of the existing
values.

Suppose you want to normalize the values to N=255.

Then

new_value=(old_value-minimum)*N/(maximum-minimum)

Although this can generate decent results, it is definitely not
ideal. Take the example of an image that has a concentration of
middle-range pixels and one or two pixels at the boundaries. In such
a case, you would not scale the image because min = 0, max = 255,
while in reality, you would benefit from over-saturating those couple
pixels that are out of range. Fredo is right. You need to apply a
best-fit to achieve good results here.

I'm guessing you're really looking to do a linear regression. You can
find lots of resources if you google for that. A simple one is
wikipedia:

http://en.wikipedia.org/wiki/Linear_regression

You're effectively looking at applying least square on the difference
between the "new value" and the "old value" given a line y = mx + b.
Least square should minimize things decently enough that it should
look much better than what DharmaFog is proposing. If you want a
quick and dirty thing that works however, his suggestion is quite
valid.

First, normalization implies scaling - it's doesn't imply molesting
the histogram distribution.

Second, I really don't know what a "best fit linear filter"
is since "best" hasn't been defined.

And if was defined, then I'd probably filter the image using
a FIR filter.

Third, in your particular case - where you evidently want
to modify the existing histogram distribution - I would
recommend trying histogram equalization

http://en.wikipedia.org/wiki/Histogram_equalization

But beware, when you use histogram equalization (or any
other method which molests the distribution) you run the risk
of increasing the noise and decreasing the signal.

Meanwhile, the OP seems to believe that his 'normalization'
is nicely executed by a high pass filter (without mentioning the
necessary offset):
http://groups.google.de/group/sci.image.processing/browse_frm/thread/3512a979fb60707d#

Best regards --Gernot Hoffmann
.



Relevant Pages

  • Re: best fit linear filter
    ... I'm told I need to do a best fit linear filter. ... middle-range pixels and one or two pixels at the boundaries. ... I'm guessing you're really looking to do a linear regression. ... the histogram distribution. ...
    (comp.graphics.algorithms)
  • Re: best fit linear filter
    ... I'm told I need to do a best fit linear filter. ... middle-range pixels and one or two pixels at the boundaries. ... the histogram distribution. ...
    (comp.graphics.algorithms)
  • Re: best fit linear filter
    ... that in, but not knowing what a "best fit linear filter" is, and the fact ... linear regression, which I don't think is what I want, but maybe it is. ... pixel brightness is X, ... On a 1 to 10 scale, with 10 the most vague, your question ...
    (sci.image.processing)
  • Re: best fit linear filter
    ... greyscale 8-bit. ... I'm told I need to do a best fit linear filter. ... Is this just a linear regression? ... Suppose you want to normalize the values to N=255. ...
    (comp.graphics.algorithms)
  • Re: best fit linear filter
    ... Fredo wrote: ... greyscale 8-bit. ... I'm told I need to do a best fit linear filter. ... Is this just a linear regression? ...
    (comp.graphics.algorithms)