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!