How can I subtract data of an Image keeping the original image and not just a canal?

1 view (last 30 days)
I need to subtract data of a whole RGB image. Imsubtract works only for a canal. Or, is there a function that can use merging the canals after the subtraction?.

Answers (2)

Angela Blanco
Angela Blanco on 10 Sep 2012
I found the comand Icat= cat(3, I, I, I); very easy. Thanks

Image Analyst
Image Analyst on 10 Sep 2012
You can just subtract them directly. If they are uint8, cast to single so that you don't clip negative values.
diffImage = single(rgbImage1) - single(rgbImage2);

Tags

Community Treasure Hunt

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

Start Hunting!