how can i covert rgb image to HSI and separate the intensity component alone

4 ビュー (過去 30 日間)
Jinu Sebastian
Jinu Sebastian 2020 年 10 月 6 日
編集済み: DGM 2021 年 11 月 4 日
I want to separate intensity components from an rgb image by converting it to HSI space

回答 (2 件)

KSSV
KSSV 2020 年 10 月 6 日
編集済み: KSSV 2020 年 10 月 6 日

DGM
DGM 2021 年 5 月 14 日
編集済み: DGM 2021 年 11 月 4 日
If you just want the intensity (as in HSI) of an image:
ipict = mean(rgbpict,3);
If instead you want value (as in HSV)
vpict = max(rgbpict,[],3);
or if you want lightness (as in HSL)
lpict = min(rgbpict,[],3)/2 + max(rgbpict,[],3)/2;
If you want luma (as in YIQ, YUV, YPbPr, YCbCr, etc)
factors = permute([0.299 0.587 0.114],[1 3 2]); % Rec 470/601 (analog/digital SD video)
%factors = permute([0.2126 0.7152 0.0722],[1 3 2]); % Rec 709 (HDTV video)
ypict = sum(bsxfun(@times,rgbpict,factors),3);
If you want L* lightness (as in CIELAB, CIELUV)
Lpict = rgb2lightness(rgbpict); % introduced in R2019a
otherwise, you can use LAB conversion tools to extract it if you're running something older.

カテゴリ

Help Center および File ExchangeImport, Export, and Conversion についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by