I use imerode and imdilate in matlab with image m
0 0 0
0 1 0
0 0 0
and structuring element f
0
the result for using imerode is
inf inf inf
inf inf inf
inf inf inf
and for imdilate is
-inf -inf -inf
-inf -inf -inf
-inf -inf -inf
Can someone explain it to me?
Thank you very much.
Dilation adds pixels to the boundaries of objects in an image, while erosion removes pixels on object boundaries. The number of pixels added or removed from the objects in an image depends on the size and shape of the structuring element used to process the image.
Erosion removes pixels on object boundaries. In other words, it shrinks the foreground objects. Enlarge foreground holes. Like in Image Processing Kernels, a larger size of the Structure Element, the effect of Erosion increase.
Erosion and Dilation are morphological image processing operations. OpenCV morphological image processing is a procedure for modifying the geometric structure in the image. In morphism, we find the shape and size or structure of an object.
The state of a pixel in output image can be determined by applying the imperative in output pixel's value is the least of all the input pixel's neighbourhood. It can be given by the following equation: Erosion= {Z/ (B) z⊆A} (3) Image Boundary= Original image -Eroded image (4)
This artifact happens when applying the structuring element on a non-existent value (for example, it may occur at the borders, or in your case by using a 1x1 structuring element that excludes the center).
In such cases, MATLAB's imerode
and imdilate
yield -Inf
and Inf
, respectively.
You can read more here for a clarification of this phenomenon.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With