rgb to hsv or hsi. color of image changes.

6 visualizzazioni (ultimi 30 giorni)
Hi when i convert rgb to hsv and thn i try to show image by imshow(I_HSV) result is quite diff from what with imshow(I_RGB).
wats the reason behind this???
if u have ne idea please let me know. Is imshow() applicable to rgb images only????

Risposta accettata

HARSHIT SHARMA
HARSHIT SHARMA il 14 Giu 2011
@image analyst... ohh yeah hw silly i m... :)thanku u very much for clarification.... btw is there any function to show the same image using hsv color space????
  2 Commenti
Walter Roberson
Walter Roberson il 14 Giu 2011
No, there is no Mathworks provided function that is able to show images in any color space other than RGB. About the closest you get to that is that it is possible to save and read CMYK images in some image formats, but there is no Mathworks-provided CMYK viewer. None of the Mathworks-supported image file formats support hsv, and none of the viewing function can display it directly.
Walter Roberson
Walter Roberson il 14 Giu 2011
Oh yes, I did forget that some of the image file formats can store IEC color spaces, but again there are no viewers for that.
Please keep in mind that your display hardware almost certainly does not support HSV and would need the data converted to RGB before displaying anyhow. This makes a difference when, for example, you are attempting to display colors that are defined in HSV but which are not representable in RGB.
I _have_ used hardware that claimed support for HSV... that was many years ago, though.

Accedi per commentare.

Più risposte (3)

Andrew Newell
Andrew Newell il 14 Giu 2011
Yes, imshow is applicable to rgb images only. The reason for using rgb2hsv is to adjust hue, saturation or value. Then you have to translate back using hsv2rgb.

Image Analyst
Image Analyst il 14 Giu 2011
What it's doing is assuming the Hue channel should be displayed as red, the saturation channel as green, and the value channel as blue. Of course, this will look strange. And there may be some scaling issues which may worsen the problem, since HSV images are floating point and sometimes floating point images need to be in the range 0-1 while other times they can be in the range 0-255 - it just depends on how you're displaying them.

HARSHIT SHARMA
HARSHIT SHARMA il 19 Giu 2011
that was really helpful thank you very much

Categorie

Scopri di più su Display Image in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by