Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

erosion and dilation in signal processing

Asked by Annapoorani on 4 Feb 2012
Latest activity Commented on by Image Analyst on 22 Aug 2014 at 17:09

we need codes for erosion and dilation in signal processing...as imdilate and imerode functions can only be used in image processing..

0 Comments

Annapoorani

Tags

2 Answers

Answer by Image Analyst on 4 Feb 2012
Accepted answer

They can be used for 1D signals, if you have the Image Processing Toolbox. Do you have that toolbox? If not, you might play around with this approach:

windowSize = 3;
originalSignal = rand(10,1)
hank = hankel(originalSignal)
h3 = hank(:,1:windowSize)
dilatedSignal = max(h3, [], 2)

7 Comments

Annapoorani on 6 Feb 2012

ya no is for the toolbox,sorry abt tat... mm thanks for answering,i wil try it and let yo know

Annapoorani on 8 Feb 2012

we tried imdilate got the answer but imgage is not displaying,it comin as image too large to fit on screen.so what should we do to view the dilated image

Image Analyst on 22 Aug 2014 at 17:09

If you don't have the Image Processing Toolbox, then how did you try imdilate()?

Image Analyst
Answer by shelley on 22 Aug 2014 at 16:34

Yes, it is doable. It is better to binarize the signal first, and then use the command like

sel=strel('line',120,90);

%the length 120 depends on how big the gap you want to close/seal.

%the degree 90 or 0 depends on your 1D signal is in vector or row format;

results=imdilate(1Dsig,sel);

0 Comments

shelley

Contact us