How to find X and O using Image Processing toolbox?
显示 更早的评论

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
采纳的回答
更多回答(1 个)
yonatan gerufi
2014-11-11
编辑:yonatan gerufi
2014-11-11
0 个投票
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 个评论
Michele Berra
2014-11-11
yonatan gerufi
2014-11-11
编辑:yonatan gerufi
2014-11-11
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.
类别
在 帮助中心 和 File Exchange 中查找有关 Image Segmentation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!