Borrar filtros
Borrar filtros

how to manipulate image pixels

2 visualizaciones (últimos 30 días)
Sams
Sams el 9 de Mayo de 2014
Respondida: Image Analyst el 9 de Mayo de 2014
Hi everyone I've got an image and now i'd like to change some pixelvalues. e.g i'd like to change all values to 0 which are below a certain limit. I thought to give it a try with a for loop but so far it didn't work. Please, i am totally new to matlab. cheers Sams

Respuesta aceptada

Image Analyst
Image Analyst el 9 de Mayo de 2014
Make a binary image mapping out the pixels less than some threshold and then use that as a logical index to set them to zero:
thresholdValue = 100; % Or whatever you want
belowThreshold = grayImage < thresholdValue; % Create binary image.
% Make a copy that will be masked.
newImage = grayImage; % Create a copy.
newImage(belowThreshold) = 0; % Assign them to zero.

Más respuestas (0)

Categorías

Más información sobre Images 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