Region of a tracking object in a Image
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Adem Kikaj
am 11 Mär. 2015
Kommentiert: Image Analyst
am 12 Mär. 2015

Hi everyone, i wanted to ask if I have a photo like this can I somehow find the white area now if I preliminarily find the red 'horse' and to have a message like 'The red horse is in 1x1 square'.
Thanks!
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 11 Mär. 2015
Yes you can. To find the white squares, you don't even need to preliminarily find the red horse. You simply need to do
whiteSquares = rgbImage(:,:,1)>128;
See color segmentation demos in my file exchange: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862
6 Kommentare
Image Analyst
am 12 Mär. 2015
Get the blue channel
blueChannel = rgbImage(:,:,3);
See if it has a low value, meaning it's red, or a high value, meaning the square is white
for k = 1 : length(row)
if blueChannel(row(k), column(k)) < 128
% Low blue signal so there must be the red disc on it.
redChips(k) = true;
else
% High blue signal so the square must be white.
redChips(k) = false;
end
end
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Image Processing Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

