Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the method of matlab morphological expansion and corrosion?

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the relevant knowledge of "what is the method of matlab morphological expansion and corrosion". The editor shows you the operation process through an actual case. The operation method is simple, fast and practical. I hope this article "what is the method of matlab morphological expansion and corrosion" can help you solve the problem.

% enlarge the image to enlarge the shape

Use the imdilate function to extend the image

% morphological expansion operation expands or thickens foreground objects in an image

BW = zeros (9, 10)

BW (4JV 6pm 4R 7) = 1

Imshow (imresize (BW,40,'nearest'))

Create a structural element to use with imdilate

To expand a geometric object, you usually need to create a structural element that has the same shape as the object

SE = strel ('square',3)

Pass input images and structural elements to imdilate

Add 1 to all edges of the foreground object

BW2 = imdilate (BW,SE)

Imshow (imresize (BW2,40,'nearest'))

For comparison, create a structural element of a different shape

Expand the original image with new structural elements

SE2 = strel ('diamond',1)

BW3 = imdilate (BW,SE2)

Imshow (imresize (BW3,40,'nearest'))

Montage ({BW,BW2,BW3}, 'Size', [3 1])

%% corrodes the image to remove fine lines

% use the imerode function to corrupt the binary image

% image read and display image

BW1 = imread ('circbw.tif')

Imshow (BW1)

Create a diagonal structure element

SE = strel ('arbitrary',eye (7))

% corrosion image

BW2 = imerode (BW1,SE)

% display original image and corrosion image

The diagonal stripe is due to the shape of the structural element.

Imshow (BW2)

Montage ({BW1,BW2}, 'Size', [2 1])

This is the end of the content about "what is the method of matlab morphological expansion and corrosion". Thank you for your reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report