필터 지우기
필터 지우기

Detect edge and remove it

조회 수: 1 (최근 30일)
hadi
hadi 2013년 10월 9일
댓글: Cedric 2013년 10월 24일
I need to combine the black and white colour together and left this picture with only the words and number.. can anyone show me on the right approach to solve this problem.

채택된 답변

Cedric
Cedric 2013년 10월 10일
편집: Cedric 2013년 10월 10일
% - Read RGB image and convert to BW.
BW = im2bw( imread( 'TEST_7.jpg' )) ;
% - Build vectors of logicals targeting all-black rows/cols.
colId = ~sum( BW, 1 ) ;
rowId = ~sum( BW, 2 ) ;
% - Make them all white.
BW(:,colId) = 1 ;
BW(rowId,:) = 1 ;
% - Show result.
imshow(BW)
Is it what you are trying to achieve?
  댓글 수: 2
hadi
hadi 2013년 10월 10일
Yes sir cedric. this is definitely the answer that i am looking for.
thank you for your help sir :)
Cedric
Cedric 2013년 10월 24일
You're welcome!

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

추가 답변 (1개)

Image Analyst
Image Analyst 2013년 10월 10일
You can simply do this:
binaryImage = imclearborder(~binaryImage);
This gives white letters on a black background (what is needed for most subsequent operations). Invert it if you want black letters on a white background.
binaryImage = ~imclearborder(~binaryImage);
  댓글 수: 2
Cedric
Cedric 2013년 10월 10일
I didn't know IMCLEARBORDER, thank you for the update!
hadi
hadi 2013년 10월 24일
편집: hadi 2013년 10월 24일
hi this seems late but i just want to say thank you..
your solution has made me solve one of my new problem..

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by