Kemendil
Kemendil

Reputation: 131

OpenCV C++ combine gray images in color image

I have three same sized grayscale images and want to combine them in one RGB image. Is there a method for doing that in openCV or do i have to write it on my own?

Example: Gray1 shall be red channel, Gray2 shall be green channel, Gray3 shall be blue channel.

Purpose: Visualize diffrent features of an image in "color layers".

Upvotes: 1

Views: 1403

Answers (1)

Rick M.
Rick M.

Reputation: 3125

OpenCV provides a function for that: Merge

Example:

Mat red, green, blue;
Mat channels[3] = {red, green, blue};
Mat m;
merge(channels, 3, m);

Upvotes: 3

Related Questions