Back to h(hue),s (situration) ,v to HSV color space

조회 수: 1 (최근 30일)
Nafees  Ahmad
Nafees Ahmad 2016년 5월 14일
댓글: Image Analyst 2016년 5월 14일
hai I am working on flame detection vedio...First I aplied backroud subtraction methon on each frame of vedio. first the frame value is in RGB.Then I convert Into hsv....Then I convert this hsv to seprate channel H,S and V.Now after the processing I want to this unique channles to convert in one matrix means back to hsv.
for l=1:1
frameForHsv = fc(:, :, :, l); %l is frame Number
hsvValues = rgb2hsv(frameForHsv );
for m=1:height
for n=1:width
h(m,n)=hsvValues(m,n,1);
s(m,n)=hsvValues(m,n,2);
v(m,n)=hsvValues(m,n,3);
if ((h(m,n)>=0 && h(m,n)<=60) && (s(m,n)>=0 && s(m,n)<=0.2)&&(v(m,n)>=127 && v(m,n)<=255) )
newH(m,n)=h(m,n);
newS(m,n)=s(m,n);
newV(m,n)=v(m,n);
else
newH(m,n)=0;
newS(m,n)=0;
end
end
end
% Now how to this seprate channel newH,newS and newV into one Channel HSV?
end
  댓글 수: 1
Image Analyst
Image Analyst 2016년 5월 14일
But those new images are masks. What do you intend to do with the masks? Maybe you should AND them together to get an overall mask. By the way, don't use for loops - it can be done faster vectorized in a couple of lines.

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2016년 5월 14일
cat(3, newH, newS, newV)

카테고리

Help CenterFile Exchange에서 Colormaps에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by