5
An Adaptive System for Gray Scale to RGB Image Conversion 1.Apurva B. Parandekar , M.E Scholar, Sipna College of Engineering & Technology, Amravati [email protected] 2. Prof. Shital. S. Dhande Associate Professor, Sipna College of Engineering & Technology, Amravati [email protected] Abstract: We introduce a general technique for making colorless images into colored one. To achieve this we are introducing a technique for predicting color of a particular image. This technique helps in adding chromatic values to a colorless image and sophisticated measure for color transfer. Rather than choosing the entire color from the source to the target image, we transfer RGB colors from a palette to color gray scale components, by matching difference information between the images. Particular emphasis is placed on using color information to improve the assessment of colorless images to transfer only chromatic information and retain the original luminance values of the target image. This simple technique can be successfully applied to a variety of gray scale images and videos, provided that texture and luminance are sufficiently distinct. Keywords: Color map, Image Splitting, Pattern reorganization, RGB Color space, luminance, Reference Color Images, Object detection. 1. Introduction Gray scale image contains pixels which are not a RGB color pixels. Many applications convert a gray scale image into RGB color space but fail to preserve the original contents of a Gray Scale image. This project provides an emphasis on noise removal, color conversion and blur removing techniques. Colorization is a computerized process that adds color to a black and white print, movies and T.V program invented by Wilson MarkLey .It was initially used in 1970 to add color to footage of moon from the Apollo mission demand of adding color to gray scale image such as previous black and white movies, photos has been increasing. for e.g. in amusement field, many movies and video clips have been colorized by human labors and many gray scale images have been distributed as vivid images. In other fields such as archeology dealing with historical Gray scale data and security dealing with gray scale images by crime prevention camera, we can imagine easily that colorization techniques are useful. With respect to quality assessment, “the full -reference still-image problem is essentially solved”[7]. This recent, somewhat controversial statement by cocreator of the SSIM index, sounds surprising at first. Given that the SSIM index operates on grayscale data, color information is obviously not required to predict these distortions. Colors are extremely subjective and personal. They have a prominent feature by which we try to identify images better and improve the visual appearance of image. Colors can be added to grayscale images in order to increase the visual appeal of images such as to old black and white photos or movies or for the purpose of scientific illustrations to modify it to colorful and lively images. In addition, the information content of some scientific images can be perceptually enhanced with color by exploiting variations in chromaticity as well as luminance. Since different colors may have the same luminance value but vary in hue or saturation, the problem of colorizing grayscale images has no inherently “correct” solution. Due to these ambiguities, a direct prediction of color usually plays a large role in the colorization process. Where the mapping of luminance values to color values is automatic, the choice of the color map is commonly determined by a reference image. Here we address the color-related aspects of image splitting. We focus on full-reference measures, which will convert colorless image into color image [11]. Ideally, they reflect the actual visual mechanisms responsible for image color conversion. These mechanisms, however, are poorly understood, which applies especially to gray scale images. While standard methods accomplish this task by assigning pixel colors via a global color palette, our technique empowers the user to first select a suitable color image and then transfer the color of this image to the graylevel image at hand. 2. Analysis of Problem :- Changing gray scale image to color image is very complicated. Adding direct color to a gray scale image is not possible. One of the myths about the concept of changing a colorless image into an color image is that taking a color image and removing its color applying directly to the gray scale image. To change the color of colorless image we need to modify the existing methods. For applying color to a gray scale image, Apurva B Parandekar et al, Int.J.Computer Technology & Applications,Vol 5 (2),735-739 IJCTA | March-April 2014 Available [email protected] 735 ISSN:2229-6093

An Adaptive System for Gray Scale to RGB Image … Adaptive System for Gray Scale to RGB Image Conversion 1.Apurva B. Parandekar , M.E Scholar, Sipna College of Engineering & Technology,

Embed Size (px)

Citation preview

Page 1: An Adaptive System for Gray Scale to RGB Image … Adaptive System for Gray Scale to RGB Image Conversion 1.Apurva B. Parandekar , M.E Scholar, Sipna College of Engineering & Technology,

An Adaptive System for Gray Scale to RGB Image Conversion

1.Apurva B. Parandekar

, M.E Scholar, Sipna College of Engineering &

Technology, Amravati

[email protected]

2. Prof. Shital. S. Dhande

