imsubtract(data(:,:,1), rgb2gray(data));

10 visualizaciones (últimos 30 días)
John
John el 28 de Mayo de 2014
Respondida: Image Analyst el 28 de Mayo de 2014
Hey people: i know that this instruction imsubtract(data(:,:,1), rgb2gray(data)); will subtracts the red color...with green i have to change like that imsubtract(data(:,:,2), rgb2gray(data)); and with blue imsubtract(data(:,:,3), rgb2gray(data));...but what about if i want to subtract yellow black or other color?

Respuestas (1)

Image Analyst
Image Analyst el 28 de Mayo de 2014
You can subtract any RGB image from any other RGB image. Just do that. I don't recommend using imsubtract. Just cast to double, subtract, and continue on.
differenceImage = double(rgbImage) - double(yourImageWithYellowInIt);

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by