Grayscale erosion and Grayscale dilation simulink block
2 次查看(过去 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
0 个评论
回答(1 个)
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!
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Computer Vision with Simulink 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!