www.GetXFactor.com

Leading Technology, Science,
Agriculture News and information


Part of the Identityscape.com network...

getxfactor.com jmoodmusic.com smartbusinesschoices.com mintdepot.com lowfaresalways.com evangelicalview.com shoppingpodder.com soproudlywehail.com webnews.ws currenthumor.com

 

 

Accurate edge detection?
Goto page Previous  1, 2, 3  Next
   Science and Technology news... Forum Index -> Image Processing Forum  
View previous topic :: View next topic  
Author Message
aruzinsky
Guest






PostPosted: Wed Jul 23, 2008 2:57 pm    Post subject: Re: Accurate edge detection? Reply with quote

On Jul 23, 3:16 am, Martin Brown <|||newspam...@nezumi.demon.co.uk>
wrote:
[quote]aruzinsky wrote:
On Jul 20, 2:24 pm, "Science.Medical.Imaging List"
pixel.to.l...@gmail.com> wrote:
On Jul 19, 7:44 am, "aruzinsky" <aruzin...@nospam.general-

cathexis.com> wrote:
For some reason, my Google Usenet portal is not automatically producing
quotes on my reply to your post therefore I have done it manually.
"About the last part: are you sure most of the influence of 'optics,
sensor size and shape,
demosaicing, and size reduction' can be represented by a linear
transformation on acquired values?
I would think you meant not 'represented' but 'estimated'.
I would be really interested in knowing about any existing (published)
proofs in support of your response."
It is not a linear transformation on "acquired values," y, but on x which
represents
a higher resolution discrete image that  approximates the continuous
(infinite resolution) image falling on the sensors.  x' is an estimate of
x.  Depending on the estimation method, x' may or may not be a linear
function of observations, y.  
The matrix A represents convolution and decimation and is not invertible.
It is well known that most, if not all, optical effects are convolutions, a
linear transformation. Possibly the convolution kernel is a function of
spatial coordinate (as in the case of the bad Hubble telescope lens) but
it still can be represented by a linear transformation, A.  The effect of
pixel sensor size and shape is represented by continuous convolution
followed by decimation which again can be incorporated into A.  Some, but
not all cases of demosaicing are also linear transformations.
--
Message posted usinghttp://www.talkaboutgraphics.com/group/sci.image.processing/
More information athttp://www.talkaboutgraphics.com/faq.html
This makes more sense now. Your earlier post suggested (perhaps it was
the words) that all optical effects can be represented by a
combination of linear transformations. That was hard to understand. It
is more reasonable to say that 'some' of the optical effects can be
represented as linear transformations.- Hide quoted text -

- Show quoted text -

I was suggesting that, but I am not knowledgeable of every possible
optical effect.  Name one optical effect that can>t be represented by
a linear transformation.

The most common ones that break modern deconvolution codes are a point
spread function that is not position invariant.
The is the imaging
system has off axis abberations (most real diffraction limited optics
suffer some degradation as you go off axis).

[/quote]
That is still a linear transformation, as I previously mentioned for
the case of the bad Hubble telescope lens. And, that problem was
tractable. In fact, many common deconvolution methods work directly
in the spatial domain (no FFTs allowed) can be modified for this
problem.

[quote]And the real killer in the general photography situation is depth of
field. You can model the psf for a given subject distance, but when
different parts of the same image are all at different unknown distances
you have a pretty much intractable problem. Or one that is only
resolvable with binocular pairs of images and insane amounts of
computing power.

[/quote]
It might be killer intractable, but I think it is linear.

[quote]If the OP wants specifically to find sharp edges with the utmost
precision and doesn>t care about the computational cost then one of the
Bayesian methods using all available prior knowledge will probably give
the optimum result. This reference is a bit old but is a start:

http://adsabs.harvard.edu/abs/1980ITAC...25...36M

There seem to be few papers on this application which suggests to me
that it doesn>t work well enough to be worth the computational cost.

Regards,
Martin Brown
** Posted fromhttp://www.teranews.com**- Hide quoted text -

- Show quoted text -
[/quote]
Don>t forget that "optimal result" is with respect to some statistical
cost function and some individual cases of estimated edge location can
be grossly inaccurate.
Back to top
illywhacker
Guest






PostPosted: Wed Jul 23, 2008 4:01 pm    Post subject: Re: Accurate edge detection? Reply with quote

On Jul 17, 7:54 pm, slus...@lw4u.com wrote:
[quote]I originally posted the following on the sci.optics newsgroup because
it>s more of an optical query.  Nevertheless, the folks here may be
more familiar with the available references and research that>s been
done. Please forgive my statement of some things that will no doubt be
obvious to many here.  (BTW: I also have a description of the
experiments we>ve performed for anyone interested.)

==================================================> In the image processing community, there are discussions of edge
detection techniques.  For a simple case, imagine an opaque knife
edge
with a uniform back light behind it. Further imagine there is a lens
that images the knife edge onto a pixel detector of a camera.

In general, the transition from dark to light at the detector is some
smoothly varying function, not a sharp jump.  Diffraction, of course,
limits the ultimate sharpness of the edge image -- diffraction at the
edge itself, and diffraction at the aperture of the lens.
Aberrations
of the lens will also contribute to this edge smoothing.

The digital image as presented *by* the camera may take only a pixel
or two to transition from dark to light, or it might take many more.
Regardless, digitization and pixel size and other factors such as MTF
of the electronics themselves serve to mask the true edge function

A very common starting point in the discussions and papers about edge
detection techniques is the assumption that the point at which the
slope of the edge is maximum represents the "true" edge position.
From then on, the various edge detection algorithms usually present
different methods of more accurately calculating this maximum slope,
especially in the face of optical and electronic noise, etc.

Nevertheless, it seems to me that the assumption that the maximum
slope represents the true edge is at least unmotivated (no matter how
"common sense" it feels) if not wrong.  I have in mind the pictures
of
edge diffraction as produced by using Cornu>s spiral.  The location
of
the true edge, relative to the average intensity of the light area
(smoothing out the diffraction oscillations), looks to be at a
position of increasing slope as you go from dark to light, but NOT
maximum.  Furthermore, the edge is less than the 50% point of peak
light intensity.  (Another assumption sometimes made in image
processing is that the 50% point of the dark to light transistion
represents the edge.)

Does anyone have references they can point to (or their own pesuasive
arguments) that describe where the true edge location should be
relative to the edge image function?  We have done a couple of bench
tests to suggest under the experimental conditions that the best edge
location is about 41% to 46% of the range of the dark to light
transition.  We haven>t yet completed our analysis regarding how this
compares to the peak slope.

This problem has to have been tackled successfully before, but so far
I>ve not found any good sources that address the optical issue, only
software techniques.

Thanks!

Spencer
[/quote]
Actually for a straight knife edge, it is pretty easy to see that for
any translation-invariant linear operator that is reflection-invariant
in the direction along the edge (which, as Aruzinsky points out,
covers a lot of optical ground):

1) the slope is an extremum at the edge position (in the continuum);
and

2) the intensity at the edge position is the average of the intensity
at the extremes (of course, this is not a local measurement).

The basic equation is as follows. Let J be the observed image (in the
continuum); let the knife edge be at point x0; let I1 and I2 be the
intensities for x much less than x0 and x much greater than x0; let
the kernel of the linear operator be G(x, y) (remember it is
translation invariant). Let

