Remove black line/spot from a picture

3 次查看(过去 30 天)
hadi
hadi 2013-10-10
编辑: hadi 2013-10-10
hi, can anyone guide me on how to remove the black line above the words on figure 2.
I just want to have the image of the letter and number, if you can make the words darker it is better.
figure 1
figure 2
this is the code that i used to get from figure 1 to figure 2.
%read image
BW = imread( 'test20.jpg' )
figure(1),imshow(BW),title('test');
%adjust intensity
BW = imadjust(BW,[0 1],[]);
% - Read RGB image and convert to BW.
BW = im2bw(BW) ;
% - 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.
figure(2), imshow(BW)

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by