Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert grayscale image to RGB

I'm not totally sure this is in the right place, so let me know...

Just so I'm being totally transparent, this is part of a coursework for my University course. To that end, please don't post an answer but please DO give me hints & nudges in the right direction. I've been working on it for a few days without much success.

I've been tasked with converting a grayscale image into an RGB image. It's been suggested that we must segment the image and add colours to each segment with an algorithm. It'a also noted that we could develop algorithms for both the RGB & HSI colourspace to improve the visualisation.

My first thought was that we could segment the image using some threshold technique (on the grayscale intensity values) and then add colours to segments, but I'm not sure if this is right.

I'm programming in Java and have use of the OpenCV library.

Any thought / ideas / hints / suggestions appreciated :)

like image 387
Dave Clarke Avatar asked Nov 10 '22 00:11

Dave Clarke


1 Answers

A very nice presentation describing different colorization algorithms

http://www.cs.unc.edu/~lazebnik/research/fall08/lec06_colorization.pdf

The basic idea is to match texture/luminance in source and target images and then transfer the color information. The better match you have, better would be your solution. However, matching intensity values in Lab space may be misleading as many pixels in the source image can have similar luminance values around them. To overcome this problem, segmenting the source image using texture information can prove helpful and then you can transfer color values of matching textures instead of luminance values.

like image 122
Bharat Avatar answered Nov 14 '22 22:11

Bharat