Detect edge and remove it

2 visualizaciones (últimos 30 días)
hadi
hadi el 9 de Oct. de 2013
Comentada: Cedric el 24 de Oct. de 2013
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.

Respuesta aceptada

Cedric
Cedric el 10 de Oct. de 2013
Editada: Cedric el 10 de Oct. de 2013
% - 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 comentarios
hadi
hadi el 10 de Oct. de 2013
Yes sir cedric. this is definitely the answer that i am looking for.
thank you for your help sir :)
Cedric
Cedric el 24 de Oct. de 2013
You're welcome!

Iniciar sesión para comentar.

Más respuestas (1)

Image Analyst
Image Analyst el 10 de Oct. de 2013
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 comentarios
Cedric
Cedric el 10 de Oct. de 2013
I didn't know IMCLEARBORDER, thank you for the update!
hadi
hadi el 24 de Oct. de 2013
Editada: hadi el 24 de Oct. de 2013
hi this seems late but i just want to say thank you..
your solution has made me solve one of my new problem..

Iniciar sesión para comentar.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by