From: Vassilis on
Suppose we have a binary image A with dimensions NxM and Q pixels of value 1 where Q<N^2. Suppose again that we have a simple SE, denoted by B where B=true(1,3).

the question is:
in order to dilate, erode or apply rank order, is the B moving and "sitting" over each pixel of A?
if yes, which is the reason to put B "over" an OFF pixel of A during erosion?
or "over" an ON pixel during dilation?

If no, how are the pixels (to put B "over" them) selected?
And if there is a way to select these pixels, is this taken under consideration during rank order filter with r=1 (dilation) or r=3 (erosion)?
From: ImageAnalyst on
On May 1, 4:01 pm, "Vassilis " <vp...(a)ilsp.gr> wrote:
> Suppose we have a binary image A with dimensions NxM and Q  pixels of value 1 where Q<N^2.  Suppose again that we have a simple SE, denoted by B where B=true(1,3).
>
> the question is:
> in order to dilate, erode or apply rank order, is the B moving and "sitting" over each pixel of A?
> if yes, which is the reason to put B "over" an OFF pixel of A during erosion?
> or "over" an ON pixel during dilation?
>
> If no, how are the pixels (to put B "over" them) selected?
> And if there is a way to select these pixels, is this taken under consideration during rank order filter with r=1 (dilation) or r=3 (erosion)?

----------------------------------------------------------------------
"Q<N^2" -- Do you mean Q<N*M instead?
"is the B moving and "sitting" over each pixel of A"? - essentially
yes. You move it and park it over a 3 pixel chunk, and then do the
operation, and then move on to the next pixel, and so on.

"which is the reason to put B "over" an OFF pixel of A during erosion?
or "over" an ON pixel during dilation?" Not sure what you mean here.
Do you mean "what" is the reason, because which implies that I've been
given a list of reasons to choose from. Even so (with "what") I don't
understand. The reason is simply: because that's how it works! You
have to scan your A image with your B structuring element - that's
simply how it works.

I don't understand your "no" option either but since the answer is not
"no" I didn't try very hard since it doesn't apply.

By the way, gray scale morphology can have a rank filter. If the
input is a binary image, essentially all ranks are either the highest
(max) or the lowest (min) since you have only TWO values in your
image.

Hope this helps.
ImageAnalyst
From: Vassilis on
ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <ad6b17ec-5cf9-4716-8060-bea7386ee24f(a)j15g2000vbq.googlegroups.com>...
> On May 1, 4:01 pm, "Vassilis " <vp...(a)ilsp.gr> wrote:
> > Suppose we have a binary image A with dimensions NxM and Q  pixels of value 1 where Q<N^2.  Suppose again that we have a simple SE, denoted by B where B=true(1,3).
> >
> > the question is:
> > in order to dilate, erode or apply rank order, is the B moving and "sitting" over each pixel of A?
> > if yes, which is the reason to put B "over" an OFF pixel of A during erosion?
> > or "over" an ON pixel during dilation?
> >
> > If no, how are the pixels (to put B "over" them) selected?
> > And if there is a way to select these pixels, is this taken under consideration during rank order filter with r=1 (dilation) or r=3 (erosion)?
>
> ----------------------------------------------------------------------
> "Q<N^2" -- Do you mean Q<N*M instead?
> "is the B moving and "sitting" over each pixel of A"? - essentially
> yes. You move it and park it over a 3 pixel chunk, and then do the
> operation, and then move on to the next pixel, and so on.
>
> "which is the reason to put B "over" an OFF pixel of A during erosion?
> or "over" an ON pixel during dilation?" Not sure what you mean here.
> Do you mean "what" is the reason, because which implies that I've been
> given a list of reasons to choose from. Even so (with "what") I don't
> understand. The reason is simply: because that's how it works! You
> have to scan your A image with your B structuring element - that's
> simply how it works.
>
> I don't understand your "no" option either but since the answer is not
> "no" I didn't try very hard since it doesn't apply.
>
> By the way, gray scale morphology can have a rank filter. If the
> input is a binary image, essentially all ranks are either the highest
> (max) or the lowest (min) since you have only TWO values in your
> image.
>
> Hope this helps.
> ImageAnalyst


thanks for reply.
1) yes the right number is &#925;*&#924;

2) Suppose we want to erode A by B and we know that the center pixel of B is 1. Every time that B is parked over an OFF pixel of A, and the answer is 0, isn't it? So, why do we have to park B over OFF pixels of A?
If Q=5 and N*M=20, which is the faster way?
a) find the positions of ON pixels of A and park B only over them
b) park B over all pixels of A
I wonder if both have the same complexity.
From: ImageAnalyst on
Your #1 didn't come through.

For #2 - no that's not right. If B is parked over a zero of A the
result could still be either 0 or 1 depending on the other pixels
are. For example if
B = [ 1 1 1 ], and A (your image) = [ 1 0 0] then the center point of
B is positioned over a zero of A but because the max (we're talking
dilation here) in the window is 1, the result is also 1.

2a) And how do you propose to do that? You mean by visiting and
checking every single pixel of A? Well what do you think imdilate
does? It visits every pixel in A. So if you're going to visit every
pixel in A to see if it's a 1, you might as well just get your answer
at the same time.

2b) This is the way to do it, for the reason I gave in 2a.
From: Vassilis on
ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <d92362a9-d598-4fab-9a84-faec9ca1a420(a)x1g2000vbe.googlegroups.com>...
> Your #1 didn't come through.
>
> For #2 - no that's not right. If B is parked over a zero of A the
> result could still be either 0 or 1 depending on the other pixels
> are. For example if
> B = [ 1 1 1 ], and A (your image) = [ 1 0 0] then the center point of
> B is positioned over a zero of A but because the max (we're talking
> dilation here) in the window is 1, the result is also 1.
>
> 2a) And how do you propose to do that? You mean by visiting and
> checking every single pixel of A? Well what do you think imdilate
> does? It visits every pixel in A. So if you're going to visit every
> pixel in A to see if it's a 1, you might as well just get your answer
> at the same time.
>
> 2b) This is the way to do it, for the reason I gave in 2a.

I think I am not clear. I will try to be clear by using the following example:
B=[1 1 1] A=[1 0 0 0 0 0 0 0 0].
C is the EROSION of A by B.
a) Knowning that the result of erosion (C) is a subset of the original image (A), we initiate C, as C=false(size(A)).
b) [x y]= find(A==1);
c) for jj=1:length(x)
park B over A(x(jj),y(jj))
get the min in the window
end
I wonder if imerode on binary images works like this way.