H(x) = \int dy G(x, y)

and

L(x) = \int_{-\infty}^{x} dx' H(x') .

Obviously L(-\infty) = 0. Suppose that L(\infty) = 1 (this is just
normalization). Then

J(x) = I1 + (I2 - I1) L(x - x0) .

Note that J does not depend on y, as I did not. Since L(x) = L(-x) by
hypothesis, we have that L(0) = 1/2 and that L''(0) = 0.

illywhacker;
Back to top
Guest







PostPosted: Wed Jul 23, 2008 8:48 pm    Post subject: Re: Accurate edge detection? Reply with quote

On Jul 22, 11:59 am, aruzinsky <aruzin...@general-cathexis.com> wrote:
[quote]On Jul 22, 8:04 am, slus...@lw4u.com wrote:



Thank you for your interest and offer to review some sample images.
Unfortunately, our concern is not on the software or algorithmic side,
but on the optical side.  As I mentioned in my original post:

"Does anyone have references they can point to (or their own
pesuasive
arguments) that describe where the true edge location should be
relative to the edge image function?"

I already did.  What is wrong with you?



I also mentioned that I originally posted to sci.optics, then added
sci.image.processing because I thought the folks here might be more
aware of relavent references.  The (apparently) commonly held belief
that the maximum slope of the edge image, or the midpoint between the
maximum and minimum grey level values of the edge image corresponds to
the true edge location seems unmotivated or unsupported to me, even
though it "feels" like common sense.  

That is an algorithm, albeit a really stupid one that is not common
sense, so don>t tell me that you are not interest in algorithms.
Furthermore, that is not a commonly held belief, e.g., it is common
knowledge that shock filters sharpen an edge around the inflection
point (the inflection point is preserved) and nobody, I know of,
pretends that shock filtering is deconvolution.

We have also performed bench
experiments that suggest that neither the max. slope nor the grey
level midpoint corresponds to the true edge, with errors being in the
range of 0.2 to 0.45 pixels in the experimental set up we used.

I hope my tax money didn>t fund that busy work.

 We
are continuing our own investigation, but I have to believe that
someone has already done this at some time and published their
results.  I>d love to find out that our own efforts at inventing the
wheel are unecessary. :-)

I already gave you a reference to a relatively simple algorithm that
might do better than 0.2 pixels.   It would be foolish not to try it.
[/quote]
Hmm. I appear to have offended you. If it was because I had not yet
acknowledged your reply to my query, I apologize. I was, in fact,
digesting your comments as well as the two references you provided. I
was also reading what I found upon looking up "edge interpolation" as
you suggested. In the meantime, Andrew offered a suggestion that I
was more easily and quickly able to address, which included my
referring back to, and quoting my original post. You may have
interpreted that as my ignoring your suggestions.

Regarding your references, I believe I can see the point(s) you are
making, but I also don>t see the relavence to the *physics* of
correlating the image of an edge to the location of the real edge. We
might be talking past each other here, much as the Americans and Brits
are separated by a common language. :-)

Let>s ignore pixels for a moment, and pretend we can sample the image
of a back lit knife edge with infinite resolution, casting God>s eye
upon the screen on which the light eventualy falls. Are you familiar
with Fresnel diffraction at an edge? When one looks at a plot of
intensity of the light around the "shadow" zone, one sees there is
light in the region that would otherwise be forbidden if there was no
diffraction. One also sees that "past" the edge, the light intensity
climbs, reaches a peak, then oscillates in a decaying fashion,
eventually reaching a uniform intensity.

If you look closely at this plot, we see that the point on the light
intensity curve that in fact corresponds to the true location of the
knife edge is of an increasing slope, but is neither the maximum slope
(gradient), nor an inflection point, nor, generally speaking, is it
midway between the minimum light level and the average high light
level, much less the peak. Thus, edge finding techniques that depend
in some fashion on maximum slope or gradient (Sobel, Canny ,etc.) or
50% threshold level, would not find the point on this edge image that
corresponds to the position of the true physical edge. Of course this
is just a start. The edge image is further complicated by the many
other phenomena that occur when using lenses to place the image onto a
pixel detector.

My own readings found, in many cases, discussion of edge detection
schemes that do in fact start with the presumption that the maximum
slope or gradient of an edge image should in some way correspond to
the true location of the edge, but with no explanation of why the
author believes this to be so. My guess is that this is something
that is simply "understood" by those working in the field, and is
passed along from one person to another without question. It>s
obvious that you hold no such belief, but at the level of my
investigation it *is* common.

As for time spent investigating this, rest assured that this is
strictly a capitalistic venture using private money, snide comments
not withstanding.

It may be of no interest to you, but others might find something
interesting. I>m cutting and pasting here a brief description of our
experiments that I also orignally posted on sci.optics:

Using a
chrome-on-glass bar target that is measured as 12.503mm long
+/-0.003mm, we grabbed images with a telecentric lens and red LED
collimated back light. We then used a micrometer stage to move the
target 12.503mm (again, with an error of +/-0.003mm) -- so that the
trailing edge at the new postion corresponds to the leading edge of
the original position. The direction of motion was perpendicular to
the lens optical axis to within 0.25 degrees. We then used various
edge detection methods, including the 2nd derivative of the edge with
a fit to a parabola, as well as the simple 50% local thresholding,
among others. What we found consistently through different positions
in the field of view and different new set-ups is that the trailing
edge appeared to fail to move far enough to coincide with the old
leading edge. The error range was ~0.2 to 0.45 pixels, or about
0.015mm to 0.034mm in real world units -- always considerably larger
than target and motion error, and alway in the same direction of
error.

Another way to interpret this result is that an object consistently
looks larger than it actually is. (If the bar target appears to be
12.523mm, and you move it 12.503mm, the trailing edge will fail to
"catch" the initial position of the leading edge.)

We>ve tried this with different lens f-numbers from F/45 to F/8 and
did not see an obvious trend that followed the aperture, but on this
front we>ve only made a small number of tests -- 4 at each f-number.
The errors average ~0.3pixels, with the standard deviation ~0.05.


I will also add that we have used two different cameras (AVT Stingray
145b and Sony XC-ST70) out of suspicion that a non-linear responsivity
could be the culprit. While differing slightly in detail, we saw
essentially the same result.

Spencer
Back to top
Guest







PostPosted: Wed Jul 23, 2008 8:50 pm    Post subject: Re: Accurate edge detection? Reply with quote

On Jul 22, 6:02 pm, Andrew_M <m...@smartfills.com> wrote:
[quote]Andrew,

Thank you for your interest and offer to review some sample images.
Unfortunately, our concern is not on the software or algorithmic side,
but on the optical side.  As I mentioned in my original post:

"Does anyone have references they can point to (or their own
pesuasive
arguments) that describe where the true edge location should be
relative to the edge image function?"

I do not see, what do you mean. What cardinal enchancement with
optical side could be done? To change wave lenght, use larger lens or
increase exposure? As a result in any event you>ll get a scanned
digital image, what has to be processed by some soft. There are some
things, what cannot be done without proper algorithms. Have you ever
heard about superresolution (or overresolution- I>m not sure about
proper term- English isn>t my mother>s tongue). It is something like
what you want to get- obtain better resolution than your optical
system allows. I could only repeat- it is not a problem of where the
true edge is, it is a problem of restoration of a transformed image.
This problem requires specific methods. I twice made progs for science
image processing, and in any event I had to use much more complicated
methods than what my client thought.
Andrew
[/quote]
Hi Andrew,

