Converting image from HSI back to RGB changes color composition after processing I component

Hello all,
I am trying to accomplish a certain process on color images. But performing the same on all R, G, B planes individually is very time consuming and computationally expensive. So I figured that since the I component of HSI would be good enough to alter the visual statistics of the image ( mean and variance). However when I convert it back to RGB, keeping the hue and saturation components as is, the output image is very different from the input in terms of color composition. Any ideas how can I go back to RGB without destroying the color profile?

Answers (1)

How did you do the conversion? Did you actually use V instead of I and use rgb2hsv()? Changing the V component slightly should not change the Hue and Saturation and the colors should look pretty much the same, just brighter or darker according to whatever modifications you made in the V channel. I can't say much more without your image and your code.

2 Comments

Hi,
Thank you for your prompt response. I wrote functions to convert from rgb to hsi and back. Also, I saw your program for histogram matching. It matches the historgram of the image to the object in the foreground. Does matlab 9 or 10 have functions that perform histogram matching on color/grayscale images? I found imhistmatch, but I guess that works only for Matlab 13.
If you wrote your own functions for going from HSI to RGB, then I can't debug or fix them because I don't know what they are.
There are no histogram matching routines built into MATLAB. You'd have to write them yourself, like I did in my histogram matching application.

Sign in to comment.

Categories

Find more on Convert Image Type in Help Center and File Exchange

Asked:

on 28 Apr 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!