Ask Your Question
0

How do I convert a single channel monochrome image to 3 channel gray scale?

asked 2018-12-28 12:20:31 -0600

mdresser gravatar image

I want to use color to annotate a monochrome image.

As I understand it, first I need to convert the single channel monochrome image to a 3 channel gray scale image with BGR channels all set the same. Then I can overlay color annotations on the gray scale image.

It is the first part that has me stumped: It seems like .clone, .copyTo, cvtColor all force the output to the same number of channels as the input?

How do I create a 3 channel copy of a single channel image?

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
2

answered 2018-12-28 12:24:20 -0600

LBerger gravatar image

updated 2018-12-28 12:25:11 -0600

use COLOR_GRAY2BGR with cvtColor method

edit flag offensive delete link more

Comments

alternatively, have a look here and here

berak gravatar imageberak ( 2018-12-28 13:11:33 -0600 )edit
2

Thanks for the quick response. Using cvtColor did the trick. I was confused!

mdresser gravatar imagemdresser ( 2018-12-29 10:39:29 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-12-28 12:20:31 -0600

Seen: 9,083 times

Last updated: Dec 28 '18