Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does eroding / dilating image with zeros structuring element cause (-)Inf value?

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.

like image 665
Xitrum Avatar asked Jan 01 '13 13:01

Xitrum


People also ask

What is effect of erosion on image?

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.

What is image erosion in image processing?

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.

What is erosion and dilation in OpenCV?

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.

How can a boundary of an image be calculated by using erosion?

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)


1 Answers

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.

like image 95
Eitan T Avatar answered Nov 04 '22 09:11

Eitan T