Associate Professor, Sipna College of Engineering &

Technology, Amravati

[email protected]

Abstract: We introduce a general technique for making colorless

images into colored one. To achieve this we are

introducing a technique for predicting color of a

particular image. This technique helps in adding

chromatic values to a colorless image and

sophisticated measure for color transfer. Rather than

choosing the entire color from the source to the target

image, we transfer RGB colors from a palette to color

gray scale components, by matching difference

information between the images. Particular emphasis is

placed on using color information to improve the

assessment of colorless images to transfer only

chromatic information and retain the original

luminance values of the target image. This simple

technique can be successfully applied to a variety of

gray scale images and videos, provided that texture

and luminance are sufficiently distinct.

Keywords: Color map, Image Splitting, Pattern reorganization,

RGB Color space, luminance, Reference Color

Images, Object detection.

1. Introduction

Gray scale image contains pixels which are not a

RGB color pixels. Many applications convert a gray

scale image into RGB color space but fail to preserve

the original contents of a Gray Scale image. This

project provides an emphasis on noise removal, color

conversion and blur removing techniques.

Colorization is a computerized process that adds

color to a black and white print, movies and T.V

program invented by Wilson MarkLey .It was initially used in 1970 to add color to footage of moon from the

Apollo mission demand of adding color to gray scale

image such as previous black and white movies,

photos has been increasing. for e.g. in amusement

field, many movies and video clips have been

colorized by human labors and many gray scale images

have been distributed as vivid images. In other fields

such as archeology dealing with historical Gray scale

data and security dealing with gray scale images by

crime prevention camera, we can imagine easily that

colorization techniques are useful.

With respect to quality assessment, “the full-reference

still-image problem is essentially solved”[7]. This

recent, somewhat controversial statement by cocreator

of the SSIM index, sounds surprising at first. Given

that the SSIM index operates on grayscale data, color

information is obviously not required to predict these

distortions. Colors are extremely subjective and

personal. They have a prominent feature by which we

try to identify images better and improve the visual

appearance of image. Colors can be added to grayscale

images in order to increase the visual appeal of images such as to old black and white photos or movies or for

the purpose of scientific illustrations to modify it to

colorful and lively images. In addition, the information

content of some scientific images can be perceptually

enhanced with color by exploiting variations in

chromaticity as well as luminance. Since different

colors may have the same luminance value but vary in

hue or saturation, the problem of colorizing grayscale

images has no inherently “correct” solution. Due to

these ambiguities, a direct prediction of color usually

plays a large role in the colorization process. Where

the mapping of luminance values to color values is

automatic, the choice of the color map is commonly

determined by a reference image.

Here we address the color-related aspects of image

splitting. We focus on full-reference measures, which

will convert colorless image into color image [11]. Ideally, they reflect the actual visual mechanisms

responsible for image color conversion. These

mechanisms, however, are poorly understood, which

applies especially to gray scale images. While standard

methods accomplish this task by assigning pixel colors

via a global color palette, our technique empowers the

user to first select a suitable color image and then

transfer the color of this image to the graylevel image

at hand.

2. Analysis of Problem :- Changing gray scale image to color image is very

complicated. Adding direct color to a gray scale image

is not possible. One of the myths about the concept of

changing a colorless image into an color image is that

taking a color image and removing its color applying

directly to the gray scale image. To change the color of colorless image we need to modify the existing

methods. For applying color to a gray scale image,

Apurva B Parandekar et al, Int.J.Computer Technology & Applications,Vol 5 (2),735-739

IJCTA | March-April 2014 Available [email protected]

735

ISSN:2229-6093

Page 2: An Adaptive System for Gray Scale to RGB Image … Adaptive System for Gray Scale to RGB Image Conversion 1.Apurva B. Parandekar , M.E Scholar, Sipna College of Engineering & Technology,

segmentation is used first but due to improperness in

its separation resultant image quality may loss.

According to referred methods, predicting and then

direct application of color on the colorless image is

one of the main problems which reduced the overall

effectiveness of the entire work. This drawback makes

the overall system rigidless so that, the prediction

about the color of image should not match every time. The changes in source image and resultant image are

not completely verified depending upon its image

difference mapping. Difference was calculated by

considering few parameters and reference image in the

previous case and then that reference image are

converted into the color. The mapping methods used in

