How can I eliminate the pixels on an image that contain more blue or red than green?
Mostrar comentarios más antiguos
I am working on a project with plants and I would like the program to detect the green objects .
Respuestas (1)
Joseph Cheng
el 7 de Jul. de 2015
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)
Categorías
Más información sobre ROI-Based Processing en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!