Good Method for Processing some Similar Images

I need to process some images in a real-time situation. I am receiving the images from a camera using OpenCV. The language I use is C++. An example of the images is attached. After applying some threshold filters I have an image like this, Of course there may be some pixel noises here and there, but not that much.

I need to detect the center and the rotation of the squares, and the center of the white circles. I'm totally clueless about how to do it, as it needs to be really fast. The number of the squares can be predefined. Any help would be great, thanks in advance.


Is the following straight forward approch too slow?

  • Binarize the image, so that the originally green background is black and the rest (black squares are white dots) are white.
  • Use cv::findContours.
  • Get the centers.
  • Binarize the image, so that the everything except the white dots is black.
  • Use cv::findContours.
  • Get the centers.
  • Assign every dot contours to the squate contour, for that is an inlier.
  • Calculate the squares rotations by the angle of the line between their centers and the centers of their dots.
  • 链接地址: http://www.djcxy.com/p/13970.html

    上一篇: 识别图像中的数字(Matlab)

    下一篇: 处理一些相似图像的好方法