current scenario are not satisfactory.

3. Proposed Methodology 3.1Objectives Adding color to a gray scale image directly is not

possible. Admittedly, the process of colorizing a

grayscale image certainly seems not straight forward

enough, in that it probably involves various methods to

apply color onto the colorless image. This technique is

entirely different; it is an adaptive system, which

emphasis on a grayscale image and converting them

into color image using image splitting.

Automatic selection of color in a particular grayscale

image makes system more impactful and obtained

resultant image enhanced the scale of colorization.

Purpose of this Paper is to produce with the new

approach to work on the way to get the solution of problem in hand.

In previous adapted methods the difference mapping

is done partially. Here we proposed that the method

used in predicting maps will be uniform and having

effective mapping techniques between the gray scale

image and obtained color image. In this proposed

system we will map the entire source and destination

images for better results..

3.2 Algorithm

1. Select colorless gray scale image.

2. Split an Image into multiple segments.

3. Locate pattern for each segment.

4. If pattern located successfully, then goto step5 else select default color reference image.

5. Insert reference image color to gray scale object.

6. Join all converted color objects.

7. Stop.

Figure3.2.1 DFD(Proposed System)

Figure 3.2.2 Proposed System Architecture

3.2.1 Select Gray Scale Image In Proposed method, main objective is to convert

gray scale image to color RGB Image with respect to

its content. Input image may be of any type like

.jpg,bmp,png,tiff…. etc

3.2.2 Split an Image Split an image object into multiple objects so that it

can be properly clusterise with respect to its content.

Figure 3.2.1Input Image

Apurva B Parandekar et al, Int.J.Computer Technology & Applications,Vol 5 (2),735-739

IJCTA | March-April 2014 Available [email protected]

736

ISSN:2229-6093

Page 3: An Adaptive System for Gray Scale to RGB Image … Adaptive System for Gray Scale to RGB Image Conversion 1.Apurva B. Parandekar , M.E Scholar, Sipna College of Engineering & Technology,

Figure 3.2.2 Split Image Objects

An entire image object can be represented with an

equation

𝐼𝑚 = 𝐼𝑗 + 𝐼𝑗 + 1 + ⋯+ 𝐼𝑚 𝑑𝑤𝑚

𝑗 =1 eq……3.1

Where Im=single object vertically split.

Ij=Veridical split sub-object of object split horizontal

dw=individual object width of I.

+ =Horizontal Join

An image can be constructed with an equation

𝐼𝑚𝑎𝑔𝑒 = 𝐼𝑚 𝐼𝑚 + 1 𝐼15 𝑑ℎ15

𝑚 =1 eq…….3.2

Where

dh=Individual object Im height.

||=Vertical Join

3.2.3 Select Reference Image

Figure 3.2.3.1 DFD for Pattern Matching

In this project we create a system that is useful to find

the object that is present inside the image. In this we

first take a image as an input for which we have to find

the object. After selecting the input image we have to

focus on the target image. After getting both input

image and target image we compare the size of both

the image. If the size of input image is greater than

target image then we proceed with our system

otherwise we are going to focus on the input image. If

the above criteria get satisfied then we create the sub

matrixes of both the images for example we create 3 X

3 matrixes. After creating the sub matrixes we

compare both the sub matrixes of both the image. This

Matrix can be created with the help of pixels present in

both the images. If matching found then we concludes

that the given object is found in the other image. The object is shown as an output by creating red boxes on

that object.

The output object image is displayed and the co

ordinates of that object that is the height and width

from top and bottom in te form of coordinates is shown

with the help of im tool.

3.2.4 Fill Reference Color Image to Gray Scale

Object Process of gray scale to GRB color conversion works

as follows

Gray Scale Object Color Object

Figure 3.2.4 Basic Pixel Representation

In a proposed methodology, we replace color

content of gray scale image object with color content

of reference color image

Select a Gray scale image of any type(i.e. JPEG,

BMP, PNG etc).If an image is of large dimensions, we

must need to resize it into a dimension of 200 X

200.The reason behind this is that, number of pixels

are directly proportional to time required for color

conversion.

Pi ∝ Tieq……..3.4 Where Pi=Number of pixels of input gray scale.

Ti=Time required for color conversion.

The reference image should be a color RGB image.

The reason behind is that, we are creating a dummy

