File Exchange

image thumbnail

HSI <-> RGB Image Conversion Tools

version 1.1.0.0 (2.78 KB) by DGM
Convert RGB images to HSI and back

6 Downloads

Updated 15 Jul 2016

View License

RGB2HSI() and HSI2RGB() were created in response to a bug in the popular conversion tool COLORSPACE(). I have not been able to contact the author of COLORSPACE(), so I'm submitting this to fill the gap.
.
The bug mentioned results in HSI transformations incorrectly being handled as HSL transformations. This problem exists only when using the M-code version of COLORSPACE(); if COLORSPACE() is compiled as a MEX function, the implementations are correct. For anyone who can't compile MEX functions for whatever reason, RGB2HSI() and HSI2RGB() may suffice.
.
The output range for the HSI image matches what COLORSPACE() would produce.
0<H<360
0<S<1
0<I<1

Comments and Ratings (3)

DGM

Juan: I see from your recent submission that you went ahead and forged your own solution. Sorry for my lack of prompt helpfulness.

DGM

Juan: P.S. Maybe it's bad form, but I capitalize function names for emphasis in the documentation; otherwise, if that's how you were using em, case-sensitivity will result in errors. 2009b tries to auto-match case-insensitively and produces warnings, but i have no idea what newer versions do.

La versión que tengo de matlab es R2015a y no me funciona, lo estoy así eso así: en una función de mando la imagen HSI la cual estaba en RGB, la idea era tomar una imagen RGB y pasarla a HSI, y mirar los canales por aparte, eso lo hice con la ayuda de un código que está publicado por alguien acá mismo en la comunidad, ahora lo que necesito es pasar la imagen resultante nuevamente ósea la imagen HSI a RGB, pero me sale el error " undefined function or variable 'HSI2RGB', lo estoy adié si así : RGB= HSI2RGB(hsi);

Hay alguna manera de hacerlo por código?
Muchas gracias por su importante ayuda.

Updates

1.1.0.0

removed IPT dependency

MATLAB Release Compatibility
Created with R2009b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Acknowledgements

Inspired by: Colorspace Transformations