How to find X and O using Image Processing toolbox?
Mostra commenti meno recenti

Dear All,
here is my problem: I have an image with X and O (of different colors) and I need to determine the position of such objects. Precisely, I want to obtain the centers of the circles and the ones of the crosses.
So far, I was able to do it for the circles using imfindcircles. Any idea? I should mention that each object has fixed dimension.
Best, Michele
Risposta accettata
Più risposte (1)
yonatan gerufi
il 11 Nov 2014
Modificato: yonatan gerufi
il 11 Nov 2014
0 voti
if the X and O have fixed dimension and shape, is to build a mask for X and mask for O, and run it on the picture.
2 Commenti
Michele Berra
il 11 Nov 2014
yonatan gerufi
il 11 Nov 2014
Modificato: yonatan gerufi
il 11 Nov 2014
first you should do your picture to binary one using "im2bw". (make sure you pick a threshold that doesn't turn X & O to zeros)
crop small rectangle around the X, and one around O. those are your masks.
now, you should run all over the picture, and sum the matrix results from multiplying the mask with the current part of the picture (a.k.a 2D convolution) this will give you a value, that will be high if the picture and mask are correlated, and you have an X or O pattern.
hopefully it is understandable. regards.
Categorie
Scopri di più su Image Segmentation in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!