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
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 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Colormaps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!