Borrar filtros
Borrar filtros

Color Blue is not getting detected

2 visualizaciones (últimos 30 días)
Emmanuel
Emmanuel el 13 de Jun. de 2014
Comentada: Emmanuel el 1 de Jul. de 2014
Hi all! I am tracking R,G and B colors and the threshold value I have given to blue is 0.15 and its not getting detected and tracked. I use a dark blue marker. Can you please help me out with thids?

Respuestas (1)

Image Analyst
Image Analyst el 13 de Jun. de 2014
Try adjusting the thresholds or use a different color space. See my color segmentation demos in my File Exchange: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862. Post an image you're having trouble with along with your blue detection code in a simple script designed to work on that image.
  1 comentario
Emmanuel
Emmanuel el 1 de Jul. de 2014
Hi..Sorry for the late reply!
diffblue = imsubtract(data(:,:,3),rgb2gray(data));
diffblue2 = imsubtract(data2(:,:,3),rgb2gray(data2));
diffblue = im2bw(diffblue, 0.15);
diffblue2 = im2bw(diffblue2, 0.15);
diffblue = bwareaopen(diffblue , 300);
diffblue2 = bwareaopen(diffblue2 , 300);
bwblue = bwlabel(diffblue , 8);
bwblue2 = bwlabel(diffblue2 , 8);
statsblue = regionprops(bwblue, 'BoundingBox', 'Centroid');
statsblue2 = regionprops(bwblue2, 'BoundingBox', 'Centroid');
The bounded boxes are detected by right camera and dotted boxes by left camera.Here you can see that I have to use external light and make sure that this light doesn't fall on red, otherwise, red goes undetected and threshold for red is 0.18. Please help me as to how can I reduce the dependency of external light and what kind of threshold will be apt for blue?

Iniciar sesión para comentar.

Categorías

Más información sobre Get Started with Image Processing Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by