How to code HSV to RGB spaces images matlab?

3 次查看(过去 30 天)
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);

回答(1 个)

Image Analyst
Image Analyst 2019-11-28
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);

类别

Help CenterFile Exchange 中查找有关 Convert Image Type 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by