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

1 visualizzazione (ultimi 30 giorni)
Nafees  Ahmad
Nafees Ahmad il 14 Mag 2016
Commentato: Image Analyst il 14 Mag 2016
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 Commento
Image Analyst
Image Analyst il 14 Mag 2016
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.

Accedi per commentare.

Risposte (1)

Walter Roberson
Walter Roberson il 14 Mag 2016
cat(3, newH, newS, newV)

Categorie

Scopri di più su Colormaps in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by