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

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)

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

Asked:

on 5 Sep 2012

Community Treasure Hunt

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

Start Hunting!