Detect edge and remove it
1 回表示 (過去 30 日間)
古いコメントを表示
採用された回答
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?
その他の回答 (1 件)
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 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!