フィルターのクリア

HSV to RGB using entered values

2 ビュー (過去 30 日間)
evangeline
evangeline 2014 年 1 月 21 日
コメント済み: evangeline 2014 年 1 月 21 日
I have used the rgb2hsv and changed my rgb image to hsv, then asked the user to enter new h and s values .. now I want to create the new rgb image with these new h and s and v values, could anyone help me with it? how can I combine these hsv seprate values into one rgb image?

採用された回答

evangeline
evangeline 2014 年 1 月 21 日
H=im3(:,:,1); S=im3(:,:,2); V=im3(:,:,3); I seprated the hsv values with these commands, now I want to change the hsv values and combine them into one rgb image
  2 件のコメント
Bjorn Gustavsson
Bjorn Gustavsson 2014 年 1 月 21 日
Assuming you original image is im:
hsv = rgb2hsv(im); % HSV version of original image
HSV = hsv; % HSV version of image we're modifying
HSV(:,:,1) = mod(hsv(:,:,1)+0.2,1); % Shift the hue component, this is not pretty...
HSV(:,:,2) = hsv(:,:,2).^.75; % Change the saturation
IM = hsv2rgb(HSV); % Convert back to RGB
subplot(1,2,1),imagesc(im) % display anf compare
subplot(1,2,2),imagesc(IM) % the 2 images
Obviously you'll haveto modify the H&S modification to what you want to achieve...
HTH
evangeline
evangeline 2014 年 1 月 21 日
thank u so much

サインインしてコメントする。

その他の回答 (1 件)

Bjorn Gustavsson
Bjorn Gustavsson 2014 年 1 月 21 日
Why cant you use hsv2rgb? It's also not clear to me how you have your users entering new hue and saturation values - do you really expect them to give new parameters pixel-by-pixel, that would be a very large number of numbers to enter for anyone...

カテゴリ

Help Center および File ExchangeImages についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by