erosion and dilation in signal processing

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

 採用された回答

Image Analyst
Image Analyst 2012 年 2 月 4 日

0 投票

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)

9 件のコメント

Annapoorani
Annapoorani 2012 年 2 月 4 日
no..can we do it for ECG signal?
Image Analyst
Image Analyst 2012 年 2 月 4 日
Why do you say "no"? Why shouldn't you be able to do it for an ECG signal. The procedures don't care what the signal is - they're all just a bunch of arbitrary numbers as far as they're concerned.
Walter Roberson
Walter Roberson 2012 年 2 月 4 日
I think the "no" might be for "Do you have that toolbox?"
Image Analyst
Image Analyst 2012 年 2 月 4 日
Oh, right, probably so. The hankel though is in base MATLAB and with a little modification of the code to handle edge effects it could do it. Or else use a for loop and the max() and min() functions to do it the intuitive, brute force way. Erosion is the local min and dilation is the local max.
Annapoorani
Annapoorani 2012 年 2 月 6 日
ya no is for the toolbox,sorry abt tat... mm thanks for answering,i wil try it and let yo know
Annapoorani
Annapoorani 2012 年 2 月 8 日
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
Image Analyst 2014 年 8 月 22 日
If you don't have the Image Processing Toolbox, then how did you try imdilate()?
John Cristion
John Cristion 2020 年 2 月 20 日
Kernel may need to be transposed
Image Analyst
Image Analyst 2020 年 2 月 21 日
You can still view the dilated image even though you get a warning that says it will shrink it down to fit onto the screen. You can safely ignore that warning. It's not serious. If you want to see it pixel for pixel, use the zoom tool to zoom in.

サインインしてコメントする。

その他の回答 (1 件)

shelley
shelley 2014 年 8 月 22 日

0 投票

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);

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by