Ask Your Question
0

convert grayscale to RGB?

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

215 gravatar image

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

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 -0500

thdrksdfthmn gravatar image

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

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 -0500 )edit
2

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

StevenPuttemans gravatar imageStevenPuttemans ( 2015-11-19 07:13:46 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

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

Seen: 56,165 times

Last updated: Nov 17 '15