how to convert the background(white) of a image to blaclk.
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I obtained a image which is output of my intermediate process.It contains white background and small gray patches(grayscale image).I want the background to be black.Please suggest me a solution.
0 comentarios
Respuestas (1)
Image Analyst
el 13 de Abr. de 2012
You mean like this:
grayPatchGrayLevel = 150; % or whatever it is.
% Turn anything brighter than that to black.
grayImage(grayImage >= (grayPatchGrayLevel +1)) = 0;
Or, if you know for a fact that all your "white" is actually exactly 255, then:
grayImage(grayImage == 255) = 0;
0 comentarios
Ver también
Categorías
Más información sobre Convert Image Type en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!