Question

Please Can anyone tell me what happen when i erode an image with a structure element(SE) that has zero center example [0 0 1].Because i learned that erosion is the intersection of all placement of an image (A0 Intersect A1 ..An) and because the center is zero => A0 is Phi which means the erosion will be nothing (black image) which is reasonable. but when i tried it on matlab it gives me the same image (rectangle) but it shifted one pixel to the left which is (A1). This means that it considered A0 as U =>U(whole universe) Intesect A1=>A1. Can any one explain why does that happened? and is matlab result true or does it gives error result when putting the center of SE zero because it is not logical. Thanks.

Was it helpful?

Solution

The Matlab result is correct. Imagine you have an image with one single white pixel in the center:

 I:     0 0 1 0 0

Now, imagine all placements of the SE under the image:

 I:     0 0 1 0 0
SE:   0 0 1

For this pixel, all the '1' pixels in the SE are placed under '0' pixels in the image I, so the result for this placement is 0. The center of the SE is under the first pixel, so the first pixel in the output image is 0.

 I:     0 0 1 0 0
SE:     0 0 1

Now the center of the SE is under the second pixel. All '1' pixels in the SE are placed under '1' pixels in the source image, so this pixel will be '1' in the output image. So in the end, the output image will look like this:

 I:     0 0 1 0 0
 O:     0 1 0 0 0

Which is just what Matlab does.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top