How can I eliminate the pixels on an image that contain more blue or red than green?

Respuestas (1)

create a mask using a threshold.
samp(:,:,1) = repmat(0:.1:1,11,1);
samp(:,:,3) = repmat([0:.1:1]',1,11);
samp(:,:,2) = .5*ones(size(samp(:,:,1)));
subplot(1,2,1),image(samp)
mask = repmat(samp(:,:,1)<samp(:,:,2) & samp(:,:,3)<samp(:,:,2),1,1,3);
greenIM = zeros(size(samp));
greenIM(mask) = samp(mask);
subplot(1,2,2),imagesc(greenIM)

Etiquetas

Preguntada:

el 7 de Jul. de 2015

Respondida:

el 7 de Jul. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by