Perhaps my just-posted reply to Aruzinsky might clarify what I>m
saying. Or, it might just muddy things up to perfect opacity. :-)

Spencer
Back to top
Guest







PostPosted: Wed Jul 23, 2008 8:52 pm    Post subject: Re: Accurate edge detection? Reply with quote

On Jul 23, 5:16 am, Martin Brown <|||newspam...@nezumi.demon.co.uk>
wrote:
[quote]aruzinsky wrote:
On Jul 20, 2:24 pm, "Science.Medical.Imaging List"
pixel.to.l...@gmail.com> wrote:
On Jul 19, 7:44 am, "aruzinsky" <aruzin...@nospam.general-

cathexis.com> wrote:
For some reason, my Google Usenet portal is not automatically producing
quotes on my reply to your post therefore I have done it manually.
"About the last part: are you sure most of the influence of 'optics,
sensor size and shape,
demosaicing, and size reduction' can be represented by a linear
transformation on acquired values?
I would think you meant not 'represented' but 'estimated'.
I would be really interested in knowing about any existing (published)
proofs in support of your response."
It is not a linear transformation on "acquired values," y, but on x which
represents
a higher resolution discrete image that  approximates the continuous
(infinite resolution) image falling on the sensors.  x' is an estimate of
x.  Depending on the estimation method, x' may or may not be a linear
function of observations, y.  
The matrix A represents convolution and decimation and is not invertible.
It is well known that most, if not all, optical effects are convolutions, a
linear transformation. Possibly the convolution kernel is a function of
spatial coordinate (as in the case of the bad Hubble telescope lens) but
it still can be represented by a linear transformation, A.  The effect of
pixel sensor size and shape is represented by continuous convolution
followed by decimation which again can be incorporated into A.  Some, but
not all cases of demosaicing are also linear transformations.
--
Message posted usinghttp://www.talkaboutgraphics.com/group/sci.image.processing/
More information athttp://www.talkaboutgraphics.com/faq.html
This makes more sense now. Your earlier post suggested (perhaps it was
the words) that all optical effects can be represented by a
combination of linear transformations. That was hard to understand. It
is more reasonable to say that 'some' of the optical effects can be
represented as linear transformations.- Hide quoted text -

- Show quoted text -

I was suggesting that, but I am not knowledgeable of every possible
optical effect.  Name one optical effect that can>t be represented by
a linear transformation.

The most common ones that break modern deconvolution codes are a point
spread function that is not position invariant. The is the imaging
system has off axis abberations (most real diffraction limited optics
suffer some degradation as you go off axis).

And the real killer in the general photography situation is depth of
field. You can model the psf for a given subject distance, but when
different parts of the same image are all at different unknown distances
you have a pretty much intractable problem. Or one that is only
resolvable with binocular pairs of images and insane amounts of
computing power.

If the OP wants specifically to find sharp edges with the utmost
precision and doesn>t care about the computational cost then one of the
Bayesian methods using all available prior knowledge will probably give
the optimum result. This reference is a bit old but is a start:

http://adsabs.harvard.edu/abs/1980ITAC...25...36M

There seem to be few papers on this application which suggests to me
that it doesn>t work well enough to be worth the computational cost.

Regards,
Martin Brown
** Posted fromhttp://www.teranews.com**- Hide quoted text -

- Show quoted text -
[/quote]
Thanks, Martin. I>ll take a look.

Spencer
Back to top
Guest







PostPosted: Wed Jul 23, 2008 9:12 pm    Post subject: Re: Accurate edge detection? Reply with quote

On Jul 23, 12:01 pm, illywhacker <illywac...@gmail.com> wrote:
[quote]On Jul 17, 7:54 pm, slus...@lw4u.com wrote:





I originally posted the following on the sci.optics newsgroup because
it>s more of an optical query.  Nevertheless, the folks here may be
more familiar with the available references and research that>s been
done. Please forgive my statement of some things that will no doubt be
obvious to many here.  (BTW: I also have a description of the
experiments we>ve performed for anyone interested.)

==================================================> > In the image processing community, there are discussions of edge
detection techniques.  For a simple case, imagine an opaque knife
edge
with a uniform back light behind it. Further imagine there is a lens
that images the knife edge onto a pixel detector of a camera.

In general, the transition from dark to light at the detector is some
smoothly varying function, not a sharp jump.  Diffraction, of course,
limits the ultimate sharpness of the edge image -- diffraction at the
edge itself, and diffraction at the aperture of the lens.
Aberrations
of the lens will also contribute to this edge smoothing.

The digital image as presented *by* the camera may take only a pixel
or two to transition from dark to light, or it might take many more.
Regardless, digitization and pixel size and other factors such as MTF
of the electronics themselves serve to mask the true edge function

A very common starting point in the discussions and papers about edge
detection techniques is the assumption that the point at which the
slope of the edge is maximum represents the "true" edge position.
From then on, the various edge detection algorithms usually present
different methods of more accurately calculating this maximum slope,
especially in the face of optical and electronic noise, etc.

Nevertheless, it seems to me that the assumption that the maximum
slope represents the true edge is at least unmotivated (no matter how
"common sense" it feels) if not wrong.  I have in mind the pictures
of
edge diffraction as produced by using Cornu>s spiral.  The location
of
the true edge, relative to the average intensity of the light area
(smoothing out the diffraction oscillations), looks to be at a
position of increasing slope as you go from dark to light, but NOT
maximum.  Furthermore, the edge is less than the 50% point of peak
light intensity.  (Another assumption sometimes made in image
processing is that the 50% point of the dark to light transistion
represents the edge.)

Does anyone have references they can point to (or their own pesuasive
arguments) that describe where the true edge location should be
relative to the edge image function?  We have done a couple of bench
tests to suggest under the experimental conditions that the best edge
location is about 41% to 46% of the range of the dark to light
transition.  We haven>t yet completed our analysis regarding how this
compares to the peak slope.

This problem has to have been tackled successfully before, but so far
I>ve not found any good sources that address the optical issue, only
software techniques.

Thanks!

Spencer

Actually for a straight knife edge, it is pretty easy to see that for
any translation-invariant linear operator that is reflection-invariant
in the direction along the edge (which, as Aruzinsky points out,
covers a lot of optical ground):

1) the slope is an extremum at the edge position (in the continuum);
and

2) the intensity at the edge position is the average of the intensity
at the extremes (of course, this is not a local measurement).

The basic equation is as follows. Let J be the observed image (in the
continuum); let the knife edge be at point x0; let I1 and I2 be the
intensities for x much less than x0 and x much greater than x0; let
the kernel of the linear operator be G(x, y) (remember it is
translation invariant). Let

H(x) = \int dy G(x, y)

and

L(x) = \int_{-\infty}^{x} dx' H(x') .

Obviously L(-\infty) = 0. Suppose that L(\infty) = 1 (this is just
normalization). Then

J(x) = I1 + (I2 - I1) L(x - x0) .

Note that J does not depend on y, as I did not. Since L(x) = L(-x) by
hypothesis, we have that L(0) = 1/2 and that L''(0) = 0.

illywhacker;- Hide quoted text -

