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!