필터 지우기
필터 지우기

how to reduce edge thickness

조회 수: 8 (최근 30일)
mole20
mole20 2017년 3월 22일
답변: Sarvesh Kale 2023년 1월 31일
Hi
I have a processes image and was wondering how I should go about reducing the thickness of the edges (please see attached)
Thanks

답변 (1개)

Sarvesh Kale
Sarvesh Kale 2023년 1월 31일
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!

Translated by