- Show quoted text -
[/quote]
Well, this may take some thinking. Although I>ve worked in machine
vision since 1985, my degree is in physics and my area of expertise is
optics and lighting, not image processing. No doubt what you say is
probably true, but doesn>t this still simply assert that the maximum
slope/gradient of the real physical edge image corresponds to the true
edge location? See my recent reply to Aruzinsky.

On the other hand, maybe I>m just being dense about the whole thing.

Regardless, thanks.

Spencer
Back to top
Science.Medical.Imaging L
Guest






PostPosted: Thu Jul 24, 2008 12:56 am    Post subject: Re: Accurate edge detection? Reply with quote

On Jul 22, 8:59 am, aruzinsky <aruzin...@general-cathexis.com> wrote:
[quote]On Jul 22, 8:04 am, slus...@lw4u.com wrote:



Thank you for your interest and offer to review some sample images.
Unfortunately, our concern is not on the software or algorithmic side,
but on the optical side.  As I mentioned in my original post:

"Does anyone have references they can point to (or their own
pesuasive
arguments) that describe where the true edge location should be
relative to the edge image function?"

I already did.  What is wrong with you?



I also mentioned that I originally posted to sci.optics, then added
sci.image.processing because I thought the folks here might be more
aware of relavent references.  The (apparently) commonly held belief
that the maximum slope of the edge image, or the midpoint between the
maximum and minimum grey level values of the edge image corresponds to
the true edge location seems unmotivated or unsupported to me, even
though it "feels" like common sense.  

That is an algorithm, albeit a really stupid one that is not common
sense, so don>t tell me that you are not interest in algorithms.
Furthermore, that is not a commonly held belief, e.g., it is common
knowledge that shock filters sharpen an edge around the inflection
point (the inflection point is preserved) and nobody, I know of,
pretends that shock filtering is deconvolution.

We have also performed bench
experiments that suggest that neither the max. slope nor the grey
level midpoint corresponds to the true edge, with errors being in the
range of 0.2 to 0.45 pixels in the experimental set up we used.

I hope my tax money didn>t fund that busy work.

 We
are continuing our own investigation, but I have to believe that
someone has already done this at some time and published their
results.  I>d love to find out that our own efforts at inventing the
wheel are unecessary. :-)

I already gave you a reference to a relatively simple algorithm that
might do better than 0.2 pixels.   It would be foolish not to try it.
[/quote]
Aruzinsky,

This is a friendly advice: improve your attitude on the forum if you
want to gain more respect. Even a genius with a bad attitude is worse
than an ignorant person.
Then what you say will come across as more useful information, and you
will not be in a situation to repeat yourself to the original poster.
I am sure none of us here want to know where your tax money is spent,
this is not the place to discuss that. Please stick to the point. All
of us are here to learn and share.. not to boast, or vent off.

By the way, you did not reply to my response on references towards
optical effects that are actually non linear.

Stay cool, it will help you.

Peace!
Back to top
Science.Medical.Imaging L
Guest






PostPosted: Thu Jul 24, 2008 1:02 am    Post subject: Re: Accurate edge detection? Reply with quote

On Jul 23, 2:12 pm, slus...@lw4u.com wrote:
[quote]On Jul 23, 12:01 pm, illywhacker <illywac...@gmail.com> wrote:





On Jul 17, 7:54 pm, slus...@lw4u.com wrote:

I originally posted the following on the sci.optics newsgroup because
it>s more of an optical query.  Nevertheless, the folks here may be
more familiar with the available references and research that>s been
done. Please forgive my statement of some things that will no doubt be
obvious to many here.  (BTW: I also have a description of the
experiments we>ve performed for anyone interested.)

==================================================> > > In the image processing community, there are discussions of edge
detection techniques.  For a simple case, imagine an opaque knife
edge
with a uniform back light behind it. Further imagine there is a lens
that images the knife edge onto a pixel detector of a camera.

In general, the transition from dark to light at the detector is some
smoothly varying function, not a sharp jump.  Diffraction, of course,
limits the ultimate sharpness of the edge image -- diffraction at the
edge itself, and diffraction at the aperture of the lens.
Aberrations
of the lens will also contribute to this edge smoothing.

The digital image as presented *by* the camera may take only a pixel
or two to transition from dark to light, or it might take many more.
Regardless, digitization and pixel size and other factors such as MTF
of the electronics themselves serve to mask the true edge function

A very common starting point in the discussions and papers about edge
detection techniques is the assumption that the point at which the
slope of the edge is maximum represents the "true" edge position.
From then on, the various edge detection algorithms usually present
different methods of more accurately calculating this maximum slope,
especially in the face of optical and electronic noise, etc.

Nevertheless, it seems to me that the assumption that the maximum
slope represents the true edge is at least unmotivated (no matter how
"common sense" it feels) if not wrong.  I have in mind the pictures
of
edge diffraction as produced by using Cornu>s spiral.  The location
of
the true edge, relative to the average intensity of the light area
(smoothing out the diffraction oscillations), looks to be at a
position of increasing slope as you go from dark to light, but NOT
maximum.  Furthermore, the edge is less than the 50% point of peak
light intensity.  (Another assumption sometimes made in image
processing is that the 50% point of the dark to light transistion
represents the edge.)

Does anyone have references they can point to (or their own pesuasive
arguments) that describe where the true edge location should be
relative to the edge image function?  We have done a couple of bench
tests to suggest under the experimental conditions that the best edge
location is about 41% to 46% of the range of the dark to light
transition.  We haven>t yet completed our analysis regarding how this
compares to the peak slope.

This problem has to have been tackled successfully before, but so far
I>ve not found any good sources that address the optical issue, only
software techniques.

Thanks!

Spencer

Actually for a straight knife edge, it is pretty easy to see that for
any translation-invariant linear operator that is reflection-invariant
in the direction along the edge (which, as Aruzinsky points out,
covers a lot of optical ground):

1) the slope is an extremum at the edge position (in the continuum);
and

2) the intensity at the edge position is the average of the intensity
at the extremes (of course, this is not a local measurement).

The basic equation is as follows. Let J be the observed image (in the
continuum); let the knife edge be at point x0; let I1 and I2 be the
intensities for x much less than x0 and x much greater than x0; let
the kernel of the linear operator be G(x, y) (remember it is
translation invariant). Let

H(x) = \int dy G(x, y)

and

L(x) = \int_{-\infty}^{x} dx' H(x') .

Obviously L(-\infty) = 0. Suppose that L(\infty) = 1 (this is just
normalization). Then

J(x) = I1 + (I2 - I1) L(x - x0) .

Note that J does not depend on y, as I did not. Since L(x) = L(-x) by
hypothesis, we have that L(0) = 1/2 and that L''(0) = 0.

illywhacker;- Hide quoted text -

- Show quoted text -

Well, this may take some thinking. Although I>ve worked in machine
vision since 1985, my degree is in physics and my area of expertise is
optics and lighting, not image processing.  No doubt what you say is
probably true, but doesn>t this still simply assert that the maximum
slope/gradient of the real physical edge image corresponds to the true
edge location?  See my recent reply to Aruzinsky.

On the other hand, maybe I>m just being dense about the whole thing.

Regardless, thanks.

Spencer- Hide quoted text -

- Show quoted text -
[/quote]
Spencer,

