Clear Filters
Clear Filters

how to reduce edge thickness

8 views (last 30 days)
mole20
mole20 on 22 Mar 2017
Answered: Sarvesh Kale on 31 Jan 2023
Hi
I have a processes image and was wondering how I should go about reducing the thickness of the edges (please see attached)
Thanks

Answers (1)

Sarvesh Kale
Sarvesh Kale on 31 Jan 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
  1. Define structuring element
  2. Erode the edge image with structural element
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

Community Treasure Hunt

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

Start Hunting!