- Define structuring element
- Erode the edge image with structural element
how to reduce edge thickness
8 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi
I have a processes image and was wondering how I should go about reducing the thickness of the edges (please see attached)
Thanks
0 Commenti
Risposte (1)
Sarvesh Kale
il 31 Gen 2023
Hi mole20 ,
Following are the steps to reduce the thickness in the edge image, such operations are called morphological image operation. In your specific case you want to remove the pixel in image which is known as erosion operation
If you look at your image most of the lines are inclined between 35 to 50 degrees so we will create a structuring element of length 5 and inclined at 45 degrees. The following lines of code will do the trick
I = imread('g21.png');
i = rgb2gray(I); % files in png format is 3D matrix
se =strel('line',5,45);
I_erode = imerode(I,se);
imshow([I,I_erode]) % show image side by side
You can get more help on different structuring element and imerode function using the following commands
help strel
help imerode
0 Commenti
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!