Grayscale erosion and Grayscale dilation simulink block

조회 수: 2 (최근 30일)
Gayathri Sankaran
Gayathri Sankaran 2021년 12월 14일
답변: Akshat 2024년 4월 30일
I was trying to find the minimum and maximum of the 3 x 3 neighbourhood for the video signal. I have used grayscale erosion and grayscale dilation simulation block. For some of the instances the maximum values is found to be less than the minimum value.
It would be great if example for using these two blocks posted in mathwork community.
Can someone tell me how to overcome this situation?
Thanks in advance

답변 (1개)

Akshat
Akshat 2024년 4월 30일
Hi Gayathri,
It would have been easier for me to help you out with this task if you would've provided a code you are using. But I will try my best to guide you through the process.
As you want to perform an erosion and dilation task, you need to first generate a "structuring element" using the "strel"/"offsetstrel" function. Post that, you can simply erode or dilate using the "imerode" or "imdilate" respectively. Following is the code you can use:
frame = rgb2gray(imread('example.jpg'));
se = strel('square', 3);
minFrame = imerode(frame, se);
maxFrame = imdilate(frame, se);
You need to make sure that the image is grayscale before you perform the erosion or dilation.
Now, to the second part of you question, examples for the same are here"
Feel free to follow up, in case you have any doubts!

카테고리

Help CenterFile Exchange에서 Computer Vision with Simulink에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by