开发者

Extracting positions on a grid from image

开发者 https://www.devze.com 2023-02-22 16:49 出处:网络
I am looking for input on what topics to study in order to try to do the following: Pictures of an 8-by-8 chess board contains \"coins\" of two different colors. Now I want to

I am looking for input on what topics to study in order to try to do the following:

Pictures of an 8-by-8 chess board contains "coins" of two different colors. Now I want to "read off" the configuration 开发者_运维技巧on the board from the different image files reconstrcting the placement of the coins in a data structure.

I was not sure what the correct tag for this question was.


If you know python, have a look at this library:

http://pythonvision.org/basic-tutorial

It's very easy to start working with, and should be able to do what you are trying to do. The technique is called "Morphological Image Processing".

The general topic area is computer vision, and a very powerful library which can be used from many languages is OpenCV (http://opencv.willowgarage.com/wiki/).

If you can link some sample images I may be able to give better advice, but as a first idea, I would try to do this sequence:

  1. Use color thresholds to isolate the two types of coins from the two types of squares.
  2. Generate an image with the coins removed and holes filled in with surrounding color (i.e. empty board)
  3. Threshold to separate light from dark squares
  4. Erode to find center of each square
  5. Now go back to coins images, find center of each coin.
  6. Assign each coin to the square whose center is closest to it's center.


Extracting positions on a grid from image

0

精彩评论

暂无评论...
验证码 换一张
取 消