Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
image processing...mathematical techniques?

Subject: image processing...mathematical techniques?

From: Mark Zarella

Date: 22 Dec, 2003 19:02:51

Message: 1 of 7

Can anyone point me to any kind of mathematical treatment that would address
removing noisy pixels from images before employing other types of
processing? For instance, if I want to find the spatial power spectral
density of an image, is there a way to remove a group of known noisy pixels
such that they don't contribute to the PSD estimate? If so, are there
references or a mathematical technique to validate such a procedure?

What I've been doing is the following (and I have no mathematical proof that
it's valid, or any way of measuring bias/variance of the estimate):

I first compute the PSD by taking the FFT of the autocorrelation function of
the image (Weiner-Khinchin theorem). Note that I use an unbiased
autocorrelation estimate which provides a normalization factor. But prior
to taking the autocorrelation function, I set the pixels with the noise in
it to an invalid value. So, when I take the autocorrelation, I simply pass
over all calculations that would utilize those pixels. I adjust the
normalization accordingly.

So is there a better way of doing that? Or is there some way to validate
that procedure mathematically?

Subject: image processing...mathematical techniques?

From: David

Date: 24 Dec, 2003 11:54:46

Message: 2 of 7

Your question is so open ended. Generally speaking, there is a wealth
of material in the literature concerning spectral estimation in the
presence of noise.

If your noise is white, kalman and wiener filtering is clearly the
way to go; based on your use of certain assumptions, these are
optimal.

If your noise is 1/f (shot noise), then some type of median filtering
is generally used. This leads into the stack filter, which I'd rather
not delve into, except to say that any closed form analysis using
these nonlineral operations is difficult in the extreme.

As for your approach of making certain pixels invalid, Ahhhgh! Your
esentially punching holes into your data. This esentially adds
impulses, which will add a white noise spectrum in your estimate;
this will dominate your estimate (when the "real" spectrum is low in
magnitude). What a stack, (or median) filter esentially does, is that
it takes these 'suspect' pixels and REPLACES them with values that
are more consistent with the rest of the image. This is done based on
the context surrounding the pixel that is replaced. I could say so
much more... but I leave you with these thoughs for now. Good luck.

Subject: image processing...mathematical techniques?

From: Mark Zarella

Date: 24 Dec, 2003 12:13:25

Message: 3 of 7

> Your question is so open ended. Generally speaking, there is a wealth
> of material in the literature concerning spectral estimation in the
> presence of noise.
>
> If your noise is white, kalman and wiener filtering is clearly the
> way to go; based on your use of certain assumptions, these are
> optimal.
>
> If your noise is 1/f (shot noise), then some type of median filtering
> is generally used. This leads into the stack filter, which I'd rather
> not delve into, except to say that any closed form analysis using
> these nonlineral operations is difficult in the extreme.
>
> As for your approach of making certain pixels invalid, Ahhhgh! Your
> esentially punching holes into your data. This esentially adds
> impulses, which will add a white noise spectrum in your estimate;
> this will dominate your estimate (when the "real" spectrum is low in
> magnitude). What a stack, (or median) filter esentially does, is that
> it takes these 'suspect' pixels and REPLACES them with values that
> are more consistent with the rest of the image. This is done based on
> the context surrounding the pixel that is replaced. I could say so
> much more... but I leave you with these thoughs for now. Good luck.

Thanks for your reply. I didn't consider the technique I employed "punching
holes in the data" for a couple reasons. First, it was being applied to the
autocorrelation array rather than the data set. Second, I would expect it
to fall out in the normalization process, whereby those null-pixel instances
are not tallied in the sum. I've been picturing it as sort of a binary
windowing function. So what does a "regular" windowing function do to an
autocorrelation estimate? It seems it can be applied, as people sometimes
crop their data before windowing (ie. applying a rectangular window).

Anyway, I'll look into a stack filter. Thanks for the tip. It may be
similar to other types of filters I've seen where pixel values are replaced
by averages of adjacent pixels and so forth. But I've avoided this type of
analysis because the spatial extent of the noisy data (which is basically
like a bar in front of a periodic image) is clustered and often greater than
the period of the signal behind it. In that case, it seems like it would be
difficult to replace it.

Subject: image processing...mathematical techniques?

From: Dav

Date: 27 Dec, 2003 01:37:06

Message: 4 of 7

>So what does a "regular" windowing function
> do to an
> autocorrelation estimate? It seems it can be applied, as people
> sometimes
> crop their data before windowing (ie. applying a rectangular
> window).

That's well understood. See the bartless method of spectral
estimation. It can easily be generalized for different windows.

