text.png how to remove vertical lettering on a photo?

조회 수: 3 (최근 30일)
betty
betty 2022년 1월 6일
댓글: betty 2022년 1월 6일
how to remove all of the vertical text in the image below? i'm trying the following code but it doesn't work
I=imread('text.png');
figure,imshow(I)
[r c]=ginput(4);
BW1=roipoly(I,r,c);
figure , imshow(BW1)
J = regionfill(I,r,c);
figure , imshow(J)

채택된 답변

Simon Chan
Simon Chan 2022년 1월 6일
regionfill supports grayscale image and your input image is a black and white image only.
Therefore, regionfill gives an error.
In your case, just use:
I(BW1)=0
to give you the final image
  댓글 수: 7
Simon Chan
Simon Chan 2022년 1월 6일
The function was introduced in R2018b, so I think you have an eariler MATLAB version.
betty
betty 2022년 1월 6일
yes, I am using R2018a.

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

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by