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

1 次查看(过去 30 天)
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 中查找有关 Blue 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by