I commend your repeated efforts to explain the doubts you have. This
is a part of learning process, and I salute you!
Please dont take offense by any objectionable posts. The purpose of
this forum is to share and learn, not to make someone feel bad if they
didnt know something and asked around.
That is not the way to encourage learning. If everybody just blindly
followed someone>s inflated advice, there would be no innovation. Your
honesty about the problem is commendable.

Keep it up!
Back to top
Andrew_M
Guest






PostPosted: Thu Jul 24, 2008 4:11 am    Post subject: Re: Accurate edge detection? Reply with quote

[quote]Hmm. I appear to have offended you.  If it was because I had not yet
acknowledged your reply to my query, I apologize.  I was, in fact,
digesting your comments as well as the two references you provided. I
was also reading what I found upon looking up "edge interpolation" as
you suggested.  In the meantime, Andrew offered a suggestion that I
was more easily and quickly able to address, which included my
referring back to, and quoting my original post. You may have
interpreted that as my ignoring your suggestions.

Regarding your references, I believe I can see the point(s) you are
making, but I also don>t see the relavence to the *physics* of
correlating the image of an edge to the location of the real edge. We
might be talking past each other here, much as the Americans and Brits
are separated by a common language. :-)

Let>s ignore pixels for a moment, and pretend we can sample the image
of a back lit knife edge with infinite resolution, casting God>s eye
upon the screen on which the light eventualy falls. Are you familiar
with Fresnel diffraction at an edge? When one looks at a plot of
intensity of the light around the "shadow" zone, one sees there is
light in the region that would otherwise be forbidden if there was no
diffraction.  One also sees that "past" the edge, the light intensity
climbs, reaches a peak, then oscillates in a decaying fashion,
eventually reaching a uniform intensity.

If you look closely at this plot, we see that the point on the light
intensity curve that in fact corresponds to the true location of the
knife edge is of an increasing slope, but is neither the maximum slope
(gradient), nor an inflection point, nor, generally speaking, is it
midway between the minimum light level and the average high light
level, much less the peak.  Thus, edge finding techniques that depend
in some fashion on maximum slope or gradient (Sobel, Canny ,etc.) or
50% threshold level, would not find the point on this edge image that
corresponds to the position of the true physical edge. Of course this
is just a start.  The edge image is further complicated by the many
other phenomena that occur when using lenses to place the image onto a
pixel detector.

[/quote]
Well, that' just same thing what me (and Mr. Aruzinsky too) trying to
explain. He is telling same thing as me, may be using slightly
different words. What d>you get as a result of diffraction is in fact
a convolution, what could be described by an linear transform. This
transform is not revertible, so the main trick is to find such a
source image, which after this transform will be like your scanned
photo. It is not a simple tecnique, known as "regularization". Using
simple words, you must to predetermine class of possible source
images. For example, two color images with more or less smooth edges.
Sample is the text- you have a photo of a page of some book, obtained
with low resolution camera (BTW, it might be done using long waves-
and diffraction will make nice mess from the source text) and trying
to restore hardly visible letters. But you know, that this page
contents not a random set of colored dots, and this fact can be an aid
for you. It>llbe too long story to explain this technique, and I>n
afraid I cannot name you Englich publishing concerning this method.
Can you make set of photos of some test objects with known structure?
Using them you may to get an idea about what transform occures with
your objects and use this info to restore them
Back to top
Guest







PostPosted: Thu Jul 24, 2008 4:17 am    Post subject: Re: Accurate edge detection? Reply with quote

On Jul 23, 9:02 pm, "Science.Medical.Imaging List"
<pixel.to.l...@gmail.com> wrote:
[quote]On Jul 23, 2:12 pm, slus...@lw4u.com wrote:





On Jul 23, 12:01 pm, illywhacker <illywac...@gmail.com> wrote:

On Jul 17, 7:54 pm, slus...@lw4u.com wrote:

I originally posted the following on the sci.optics newsgroup because
it>s more of an optical query.  Nevertheless, the folks here may be
more familiar with the available references and research that>s been
done. Please forgive my statement of some things that will no doubt be
obvious to many here.  (BTW: I also have a description of the
experiments we>ve performed for anyone interested.)

==================================================> > > > In the image processing community, there are discussions of edge
detection techniques.  For a simple case, imagine an opaque knife
edge
with a uniform back light behind it. Further imagine there is a lens
that images the knife edge onto a pixel detector of a camera.

In general, the transition from dark to light at the detector is some
smoothly varying function, not a sharp jump.  Diffraction, of course,
limits the ultimate sharpness of the edge image -- diffraction at the
edge itself, and diffraction at the aperture of the lens.
Aberrations
of the lens will also contribute to this edge smoothing.

The digital image as presented *by* the camera may take only a pixel
or two to transition from dark to light, or it might take many more..
Regardless, digitization and pixel size and other factors such as MTF
of the electronics themselves serve to mask the true edge function

A very common starting point in the discussions and papers about edge
detection techniques is the assumption that the point at which the
slope of the edge is maximum represents the "true" edge position.
From then on, the various edge detection algorithms usually present
different methods of more accurately calculating this maximum slope,
especially in the face of optical and electronic noise, etc.

Nevertheless, it seems to me that the assumption that the maximum
slope represents the true edge is at least unmotivated (no matter how
"common sense" it feels) if not wrong.  I have in mind the pictures
of
edge diffraction as produced by using Cornu>s spiral.  The location
of
the true edge, relative to the average intensity of the light area
(smoothing out the diffraction oscillations), looks to be at a
position of increasing slope as you go from dark to light, but NOT
maximum.  Furthermore, the edge is less than the 50% point of peak
light intensity.  (Another assumption sometimes made in image
processing is that the 50% point of the dark to light transistion
represents the edge.)

Does anyone have references they can point to (or their own pesuasive
arguments) that describe where the true edge location should be
relative to the edge image function?  We have done a couple of bench
tests to suggest under the experimental conditions that the best edge
location is about 41% to 46% of the range of the dark to light
transition.  We haven>t yet completed our analysis regarding how this
compares to the peak slope.

This problem has to have been tackled successfully before, but so far
I>ve not found any good sources that address the optical issue, only
software techniques.

Thanks!

Spencer

Actually for a straight knife edge, it is pretty easy to see that for
any translation-invariant linear operator that is reflection-invariant
in the direction along the edge (which, as Aruzinsky points out,
covers a lot of optical ground):

1) the slope is an extremum at the edge position (in the continuum);
and

2) the intensity at the edge position is the average of the intensity
at the extremes (of course, this is not a local measurement).

The basic equation is as follows. Let J be the observed image (in the
continuum); let the knife edge be at point x0; let I1 and I2 be the
intensities for x much less than x0 and x much greater than x0; let
the kernel of the linear operator be G(x, y) (remember it is
translation invariant). Let

H(x) = \int dy G(x, y)

and

L(x) = \int_{-\infty}^{x} dx' H(x') .

Obviously L(-\infty) = 0. Suppose that L(\infty) = 1 (this is just
normalization). Then

J(x) = I1 + (I2 - I1) L(x - x0) .

Note that J does not depend on y, as I did not. Since L(x) = L(-x) by
hypothesis, we have that L(0) = 1/2 and that L''(0) = 0.

illywhacker;- Hide quoted text -

- Show quoted text -

