How can I convert the red color in the image to white?
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos

I need to remove the noise (red color) from this image. I need help in performing two operations: 1. Convert the red color in the image to white. 2. Considering the image is array of pixels in 2D. What I need to do is ask the program to check which pixel values are white, and then give it a value of a non-white adjacent pixel.
Can this be done in MATLAB?
This is how the final product should look like

0 comentarios
Respuestas (1)
Image Analyst
el 22 de Feb. de 2018
Editada: Image Analyst
el 23 de Feb. de 2018
Try this:
% Extract the individual red, green, and blue color channels.
redChannel = rgbImage(:, :, 1);
greenChannel = rgbImage(:, :, 2);
blueChannel = rgbImage(:, :, 3);
redMask = redChannel >= 200 & greenChannel <= 50 & blueChannel <= 50;
greenChannel(redMask) = 255;
blueChannel(redMask) = 255;
% Recombine separate color channels into a single, true color RGB image.
rgbImage = cat(3, redChannel, greenChannel, blueChannel);
8 comentarios
Image Analyst
el 24 de Feb. de 2018
OK good luck. When you paint over it, it would be good if you used pure red (255,0,0) instead of whatever similar color you used, or at least know exactly what color you used so you can put those values in to the algorithm.
Next, never use JPG images for image analysis because this will change the values. That's probably why there was still a little bit of red around the perimeter. The jpeg process blurred out the image.
Ver también
Categorías
Más información sobre Blue en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
