Ask Your Question
0

convert grayscale to RGB?

asked 2015-11-17 01:46:00 -0600

215 gravatar image

updated 2015-11-17 02:01:24 -0600

Is it possible to convert a grayscale image to contain an RGB channel? And thereby manipulate those, and give some color to an grayscale image?

I tried using cvtColor but, i seem to get an black image as output.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
3

answered 2015-11-17 02:20:51 -0600

thdrksdfthmn gravatar image

updated 2015-11-17 02:21:24 -0600

If you use cv::cvtColor(gray, color, cv::COLOR_GRAY2BGR) you should get a 3 channel image but there are no colors, because all the channels have the same value as the gray image. Except if your gray image is not a normal gray image, but some kind of a map image (like values between x and y are z color)

edit flag offensive delete link more

Comments

2

If you want to see your image in false color you have to make your own LUT. You can find a post about this here

LBerger gravatar imageLBerger ( 2015-11-17 02:31:18 -0600 )edit
2

Since these comments actually combined lead to every possible solution, I combined them.

StevenPuttemans gravatar imageStevenPuttemans ( 2015-11-19 07:13:46 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2015-11-17 01:46:00 -0600

Seen: 66,340 times

Last updated: Nov 17 '15