Well, this may take some thinking. Although I>ve worked in machine
vision since 1985, my degree is in physics and my area of expertise is
optics and lighting, not image processing.  No doubt what you say is
probably true, but doesn>t this still simply assert that the maximum
slope/gradient of the real physical edge image corresponds to the true
edge location?  See my recent reply to Aruzinsky.

On the other hand, maybe I>m just being dense about the whole thing.

Regardless, thanks.

Spencer- Hide quoted text -

- Show quoted text -

Spencer,

I commend your repeated efforts to explain the doubts you have. This
is a part of learning process, and I salute you!
Please dont take offense by any objectionable posts. The purpose of
this forum is to share and learn, not to make someone feel bad if they
didnt know something and asked around.
That is not the way to encourage learning. If everybody just blindly
followed someone>s inflated advice, there would be no innovation. Your
honesty about the problem is commendable.

Keep it up!- Hide quoted text -

- Show quoted text -
[/quote]
Thanks very much! I appreciate it. I>m aware of the range of
personalities to be found on the web and use a reasonable set of
mental filters. Life is too short to get in a huff very often.

Your own attitude resonates with mine, and I find for the most part
that the golden rule works well. Thanks again.

Spencer
Back to top
Martin Brown
Guest






PostPosted: Thu Jul 24, 2008 2:43 pm    Post subject: Re: Accurate edge detection? Reply with quote

aruzinsky wrote:
[quote]On Jul 23, 3:16 am, Martin Brown <|||newspam...@nezumi.demon.co.uk
wrote:
aruzinsky wrote:

I was suggesting that, but I am not knowledgeable of every possible
optical effect. Name one optical effect that can>t be represented by
a linear transformation.

The most common ones that break modern deconvolution codes are a point
spread function that is not position invariant.
The is the imaging
system has off axis abberations (most real diffraction limited optics
suffer some degradation as you go off axis).

That is still a linear transformation, as I previously mentioned for
[/quote]
You are using "linear" in a way that is non-standard in the image
processing community. The conventional definition is that in a linear
transform the measured image is the strict convolution of a position
invarinant point spread function and an unknown target image.

Edge effects on modern optical scopes produce some level of coma so that
the stars images are not circularly symmetric off axis.

v

[quote] .
[/quote]
^

Typically they develop gull wings as you go significantly off axis.

[quote]the case of the bad Hubble telescope lens. And, that problem was
tractable. In fact, many common deconvolution methods work directly
in the spatial domain (no FFTs allowed) can be modified for this
problem.
[/quote]
The most powerful ones almost invariably work in the Fourier domain. You
need a fairly compact psf to work in the spatial domain and still get
acceptable performance. Diffraction limited cicular telescope optics
ring from unresolved stars with a characteristic Airey rings pattern.
Off axis it becomes more messy.

Hubble researchers found the residual spatial variation of the psf a
real problem in high dynamic range images.

http://adsabs.harvard.edu/abs/1994SPIE.2198.1349H

There is a solution but it involves a lot more computation
[quote]
And the real killer in the general photography situation is depth of
field. You can model the psf for a given subject distance, but when
different parts of the same image are all at different unknown distances
you have a pretty much intractable problem. Or one that is only
resolvable with binocular pairs of images and insane amounts of
computing power.

It might be killer intractable, but I think it is linear.
[/quote]
Again you are using linear in a nonstandard way. It is linear in the
sense that each pixel is the result of summation of the scene blurred
with an appropriate psf for the object distance in every direction.

But that is not what is normally meant when linear is used in the
context of image processing. The meaning is usually taken to be:

D = P * T

Where D is measured data, * is convolution,
P is a spatially invariant psf and T is the target image.
[quote]
If the OP wants specifically to find sharp edges with the utmost
precision and doesn>t care about the computational cost then one of the
Bayesian methods using all available prior knowledge will probably give
the optimum result. This reference is a bit old but is a start:

http://adsabs.harvard.edu/abs/1980ITAC...25...36M

There seem to be few papers on this application which suggests to me
that it doesn>t work well enough to be worth the computational cost.

Regards,
Martin Brown
** Posted fromhttp://www.teranews.com**- Hide quoted text -

- Show quoted text -

Don>t forget that "optimal result" is with respect to some statistical
cost function and some individual cases of estimated edge location can
be grossly inaccurate.
[/quote]
The question that you ask of the data determines the answer that you
get. If you ask the wrong question then all bets are off.

Regards,
Martin Brown
** Posted from http://www.teranews.com **
Back to top
aruzinsky
Guest






PostPosted: Thu Jul 24, 2008 3:27 pm    Post subject: Re: Accurate edge detection? Reply with quote

On Jul 24, 3:43 am, Martin Brown <|||newspam...@nezumi.demon.co.uk>
wrote:
[quote]aruzinsky wrote:
On Jul 23, 3:16 am, Martin Brown <|||newspam...@nezumi.demon.co.uk
wrote:
aruzinsky wrote:
I was suggesting that, but I am not knowledgeable of every possible
optical effect.  Name one optical effect that can>t be represented by
a linear transformation.
The most common ones that break modern deconvolution codes are a point
spread function that is not position invariant.
The is the imaging
system has off axis abberations (most real diffraction limited optics
suffer some degradation as you go off axis).

That is still a linear transformation, as I previously mentioned for

You are using "linear" in a way that is non-standard in the image
processing community. The conventional definition is that in a linear
transform the measured image is the strict convolution of a position
invarinant point spread function and an unknown target image.

Edge effects on modern optical scopes produce some level of coma so that
the stars images are not circularly symmetric off axis.

         v

 >   .      

        ^

Typically they develop gull wings as you go significantly off axis.

the case of the bad Hubble telescope lens.  And, that problem was
tractable.  In fact, many common deconvolution methods work directly
in the spatial domain (no FFTs allowed) can be modified for this
problem.

The most powerful ones almost invariably work in the Fourier domain. You
need a fairly compact psf to work in the spatial domain and still get
acceptable performance. Diffraction limited cicular telescope optics
ring from unresolved stars with a characteristic Airey rings pattern.
Off axis it becomes more messy.

Hubble researchers found the residual spatial variation of the psf a
real problem in high dynamic range images.

http://adsabs.harvard.edu/abs/1994SPIE.2198.1349H

There is a solution but it involves a lot more computation



And the real killer in the general photography situation is depth of
field. You can model the psf for a given subject distance, but when
different parts of the same image are all at different unknown distances
you have a pretty much intractable problem. Or one that is only
resolvable with binocular pairs of images and insane amounts of
computing power.

It might be killer intractable, but I think it is linear.

Again you are using linear in a nonstandard way. It is linear in the
sense that each pixel is the result of summation of the scene blurred
with an appropriate psf for the object distance in every direction.

But that is not what is normally meant when linear is used in the
context of image processing. The meaning is usually taken to be:

D = P * T

Where D is measured data, * is convolution,
P is a spatially invariant psf and T is the target image.







If the OP wants specifically to find sharp edges with the utmost
precision and doesn>t care about the computational cost then one of the
Bayesian methods using all available prior knowledge will probably give
the optimum result. This reference is a bit old but is a start:

http://adsabs.harvard.edu/abs/1980ITAC...25...36M

There seem to be few papers on this application which suggests to me
that it doesn>t work well enough to be worth the computational cost.

Regards,
Martin Brown
** Posted fromhttp://www.teranews.com**-Hide quoted text -