> Anyway, I'll look into a stack filter. Thanks for the tip. It may
> be
> similar to other types of filters I've seen where pixel values are
> replaced
> by averages of adjacent pixels and so forth. But I've avoided this
> type of
> analysis because the spatial extent of the noisy data (which is
> basically
> like a bar in front of a periodic image) is clustered and often
> greater than
> the period of the signal behind it. In that case, it seems like it
> would be
> difficult to replace it.

I's suggest that you try to use 2-D linear prediction on the original
image to replace the 'bar'BEFORE trying to fix the effects you see in
the autocorrelation function. By the time you compute the
autocorrrelation function, it's too late. The entire acf estimate is
tainted, not just some little piece that can be cropped off.

Dav

Subject: image processing...mathematical techniques?

From: Mark Zarella

Date: 27 Dec, 2003 20:49:07

Message: 5 of 7

> > Anyway, I'll look into a stack filter. Thanks for the tip. It may
> > be
> > similar to other types of filters I've seen where pixel values are
> > replaced
> > by averages of adjacent pixels and so forth. But I've avoided this
> > type of
> > analysis because the spatial extent of the noisy data (which is
> > basically
> > like a bar in front of a periodic image) is clustered and often
> > greater than
> > the period of the signal behind it. In that case, it seems like it
> > would be
> > difficult to replace it.
>
> I's suggest that you try to use 2-D linear prediction on the original
> image to replace the 'bar'BEFORE trying to fix the effects you see in
> the autocorrelation function. By the time you compute the
> autocorrrelation function, it's too late. The entire acf estimate is
> tainted, not just some little piece that can be cropped off.

Yes, that's what the process I described does. It crops out the bar from
the original image, not the autocorrelation image. But it does so during
the autocorrelation estimate. Essentially, it calculates the
autocorrelation as R[k]=1/N * sum(x[n]x[n+k]w[n]w[n+k]), where w is a binary
function equal to zero for all pixels in which the bar is present, and N is
equal to the number of values summed.

Subject: image processing...mathematical techniques?

From: Dav

Date: 29 Dec, 2003 16:29:06

Message: 6 of 7

>
> Yes, that's what the process I described does. It crops out the
> bar from
> the original image, not the autocorrelation image. But it does so
> during
> the autocorrelation estimate. Essentially, it calculates the
> autocorrelation as R[k]=1/N * sum(x[n]x[n+k]w[n]w[n+k]), where w is
> a binary
> function equal to zero for all pixels in which the bar is present,
> and N is
> equal to the number of values summed.

OK, I see what you're doing now. If you're normalizing correctly,
you're esentially assuming that the invalid overlapping portions
would have given the exact same contribution as the valid overlapping
portions. The good news, is that you should get an unbiased estimate
of the true acf ... the bad news is that the variance of your
estimate increases faster than an ordinary rectangular window because
the number of valid pixels (the value of 'N') that contributes to
your estimate drops faster as a function of shift than it would for a
compact region. Based on your description of the dimensions of the
'bar', I don't think that prediction or stack filters will improve
matters at all. It sounds like your making the best you can of a
difficult situation. Good luck.

Dav

Subject: image processing...mathematical techniques?

From: Mark Zarella

Date: 29 Dec, 2003 19:10:28

Message: 7 of 7

> > Yes, that's what the process I described does. It crops out the
> > bar from
> > the original image, not the autocorrelation image. But it does so
> > during
> > the autocorrelation estimate. Essentially, it calculates the
> > autocorrelation as R[k]=1/N * sum(x[n]x[n+k]w[n]w[n+k]), where w is
> > a binary
> > function equal to zero for all pixels in which the bar is present,
> > and N is
> > equal to the number of values summed.
>
> OK, I see what you're doing now. If you're normalizing correctly,
> you're esentially assuming that the invalid overlapping portions
> would have given the exact same contribution as the valid overlapping
> portions. The good news, is that you should get an unbiased estimate
> of the true acf ... the bad news is that the variance of your
> estimate increases faster than an ordinary rectangular window because
> the number of valid pixels (the value of 'N') that contributes to
> your estimate drops faster as a function of shift than it would for a
> compact region. Based on your description of the dimensions of the
> 'bar', I don't think that prediction or stack filters will improve
> matters at all. It sounds like your making the best you can of a
> difficult situation. Good luck.

Thanks for the help. My N is sort of limited (144x192), so increasing the
variance is a tough tradeoff to justify. However, running a few preliminary
runs demonstrates that this technique works in certain cases, where the
occluders (or "bars", as I've been referring to them) contaminate the image
so much that the subsequent FFT on the ACF actually yields peaks for the
periodicity of the bars. So under certain circumstances I want to be able
to apply this technique. I'm just having trouble justifying it
mathematically. Or more generally, I'm having trouble justifying the use of
windowing the data set in an ACF estimator. I'll go ahead and use it and
"pretend" that everyone knows that it's valid. :)

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us