image with color contents of reference color image.

3.2.5 Luminance Comparison Luminance of an image is a factor that preserves the

originality of an image. The luminance factor can be

calculated as

Apurva B Parandekar et al, Int.J.Computer Technology & Applications,Vol 5 (2),735-739

IJCTA | March-April 2014 Available [email protected]

737

ISSN:2229-6093

Page 4: An Adaptive System for Gray Scale to RGB Image … Adaptive System for Gray Scale to RGB Image Conversion 1.Apurva B. Parandekar , M.E Scholar, Sipna College of Engineering & Technology,

Lfr = Li – Lf eq…………….3.5

Where

Li= Pi Pr + Pg +Pb

r +

Pr + Pg +Pb

g +

𝑛

𝑖=0

Pr + Pg +Pb

b eq………3.5

Lf = Pf Pfr + Pfg + Pfb

fr +

Pfr + Pfg + Pfb

fg

𝑛

𝑖=0

+ Pfr + Pfg + Pfb

fb

eq………3.6

Li=Gray scale factor of original Gray scale image.

Lf= RGB factor of original reference image.

Pr=Red component decimal value of input Gray scale.

Pg=Green component decimal value of input Gray scale.

Pb=Blue component decimal value of input Gray scale.

Pfr=Red component decimal value of reference image.

Pfg=Green component decimal value of reference

image.

Pfb=Blue component decimal value of reference image.

If Lfr ≤ 0 ≤ 10

it means both the pixels have a matching color

parameters else not.

3.2.6 Generating Dummy image A dummy image has a great impact on accurate

colorization of gray scale image. Dummy image

contains only color components of reference image. A

dummy image created with following steps:

1. Segment reference image according to color

components. Reference image can be segmented

using

𝑃𝑖 Pr + Pg +Pb

r+g+b

𝑃𝑦𝑥𝑖=0

𝑃𝑥𝑦

0

𝑛

1 eq…….3.7

Where

n = No. Of segments

Pxy = Total no. of pixels Pyx = Pixels at position Y, X

2. Add a segment generated as per the Eq 3.7 into

dummy image. Put the contents of input Gray scale

image into dummy image

It is observed that generated color image may have

contents which are not properly synchronized with

respect to color. This project has an accuracy 80 to

90% for correct image segmentations and for dummy

image generation. Usually contents in an image are represented with pixels value either 0 or 1.This

technique works on same concept. To have a better

accuracy, it should be necessary that luminance factor

calculations, image segmentations should be correctly

done.

4. Experiment Result

Input Image Recovered Color

Image

Sr.

No

Im

ag

e

Na

me

Size

Mea

n

Inte

nsit

y

Ent

rop

y

Col

or

Ima

ge

Size

Mea

n

Inte

nsit

y

Ent

rop

y

1 1.j

pg

100

x10

0

0.5 17.3

5

100

x10

0

0.43 17.6

2

2 2.j

pg

150

x15

0

0.4 18.2

4

150

x15

0

0.47

8

18.2

3

3 3.j

pg

200

x20

0

0.5 17.3

52

200

x20

0

0.5 17.9

87

4 4.j

pg

250

x250

0.6 18.2

34

250

x250

0.62

34

18.4

64

Table 4.1 Input image vs Recovered color image

Table 4.2 Pixel change result

Sr.

No

Inp

ut

Im

age

Siz

e

No of

Refer

ence

Image

s

Ref.Im

ages

Locate

d

Time for

Recover

y(Sec)

Accu

racy

%

1 100

x10

0

10 8 58 83

2 150

x150

10 8 85 90

Apurva B Parandekar et al, Int.J.Computer Technology & Applications,Vol 5 (2),735-739

IJCTA | March-April 2014 Available [email protected]

738

ISSN:2229-6093

Page 5: An Adaptive System for Gray Scale to RGB Image … Adaptive System for Gray Scale to RGB Image Conversion 1.Apurva B. Parandekar , M.E Scholar, Sipna College of Engineering & Technology,

3 200

x

200

10 9 95 95

4 250

x250

10 8 93 98

Table 4.3 Time & accuracy result

5. Conclusion In this paper,fast simple technique is used to

colorize a gray scale image to a color image using

reference image.Original image is pre-processed to

illuminate noise and then colorisation process is

done.By using this technique a large number of Gray

