How do I remove the square box surrounding on the single digit?

조회 수: 1 (최근 30일)
Rinku
Rinku 2015년 1월 19일
편집: suraj tarade 2017년 10월 5일
when i try to recognize the digit that surrounded by square box ,but i can't remove the edges of the square box.can anyone tell how do i remove??

채택된 답변

Image Analyst
Image Analyst 2015년 1월 19일
Threshold it, fill it, then call imerode() to shrink the binary blob.
binaryImage = grayImage > 128;
binaryImage = imfill(binaryImage , 'holes');
erodedImage = imerode(binaryImage, true(9));
Then subtract from original binary image to get just the straight borders.
maskImage = binaryImage - erodedImage;
Then use that as a mask to assign any other value, such as 0 or 128 or whatever.
grayImage(maskImage) = 0;
Or you can use nearby image image values if you want by using roifill(). Give it a try and come back with your code attempt if you still need help.
  댓글 수: 5
Image Analyst
Image Analyst 2015년 1월 22일
Like I said, "For the first image, you can check if the centroid of one blob is inside the bounding box of a different blob. " If you don't know how to find centroids and bounding boxes, then see my tutorial http://www.mathworks.com/matlabcentral/fileexchange/25157-image-segmentation-tutorial---blobsdemo-- It goes over that in well-commented detail.
Rinku
Rinku 2015년 1월 27일
thank you for your quick reply.I try these code.

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

추가 답변 (1개)

suraj tarade
suraj tarade 2017년 10월 5일
편집: suraj tarade 2017년 10월 5일
Hi i also want solution for the same please find below link for details https://in.mathworks.com/matlabcentral/answers/359858-i-want-to-remove-border-surrounding-on-character

카테고리

Help CenterFile Exchange에서 Pattern Recognition and Classification에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by