I have problem when using webcam to detect and track object by masking colors in HSV space. my code work well with yellow, green or blue color but red color.
I already define the threshold for these colors
please help me.
here is my code
% red
hueThresholdLowred1 = 0.05; hueThresholdHighred1 = 0.97; saturationThresholdLowbred1 = 0.3; saturationThresholdHighred1 = 1; valueThresholdLowred1 = 0.01; valueThresholdHighred1 = 1;% find red color
hueMaskred1 = (hImage1 <= hueThresholdLowred1)&(hImage1 >= hueThresholdHighred1); saturationMaskred1 = (sImage1 >= saturationThresholdLowbred1) & (sImage1 <= saturationThresholdHighred1); valueMaskred1 = (vImage1 >= valueThresholdLowred1) & (vImage1 <= valueThresholdHighred1); redObjectsMask1 = hueMaskred1 & saturationMaskred1 & valueMaskred1;
Best Answer