Remove black line/spot from a picture

1 view (last 30 days)
hadi
hadi on 10 Oct 2013
Edited: hadi on 10 Oct 2013
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)

Answers (0)

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!