MORPH_XYZ and values keyword [message #35527] |
Tue, 24 June 2003 14:00  |
btt
Messages: 345 Registered: December 2000
|
Senior Member |
|
|
Hello,
I completely mystified by the VALUES keyword to the MORPH_XYZ (like
MORPH_TOPHAT) routines. I think I understand the meaning of VALUES for
DILATE and ERODE-like routines - but I can't make sense of the MORPH_XYZ
routines.
Here's the description of the so-called structuring element that these
rotuine accept...it gives the shape and 'on-off'-ness of each pixel.
A one-, two-, or three-dimensional array to be used as the structuring
element. The elements are interpreted as binary values � either zero or
nonzero. The structuring element must have the same number of dimensions
as the Image argument.
Now here's the decription of the VALUES keyword...
An array of the same dimensions as the Structure argument providing the
values of the structuring element. If the VALUES keyword is not present,
all elements of the structuring element are 0.
What the heck does that mean?
I thought providing the VALUES was like
providing a weighting to the structuring element.
Here's an example using the MORPH_TOPHAT routine... if here's a
structure with a narrow brim - any peaks detected that fit within the 1s
is a keeper.
0 0 0 1 0 0 0
0 1 1 1 1 1 0
0 1 1 1 1 1 0
1 1 1 1 1 1 1
0 1 1 1 1 1 0
0 1 1 1 1 1 0
0 0 0 1 0 0 0
Now if I am working with a grayscale image... I want to make sure the
peak is tall (bright) enough so, I weight the structuring element with
some kind of a height - like I want the peak to be at least 5 whatevers
above the brim values. So I set VALUES equal to...
0 0 0 5 0 0 0
0 5 5 5 5 5 0
0 5 5 5 5 5 0
5 5 5 5 5 5 5
0 5 5 5 5 5 0
0 5 5 5 5 5 0
0 0 0 5 0 0 0
I can't see any difference between the results when I do and do not
provide the VALUES. Which, of course, means I don't understand it at all.
Stumped and grateful for any help,
Ben
|
|
|