Azzera filtri
Azzera filtri

How to code HSV to RGB spaces images matlab?

3 visualizzazioni (ultimi 30 giorni)
Alvin Alvin
Alvin Alvin il 28 Nov 2019
Risposto: Image Analyst il 28 Nov 2019
Hello please help me,
First of all my code on matlab is converting RGB images to HSV color space, and i use Adaptive Image Enhancement for Increasing Value, and then i confused when i must to converting again from HSV color space to RGB spaces, can you help me with the code? here i give you code when i converting the RGB to HSV. Thanks
img = imread('tes2.jpg');
HSV = rgb2hsv(img);
hueValue = HSV(:,:,1);
saturationValue = HSV(:,:,2);
Value = HSV(:,:,3);

Risposte (1)

Image Analyst
Image Analyst il 28 Nov 2019
Something like (untested):
rgbImage = imread('tes2.jpg');
HSV = rgb2hsv(rgbImage);
hueValue = HSV(:,:,1);
saturationValue = HSV(:,:,2);
Value = HSV(:,:,3);
Value = adapthisteq(Value); % Or your own custom function.
% Put back together
HSV = cat(3, hueValue, saturationValue, Value);
rgbOutput = hsv2rgb(HSV);

Categorie

Scopri di più su Convert Image Type 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