- Show quoted text -

Don>t forget that "optimal result" is with respect to some statistical
cost function and some individual cases of estimated edge location can
be grossly inaccurate.

The question that you ask of the data determines the answer that you
get. If you ask the wrong question then all bets are off.

Regards,
Martin Brown
** Posted fromhttp://www.teranews.com**- Hide quoted text -

- Show quoted text -
[/quote]
No. The definition used practically everywhere is:

f() is linear iff

f(a + b) = f(a) + f(b)

and

f(áx) = áf(x)


Convolution with a spatially variant psf is linear because it
satisfies those properties. More specifically, matrix multiplication
is linear

A(a1*x1 + a2*x2) = a1*Ax1 + a2*Ax2

and a discrete spatially variant PSF can always be represented by
matrix A.

Here is a simple 1D example of a constant PSF:

A [
1/2 1/2 0 ... 0 0
0 1/2 1/2 ... 0 0
...
0 0 0 ... 1/2 1/2
]

Here is a simple 1D example of a spatially variant PSF:

A [
1/2 1/2 0 0
0 1/3 1/3 1/3
]
Back to top
aruzinsky
Guest






PostPosted: Thu Jul 24, 2008 4:55 pm    Post subject: Re: Accurate edge detection? Reply with quote

On Jul 23, 2:48 pm, slus...@lw4u.com wrote:
[quote]On Jul 22, 11:59 am, aruzinsky <aruzin...@general-cathexis.com> wrote:





On Jul 22, 8:04 am, slus...@lw4u.com wrote:

Thank you for your interest and offer to review some sample images.
Unfortunately, our concern is not on the software or algorithmic side,
but on the optical side.  As I mentioned in my original post:

"Does anyone have references they can point to (or their own
pesuasive
arguments) that describe where the true edge location should be
relative to the edge image function?"

I already did.  What is wrong with you?

I also mentioned that I originally posted to sci.optics, then added
sci.image.processing because I thought the folks here might be more
aware of relavent references.  The (apparently) commonly held belief
that the maximum slope of the edge image, or the midpoint between the
maximum and minimum grey level values of the edge image corresponds to
the true edge location seems unmotivated or unsupported to me, even
though it "feels" like common sense.  

That is an algorithm, albeit a really stupid one that is not common
sense, so don>t tell me that you are not interest in algorithms.
Furthermore, that is not a commonly held belief, e.g., it is common
knowledge that shock filters sharpen an edge around the inflection
point (the inflection point is preserved) and nobody, I know of,
pretends that shock filtering is deconvolution.

We have also performed bench
experiments that suggest that neither the max. slope nor the grey
level midpoint corresponds to the true edge, with errors being in the
range of 0.2 to 0.45 pixels in the experimental set up we used.

I hope my tax money didn>t fund that busy work.

 We
are continuing our own investigation, but I have to believe that
someone has already done this at some time and published their
results.  I>d love to find out that our own efforts at inventing the
wheel are unecessary. :-)

I already gave you a reference to a relatively simple algorithm that
might do better than 0.2 pixels.   It would be foolish not to try it.

Hmm. I appear to have offended you.  If it was because I had not yet
acknowledged your reply to my query, I apologize.  I was, in fact,
digesting your comments as well as the two references you provided. I
was also reading what I found upon looking up "edge interpolation" as
you suggested.  In the meantime, Andrew offered a suggestion that I
was more easily and quickly able to address, which included my
referring back to, and quoting my original post. You may have
interpreted that as my ignoring your suggestions.

Regarding your references, I believe I can see the point(s) you are
making, but I also don>t see the relavence to the *physics* of
correlating the image of an edge to the location of the real edge. We
might be talking past each other here, much as the Americans and Brits
are separated by a common language. :-)

Let>s ignore pixels for a moment, and pretend we can sample the image
of a back lit knife edge with infinite resolution, casting God>s eye
upon the screen on which the light eventualy falls. Are you familiar
with Fresnel diffraction at an edge? When one looks at a plot of
intensity of the light around the "shadow" zone, one sees there is
light in the region that would otherwise be forbidden if there was no
diffraction.  One also sees that "past" the edge, the light intensity
climbs, reaches a peak, then oscillates in a decaying fashion,
eventually reaching a uniform intensity.

If you look closely at this plot, we see that the point on the light
intensity curve that in fact corresponds to the true location of the
knife edge is of an increasing slope, but is neither the maximum slope
(gradient), nor an inflection point, nor, generally speaking, is it
midway between the minimum light level and the average high light
level, much less the peak.  Thus, edge finding techniques that depend
in some fashion on maximum slope or gradient (Sobel, Canny ,etc.) or
50% threshold level, would not find the point on this edge image that
corresponds to the position of the true physical edge. Of course this
is just a start.  The edge image is further complicated by the many
other phenomena that occur when using lenses to place the image onto a
pixel detector.

My own readings found, in many cases, discussion of edge detection
schemes that do in fact start with the presumption that the maximum
slope or gradient of an edge image should in some way correspond to
the true location of the edge, but with no explanation of why the
author believes this to be so.  My guess is that this is something
that is simply "understood" by those working in the field, and is
passed along from one person to another without question.  It>s
obvious that you hold no such belief, but at the level of my
investigation it *is* common.

As for time spent investigating this, rest assured that this is
strictly a capitalistic venture using private money, snide comments
not withstanding.

It may be of no interest to you, but others might find something
interesting.  I>m cutting and pasting here a brief description of our
experiments that I also orignally posted on sci.optics:

Using a
chrome-on-glass bar target that is measured as 12.503mm long
+/-0.003mm, we grabbed images with a telecentric lens and red LED
collimated back light.  We then used a micrometer stage to move the
target 12.503mm (again, with an error of +/-0.003mm) -- so that the
trailing edge at the new postion corresponds to the leading edge of
the original position.  The direction of motion was perpendicular to
the lens optical axis to within 0.25 degrees.  We then used various
edge detection methods, including the 2nd derivative of the edge with
a fit to a parabola, as well as the simple 50% local thresholding,
among others.  What we found consistently through different positions
in the field of view and different new set-ups is that the trailing
edge appeared to fail to move far enough to coincide with the old
leading edge.  The error range was ~0.2 to 0.45 pixels, or about
0.015mm to 0.034mm in real world units -- always considerably larger
than target and motion error, and alway in the same direction of
error.

Another way to interpret this result is that an object consistently
looks larger than it actually is. (If the bar target appears to be
12.523mm, and you move it 12.503mm, the trailing edge will fail to
"catch" the initial position of the leading edge.)

We>ve tried this with different lens f-numbers from F/45 to F/8 and
did not see an obvious trend that followed the aperture, but on this
front we>ve only made a small number of tests -- 4 at each f-number.
The errors average ~0.3pixels, with the standard deviation ~0.05.

I will also add that we have used two different cameras (AVT Stingray
145b and Sony XC-ST70) out of suspicion that a non-linear responsivity
could be the culprit.  While differing slightly in detail, we saw
essentially the same result.

Spencer- Hide quoted text -

- Show quoted text -
[/quote]


Consider a simple 1D example:

"Knife edge" is a discrete step function x.

x = [ 0 0 0 1 1 1 1 1]T

