i have some images with some periodic structures in them. i
am interested in finding the average spacing between the
lines that make up the objects (just think of, as an
example, a bundle of hairs, where each hair is clearly
resolved, and there are several such bundles per image).
the images are really noisy, and the intensity of the
'hairs' is not uniform along their length. so what i have
decided to do is to use the 'improfile' tool to measure the
intensity across the bundles, orthogonal to the long axis of
the bundles. this generates something that looks like a
noisy sine wave. if i do this a bunch of times for each
image, i get a bunch of noisy sine waves. now, in order to
get some idea of the spacing between 'hairs' in the bundles,
i was thinking i would just compute the power spectra of all
these noisy sine waves, and see where the peaks show up.
problem is, i am not sure how to translate the pixel
dimensions into the 'sampling frequency' of my image (which
i can then pass to the pwelch or similar function). i was
thinking it would be nice to have the x-axis of the power
spectrum in some relevant units (such as nanometers), and i
know that my image has a resolution of about 5 pixels per
nanometer. so, if i want the x-axis in nanometers, does
this mean my sampling frequency is 5? i don't think this is
correct, since this would then limit my spatial frequency
range to 2.5 nanometers, which is clearly not correct. does
that mean, then, that my sampling frequency is actually the
full dimensions of my original image, in nanometers? i am
clearly confused here... any help much appreciated.
On Apr 1, 7:37=A0pm, "Bryan " <cssm...@gmail.com> wrote:
> hi all,
>
> i have some images with some periodic structures in them. =A0i
> am interested in finding the average spacing between the
> lines that make up the objects (just think of, as an
> example, a bundle of hairs, where each hair is clearly
> resolved, and there are several such bundles per image).
> the images are really noisy, and the intensity of the
> 'hairs' is not uniform along their length. =A0so what i have
> decided to do is to use the 'improfile' tool to measure the
> intensity across the bundles, orthogonal to the long axis of
> the bundles. =A0this generates something that looks like a
> noisy sine wave. =A0if i do this a bunch of times for each
> image, i get a bunch of noisy sine waves. =A0now, in order to
> get some idea of the spacing between 'hairs' in the bundles,
> i was thinking i would just compute the power spectra of all
> these noisy sine waves, and see where the peaks show up.
> problem is, i am not sure how to translate the pixel
> dimensions into the 'sampling frequency' of my image (which
> i can then pass to the pwelch or similar function). =A0i was
> thinking it would be nice to have the x-axis of the power
> spectrum in some relevant units (such as nanometers), and i
> know that my image has a resolution of about 5 pixels per
> nanometer. =A0so, if i want the x-axis in nanometers, does
> this mean my sampling frequency is 5? =A0i don't think this is
> correct, since this would then limit my spatial frequency
> range to 2.5 nanometers, which is clearly not correct. =A0does
> that mean, then, that my sampling frequency is actually the
> full dimensions of my original image, in nanometers? =A0i am
> clearly confused here... any help much appreciated.
>
> thanks,
> bryan
-------------------------------------------------------
bryan:
I just have time for a little help here. Your units are all messed
up. You talk about your power spectrum having units of nanometers --
this is wrong. You talk about your spatial domain as having units of
5 pixels per nanometers - this is deceptive/misleading and dangerous
thinking because you're talking like your spatial domain has units
like a spatial frequency domain. Let's get this straightened out
Your spatial domain has units of real spatial units, like nanometers.
Nanometers (or whatever length unit you use) must be in the
numerator. Sure you can have 5 pixels per nanometer but then you must
believe that your units must still be nanometers (in this case 0.2
nanometers). If you're thinking "5 pixels/nm" then you're having
nanometers in the denominator, which is how it is for the spatial
frequency domain, not the spatial domain. Don't fall into that trap.
Now, in the spatial frequency domain, the units are basically inverted
from the spatial domain so you know that you need nanometers in the
denominator. The units in the spatial frequency domain (often called
the Fourier domain) are cycles per degree. Now a degree corresponds
to an angle which, given a distance, then maps directly into a spatial
distance, which would be nanometers. So now you have cycles per
nanometer. Often people look in the Fourier domain to determine
what's called the Modulation Transfer Function (MTF) and to measure
that, people often use targets made up of black and white lines. One
cycle is one black line and one white line, which is called a line
pair. So this is why you often see MTF in either line pairs per
degree or cycles per degree. Back to your case, your units in the
spatial frequency domain would then be cycles (or line pairs) per
nanometer.
The center pixel of your Fourier spectrum basically corresponds to no
variation at all: a constant intensity which is the offset, or the
mean gray level of your image. This is often called the "DC
component." One pixel away from that center pixel corresponds to the
energy (power) in a signal which would (I believe) correspond to one
cycle (sine wave period) or line pair over your whole spatial domain
image. Two pixels way from the center pixel corresponds to energy in
spatial frequency that would be two full cycles over your spatial
domain image. Three pixels away is the energy in waves that are at
such a period such that there are 3 full periods in your image. And
so on.
That's all for now. Gotta go.
Regards,
ImageAnalyst
ImageAnalyst <imageanalyst@mailinator.com> wrote in message
<c6576978-93b9-455c-95aa-c9e9fe7330c2@d62g2000hsf.googlegroups.com>...
>
> -------------------------------------------------------
> bryan:
> I just have time for a little help here. Your units are
all messed
> up. You talk about your power spectrum having units of
nanometers --
> this is wrong. You talk about your spatial domain as
having units of
> 5 pixels per nanometers - this is deceptive/misleading and
dangerous
> thinking because you're talking like your spatial domain
has units
> like a spatial frequency domain. Let's get this
straightened out
>
> Your spatial domain has units of real spatial units, like
nanometers.
> Nanometers (or whatever length unit you use) must be in the
> numerator. Sure you can have 5 pixels per nanometer but
then you must
> believe that your units must still be nanometers (in this
case 0.2
> nanometers). If you're thinking "5 pixels/nm" then you're
having
> nanometers in the denominator, which is how it is for the
spatial
> frequency domain, not the spatial domain. Don't fall into
that trap.
uhh... what?! it is customary to refer to spatial
resolution in an image in terms of pixels per unit (eg. ppi,
or pixels per inch). not sure what the hangup is on
numerator versus denominator here. it is clearly arbitrary,
and the conversion between the two is trivial. i was,
however, being stupid in describing the limits of my x-axis
in frequency space. clearly what i am looking for is 1/nm
in my power spectrum x-axis. at least, i think that's what
i want to have.
>
> The center pixel of your Fourier spectrum basically
corresponds to no
> variation at all: a constant intensity which is the
offset, or the
> mean gray level of your image. This is often called the "DC
to clarify, in case any poor soul happens to read this, your
description of this is only true (in matlab) if the output
of a 2-d fft is passed to the matlab 'fftshift' function.
otherwise, low frequencies are in the corners, not the
center. but this is all irrelevant, since i did not ask for
any information about interpreting a 2-d fft. i had already
tried looking at a 2-d fft of my images, and there was
nothing interesting in the spectrum as determined that way.
instead (perhaps due to excessive correlated noise in the
images, or because there is a large percentage of irrelevant
pixels in the images), what i am hoping to do is to use line
profiles of my objects of interest (doc improfile), and then
compute a power spectrum (or a power spectral density... i
don't think i care) on the resulting 1-d line profiles.
but here's what i don't get... in the various functions for
computing power (or psd), one can pass an optional 'sampling
frequency' argument such that the resulting x-axis in the
power spectrum (or psd) plot is in (normally) units of 1/s
(instead of normalized frequencies of x*p1 rads/sample). so
what i am wondering is, if i know i have about 5 pixels per
nanometer (or .2 nanometers per pixel, if you must), what
value do i use as my sampling frequency in computing a psd
using, for example, the pwelch method?
Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central. Read the complete Disclaimer prior to use.