Region of a tracking object in a Image

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!

 Respuesta aceptada

Image Analyst
Image Analyst el 11 de Mzo. de 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 comentarios

Adem Kikaj
Adem Kikaj el 11 de Mzo. de 2015
Sorry can you be more specific please, Im new in Matlab!
Image Analyst
Image Analyst el 11 de Mzo. de 2015
I was going to ask you the same thing. Define EXACTLY what "find" means to you. Do you just want an image with only white pixels? Even with the square under the horse all white as if the horse were not there?
Adem Kikaj
Adem Kikaj el 12 de Mzo. de 2015
I have this image, I want to save information of every square in this chess board, I read the image than I track every square and I want somehow to save square (1,1) in a variable, than from that variable I want to see what's in there a horse or something else or nothing.
Image Analyst
Image Analyst el 12 de Mzo. de 2015
Please give a sample output. What do you mean by "track"? It's not moving, right? Do you mean that for any given image you just want an Excel workbook or a text file that is an 8 by 8 array of names chosen from a list of possible names like "horse", "unicorn" "rook", "empty", "King", "pawn", etc. And if there is "something else", what distinguishes them? The area, the color, the shape? You want to pick and use the simplest thing, which might be area if all the shapes are perfect (like computer graphics rather than an actual photograph). Is this homework or a class project? Because it seems to simple and idealized to be an actual real world project.
Adem Kikaj
Adem Kikaj el 12 de Mzo. de 2015
I have a static camera which makes photo like this:
From this image I want to detect squares one by one, and have an information which one is First(1,1), Second(1,2) and so on.
Then let's suppose I have this image after a sequence of images:
So now I have a redpoint in First(1,1), and how to detect and save this information, also I want to know that's a red circle in position (1,1) and then I extract in a Excel workbook.
P.s is a individual Project, and camera will be static and makes static photos.
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

Iniciar sesión para comentar.

Más respuestas (0)

Preguntada:

el 11 de Mzo. de 2015

Comentada:

el 12 de Mzo. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by