A [
1/2 1/2 0 0 0 0 0 0
0 0 1/2 1/2 0 0 0 0
0 0 0 0 1/2 1/2 0 0
0 0 0 0 0 0 1/2 1/2
]

A represents convolution with [1/2 1/2] followed by a factor of two
decimation. You can see A is undetermined and not invertible.

Your observed values would be

y = Ax = [ 0 1/2 1 1 ]

In estimating x from y, given A, you have to do something that vaguely
resembles an inversion of A to estimate x' of x.

For example, you can softly constrain the discrete derivatives of x'
to zero.

y' = [ yT 0T ]T

A' = [AT w*BT]T

w is scalar weight

B [
1 -1 0 ... 0 0
0 1 -1 ... 0 0
...
0 0 0 ... 1 -1
]

Now, A' is overdetermined

solve

min || y' - A' x' ||
x'

||.|| is a norm or possibly a function similar to a norm but not
necessarily convex. L2 norm is not recommended because it will cause
oscillations. L1 norm recommended. All of this has a statistical
interpretation which I won>t get into for simplicity.

Your A will have to incorporate a different PSF for diffraction
thingy.
Back to top
Steve Eddins
Guest






PostPosted: Thu Jul 24, 2008 6:02 pm    Post subject: Re: Accurate edge detection? Reply with quote

Martin Brown wrote:
[quote]aruzinsky wrote:
On Jul 23, 3:16 am, Martin Brown <|||newspam...@nezumi.demon.co.uk
wrote:
aruzinsky wrote:

I was suggesting that, but I am not knowledgeable of every possible
optical effect. Name one optical effect that can>t be represented by
a linear transformation.

The most common ones that break modern deconvolution codes are a point
spread function that is not position invariant.
The is the imaging
system has off axis abberations (most real diffraction limited optics
suffer some degradation as you go off axis).

That is still a linear transformation, as I previously mentioned for

You are using "linear" in a way that is non-standard in the image
processing community. The conventional definition is that in a linear
transform the measured image is the strict convolution of a position
invarinant point spread function and an unknown target image.
[/quote]
I don>t agree, Martin. I suppose that the terminology convention you
suggest may be the case for some backgrounds, but certainly not all. I
come to image processing from an undergraduate background in electrical
engineering, followed by a course of graduate study in digital signal
and image processing. From undergraduate courses in signals and
systems, communications, and control theory, through graduate courses in
Fourier theory, signal processing, spectral analysis, etc., a crystal
clear and consistent distinction was made between a linear system and a
time-invariant (or shift-invariant) system. Systems satisfying both
properties were almost universally referred to as LTI (linear
time-invariant) or LSI (linear shift-invariant) systems. As students,
our ability to correctly classify systems by both of these properties
was frequently tested by homework assignments and exams. :-) And when
I was an electrical engineer professor, I carefully taught the
distinction myself.

Although I am not an expert in the image restoration research
literature, I have the impression that the distinction between systems
that are linear shift-varying and that are linear shift-invariant is
very important one in that field, not to be glossed over.

I do see the term "linear" used sometimes to describe LSI systems,
typically in a discussion of spatial-domain convolution or
frequency-domain multiplication. It is usually clear from the context
that "linear" is being used as shorthand for LSI, and I generally make
that substitute mentally as I read.

---
Steve Eddins
http://blogs.mathworks.com/steve/
Back to top
Guest







PostPosted: Thu Jul 24, 2008 9:04 pm    Post subject: Re: Accurate edge detection? Reply with quote

On Jul 24, 12:55 pm, aruzinsky <aruzin...@general-cathexis.com> wrote:
[quote]On Jul 23, 2:48 pm, slus...@lw4u.com wrote:





On Jul 22, 11:59 am, aruzinsky <aruzin...@general-cathexis.com> wrote:

On Jul 22, 8:04 am, slus...@lw4u.com wrote:

Thank you for your interest and offer to review some sample images.
Unfortunately, our concern is not on the software or algorithmic side,
but on the optical side.  As I mentioned in my original post:

"Does anyone have references they can point to (or their own
pesuasive
arguments) that describe where the true edge location should be
relative to the edge image function?"

I already did.  What is wrong with you?

I also mentioned that I originally posted to sci.optics, then added
sci.image.processing because I thought the folks here might be more
aware of relavent references.  The (apparently) commonly held belief
that the maximum slope of the edge image, or the midpoint between the
maximum and minimum grey level values of the edge image corresponds to
the true edge location seems unmotivated or unsupported to me, even
though it "feels" like common sense.  

That is an algorithm, albeit a really stupid one that is not common
sense, so don>t tell me that you are not interest in algorithms.
Furthermore, that is not a commonly held belief, e.g., it is common
knowledge that shock filters sharpen an edge around the inflection
point (the inflection point is preserved) and nobody, I know of,
pretends that shock filtering is deconvolution.

We have also performed bench
experiments that suggest that neither the max. slope nor the grey
level midpoint corresponds to the true edge, with errors being in the
range of 0.2 to 0.45 pixels in the experimental set up we used.

I hope my tax money didn>t fund that busy work.

 We
are continuing our own investigation, but I have to believe that
someone has already done this at some time and published their
results.  I>d love to find out that our own efforts at inventing the
wheel are unecessary. :-)

I already gave you a reference to a relatively simple algorithm that
might do better than 0.2 pixels.   It would be foolish not to try it.

Hmm. I appear to have offended you.  If it was because I had not yet
acknowledged your reply to my query, I apologize.  I was, in fact,
digesting your comments as well as the two references you provided. I
was also reading what I found upon looking up "edge interpolation" as
you suggested.  In the meantime, Andrew offered a suggestion that I
was more easily and quickly able to address, which included my
referring back to, and quoting my original post. You may have
interpreted that as my ignoring your suggestions.

Regarding your references, I believe I can see the point(s) you are
making, but I also don>t see the relavence to the *physics* of
correlating the image of an edge to the location of the real edge. We
might be talking past each other here, much as the Americans and Brits
are separated by a common language. :-)

Let>s ignore pixels for a moment, and pretend we can sample the image
of a back lit knife edge with infinite resolution, casting God>s eye
upon the screen on which the light eventualy falls. Are you familiar
with Fresnel diffraction at an edge? When one looks at a plot of
intensity of the light around the "shadow" zone, one sees there is
light in the region that would otherwise be forbidden if there was no
diffraction.  One also sees that "past" the edge, the light intensity
climbs, reaches a peak, then oscillates in a decaying fashion,
eventually reaching a uniform intensity.

If you look closely at this plot, we see that the point on the light
intensity curve that in fact corresponds to the true location of the
knife edge is of an increasing slope, but is neither the maximum slope
(gradient), nor an inflection point, nor, generally speaking, is it
midway between the minimum light level and the average high light
level, much less the peak.  Thus, edge finding techniques that depend
in some fashion on maximum slope or gradient (Sobel, Canny ,etc.) or
50% threshold level, would not find the point on this edge image that
corresponds to the position of the true physical edge. Of course this
is just a start.  The edge image is further complicated by the many
other phenomena that occur when using lenses to place the image onto a
pixel detector.

My own readings found, in many cases, discussion of edge detection
schemes that do in fact start with the presumption that the maximum
slope or gradient of an edge image should in some way correspond to
the true location of the edge, but with no explanation of why the
author believes this to be so.  My guess is that this is something
that is simply "understood" by those working in