1) Is it a necessary requirement to center the image at the
center of
gravity rather than the geometric center in order to reconstruct an
image from its moments? I have seen implementations where the midpoint
of the image is taken as the origin, but my attempts at implementation
show better results when I use the center of gravity.
2) Is it necessary to use all the points within a disk to perform
reconstruction? That is, can I analyze an image that is inscribed in a
circle and ignore the points that are in the circle but not in the
image rectangle. If the answer is that a full disk must be used, are
the results affected if I pad the image with zeros to fill the circle,
or must I inscribe a circle within the image rectangle.
3) My reconstructions, using gray scale images produce values
that are
very much outside of the range [0 1], e.g., [ -85 2645]. Is this
normal? Is there a scaling operation that should be performed to
normalize the image during reconstruction? The big numbers are
somewhat associated with the outer edge of the disk.
4) I find that up to about n = 30 to 35 moments, the
reconstruction is
pretty good. However at higher levels (n=40), I see a loss of contrast
and ringing in the image. Is this usual? There is no mention of this
that I find in the literature.
Why are you trying to do this? My experience with moments in general
is that they are extremely numerically unstable. I even avoid using
them as image features.
I am trying to reproduce a template matching algorithm that I read in
a recent paper. Zernike moments are rotationally invariant so the
authors use them to choose final match candidates.
I wanted to see if the method was any good, but I wanted to check my
calculations of the ZMs by reconstructing the image and I have been
banging my head against the wall. That's why I asked these questions;
I wanted to see if I am at least implementing the reconstruction
properly.
In the end, the ZMs are computationally expensive, but I still would
like to know if I am doing things correctly.
Answers to your questions:
1) I believe you can use any point as the origin of the Zernike
decomposition. The quality of the reconstruction will depend on this
choice and how well the Zernike moments happen to describe/fit the
data using the selected origin. This origin sensitivty is one of the
main drawbacks with using them.
2) Best to inscribe the circle within the image rectangle. The higher
order moments will be quite sensitive to zero padding.
3) In theory, you should not have to normalise the image data for the
decomposition to work. However, you may find that you are
encountering numerical problems
with the higher order moments, in which case its rarely a bad idea to
normalise your data to also be in the range [-1..1].
4) I would expect some mild ringing effects by the time you get to
N=40. But coupled with a loss of contrast it may signify a numerical
problem.
Regards
Jason Dale
www.visionexperts.co.uk