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

조회 수: 3 (최근 30일)
John
John 2014년 5월 28일
답변: Image Analyst 2014년 5월 28일
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?

답변 (1개)

Image Analyst
Image Analyst 2014년 5월 28일
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);

태그

Community Treasure Hunt

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

Start Hunting!

Translated by