how to change rgb to [ Hue1, Hue2, Sat1, Sat2, Val1, Val2 ]
조회 수: 1 (최근 30일)
이전 댓글 표시
% Color = [ Hue1, Hue2, Sat1, Sat2, Val1, Val2 ] ///// 1 is lower limit % and 2 is upper limit
댓글 수: 0
답변 (1개)
DGM
2023년 3월 11일
The question is either incomplete or malformed; I can't tell which. You're asking how to change an RGB image to a range of HSV values.
On one hand, that description makes one think of the obvious.
inpict = imread('peppers.png');
hsvpict = rgb2hsv(inpict);
hsvmin = squeeze(min(hsvpict,[],[1 2]));
hsvmax = squeeze(max(hsvpict,[],[1 2]));
hsvrange = [hsvmin hsvmax]
... but there's two problems with this. First is the fact that H is circular. Calculating the min and max alone does not tell us where the H content lies. Second, the question describes these as limits, suggesting that these are not properties of the image, but parameters for some operation applied to the image. I could guess that the actual question is How do I do color-based segmentation in HSV, but that was never asked, and it could just as easily be any number of other things.
Either way, we'll never know.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Annotations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!