필터 지우기
필터 지우기

How to thin the image so as to make the thickness of the image to one pixel wide?

조회 수: 19 (최근 30일)
Hello,i have an image and i want to thin that word image so as to make the thickness of each word to one-pixel wide to make the stroke width uniform.Please help me.

답변 (2개)

Image Analyst
Image Analyst 2016년 2월 17일
Try this
binaryImage = grayImage < 128;
% Remove small blobs;
binaryImage = bwareaopen(binaryImage, 500);
% Skeletonize
skeletonImage = bwmorph(binaryImage, 'skel', inf);
Make sure your image is actually gray scale, not color.
  댓글 수: 7
Image Analyst
Image Analyst 2016년 2월 24일
It's this line that makes it one pixel wide:
skeletonImage = bwmorph(binaryImage, 'skel', inf);
To not remove small blobs, change the 500 to a smaller number, like 20 or 50 or whatever
binaryImage = bwareaopen(binaryImage, 20);
The number you input is the size of blobs, plus smaller ones, that it will throw away (remove).

댓글을 달려면 로그인하십시오.


Walter Roberson
Walter Roberson 2016년 2월 17일
bwareafilt to remove the speckles. bwmorph() to skeletonize.
  댓글 수: 1
Meghashree G
Meghashree G 2016년 2월 17일
Sorry sir..I dint get you..how do i make the image thickness one pixel wide??please help me with the code.Thank you

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by