Borrar filtros
Borrar filtros

How can i modify matrix which i retrieve from image?

1 visualización (últimos 30 días)
Umme Tania
Umme Tania el 19 de Jun. de 2013
I have a gray image, i want to see only the black part ,rest of image i want to replace with value 250, so that gray part will be white.
f=imread('image1.jpg');
T = zeros(size(f));
for ii = 1:numel(f)
if f(ii)<50
T(ii) = f(ii);
else
T(ii) = 250;
end
end
imshow(T)
  5 comentarios
Evan
Evan el 19 de Jun. de 2013
What's the minimum value of your image?

Iniciar sesión para comentar.

Respuesta aceptada

Iain
Iain el 19 de Jun. de 2013
Try:
%if the problem is just the data type, this should work:
T = f;
T(T>50) = 255;
If the problem is that you can't see the very few black pixels, tell us the result from
sum(f(:) <51)
  1 comentario
Umme Tania
Umme Tania el 19 de Jun. de 2013
Editada: Umme Tania el 19 de Jun. de 2013
Thanks.........now it's working

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Image Processing Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by