scale images are converted into color images with very

less effort.

References [1] A. K. Jai, Fundamentals of Digital Image

Processing, Prentice-Hall, 1989.

[2] “Colorization for Monochrome Image with

texture”, in coloring Image Conference 2005, pp 245-

250.

[3] “Converting Gray-Scale Image to Color Image” in

Proceedings of SPIT-IEEE Colloquium and

International Conference, Mumbai, India, Vol. 1, 189.

[4] Gonzalez R.C., Woods R.E., Digital Image Processing, Addison Wesley, 2002.

[5] K. S. Sim, C. P. Tso, and Y. Y. Tan, "Recursive

sub-image histogram equalization applied to gray scale

images”", Pattern Recognition Letters, 28(10), pp.

1209-1221, 2007.

[6] Pratt W.K., Digital image processing, A Wiley

Interscience Publication, 1991.

[7] Scott E Umbaugh, Computer vision and i mage

[8]MahmoudK.Quweider“AdaptivePseudocoloring of

Medical Images Using Dynamic Optimal Partitioning

and Space-FillingCurves” Biomedical Engineering and

Informatics, 2009. BMEI '09. 2nd International

Conference, PP. 1-6,17-19 Oct. 2009.

[9] Ye Ji, Yan Chen, “ Rendering Grayscale Image

using Color Feature” IEEE Int. Conf. on Machine

Learning and Cybernetics, Vol.5, pp. 3017-3021,

Kunming, China, 2008 [10] C.W.Kok, Y.Hui, T.Q.Nguyen, “Medical Image

Pseudo Coloring by Wavelet Fusion” 18th Annual

International Conference of theIEEE Engineering in

Medicine and Biology Society. Amsterdam,1996.

[11] GovindHaldankar, AtulTikare and JayprabhaPatil,

“Converting Gray-Scale Image to Color Image”

Proceedings of SPIT-IEEEColloquium and

International Conference, Vol. 1, pp. 189-

192,Mumbai, India, June 2011.

[12] Cheng-Hsiung Hsieh, Chih-Ming Lin, Fung-Jung

Chang, “Pseudo coloring with Histogram

Interpolation” Ninth InternationalConference on

Hybrid Intelligent Systems 2009.

[13]TomihisaWelsh,MichaelAshikhmin and Klaus

Mueller, “Transferring color to grayscale images”,

Journal ACM Transactions on Graphics (TOG) -

Proceedings of ACM SIGGRAPH 2002TOG, Volume

21 Issue 3, PP. 277-280 , July 2002.

[14]Rujuta R Mahambare “CONVERTING GRAY-

SCALE IMAGE TOCOLOR IMAGE”, IJCITB ISSN:

2278-7593, Volume-1, Issue-4 IEEE & IEEE Computational Intelligence Society,PP.142-146, April-

June 2013 Issue.

[15]Dr.AhlamFadhilMahmoodAbdulkreem

Mohammad Salih,“Implementation of Multiplier less

Architectures for Color Space Conversions on

FPGA”,IEEE Transactions on Consume Electronics,

Volume 53, Number 4, PP1490-1493,November 2004.

[16] Stephen J. Chapman, Second Edition Matlab

Programming for Engineering,[2002].

[17] Ingmar Lissner, Jens Preiss,” Image-Difference

Prediction:From Grayscale to color”, ieee transactions

on image processing, vol. 22, no. 2, pp.435-446 feb

2013.

Author Information Prof A.B.Parandekar: Completed B.E. (IT) from Sant

Gadge Baba Amravati University, Amravati. Currently

pursuingME in faculty of Engineering & Technology,

and her area of interest is Digital image processing.

Prof. Shital. S. Dhande: She is Associate Professor at

Sipna College of Engineering & Technology,

Amravati. Completed her B.E. (CSE), M.E. (CSE)

from Sant Gadge Baba ,Amravati University, Amravati. Currently pursuing PHD in faculty of

Engineering & Technology in the area of OODatabase

Management System from Sant Gadge Baba Amravati

University, Amravati (MH), India. She has published

many papers at National as well as International level.

She is a member of ISTE, IE, and IETE India.

Apurva B Parandekar et al, Int.J.Computer Technology & Applications,Vol 5 (2),735-739

IJCTA | March-April 2014 Available [email protected]

739

ISSN:2229-6093