OpenCv on Darts Game
Message-ID:<1985f2a7-4519-4828-8f4f-a14a42604279@i24g2000prf.googlegroups.com>
Subject:
OpenCv on Darts Game
Date:Fri, 30 Jan 2009 16:46:33 +0100
hi all, I have to use again OpenCv library to realize a program to recognize in automatic the score in the Darts game [1] I need your help to plan the logical steps to achieve my goal (count the score in the Darts game) I will use 1 webcam focused on the darts table.(I think that the position of the webcam is fundamental) So i would like to ask what kind of pixel manipulation (filtering, pattern recognition) could i apply to recognize where arrows are and conseguentely the score following the rules in the wikipage [1] ? Thanks in advance D'Anna Orazio [1] http://en.wikipedia.org/wiki/Darts
Message-ID:<4983366f$1@news.arcor-ip.de>
Subject:
Re: OpenCv on Darts Game
Date:Fri, 30 Jan 2009 18:18:36 +0100
You could (assuming the dartboard has fields composed of 2 colors),
as speed is not in question, do something like:
initialization:
0. acquire an image of the dartboard without any darts on it
1. threshold the image by color 1
1.1 find the connected components
2. threshold the image by color 2
2.1 find the connected components
3. throw one calibration dart
3.1 acquire image and make difference-image with image from 0.
3.2 identify position with biggest change (this is an extreme
oversimplification, if at all then only holding if the cam-direction
is orthogonal to the dartboard)
3.3 search through list of connected components for component
on this position
4. initialize memory map with same size as image and set all pixels
in this component-area to the score
5. search through all the components and find the nearest neighbours
(centroid-distances), give them their scores (register it in the
map).
repeat until all components are done. after that, all components
have their scores. (use a recursive function or stack).
in game:
1. same as 3.
2. same as 3.1, but use last image for differencing,
beginning with image from 0.
3. same as 3.2
4. just look in memory map on the position and print score
There are functions in OpenCV for every step...
greets
jb
Message-ID:
Subject:
Re: OpenCv on Darts Game
Date:Sat, 31 Jan 2009 21:08:21 +0100
> hi all, > I have to use again OpenCv library to realize a program to recognize > in automatic the score in the Darts game [1] > I need your help to plan the logical steps to achieve my goal (count > the score in the Darts game) > I will use 1 webcam focused on the darts table.(I think that the > position of the webcam is fundamental) > So i would like to ask what kind of pixel manipulation (filtering, > pattern recognition) could i apply to recognize where arrows are and > conseguentely the score following the rules in the wikipage [1] ? An idea that might need 2 cameras because of one dart covering another, but it's easy(ish) to do:- Place a camera on the ceiling or floor looking at the board at an acute angle. Calibrate the board by hand, by creating an ellipse drawing program and simply cover the boards edge and record this ellipse.. This can be automated if you want - but do that later. My guess is it would have to be really accurate though. Set up the software so you can detect changes from empty board to darted. The furthest change point is the tip of the buried dart head for each dart, beacuase of the acute angle used. Use the relative point position to the ellipse and calculate the dart position. You'll need a high res camera that keeps focus across the board too. Just an idea...maybe crap.... : ) VC
Message-ID:<bac42f56-77c4-492c-98e5-ed7ce51bb30f@b16g2000yqb.googlegroups.com>
Subject:
Re: OpenCv on Darts Game
Date:Mon, 9 Feb 2009 00:18:10 +0100
On Jan 31, 9:08=A0pm, "VelociChicken" <b...@yahoob.com> wrote: > > hi all, > > I have to use again OpenCv library to realize a program to recognize > > in automatic the score in the Darts game [1] > > I need your help to plan the logical steps to achieve my goal (count > > the score in the Darts game) > > I will use 1 webcam focused on the darts table.(I think that the > > position of the webcam is fundamental) > > So i would like to ask what kind of pixel manipulation (filtering, > > pattern recognition) could i apply to recognize where arrows are and > > conseguentely the score following the rules in the wikipage [1] ? > > An idea that might need 2 cameras because of one dart covering another, b= ut > it's easy(ish) to do:- > =A0Place a camera on the ceiling or floor looking at the board at an acut= e > angle. > =A0Calibrate the board by hand, by creating an ellipse drawing program an= d > simply cover the boards edge and record this ellipse.. This can be automa= ted > if you want - but do that later. My guess is it would have to be really > accurate though. > =A0Set up the software so you can detect changes from empty board to dart= ed. > =A0The furthest change point is the tip of the buried dart head for each = dart, > beacuase of the acute angle used. > =A0Use the relative points position to the ellipse and calculate the dart > position. > =A0You'll need a high res camera that keeps focus across the board too. > > Just an idea...maybe crap.... =A0 =A0: ) > > VC Hi VC and JB. thanks a lot for your reply. To do some trial i took photos of my professional dartboard(which is used during the world champion) from an acute angle(i fixed a photocamera not in front of the dartboard but in the left side to take exaclty the Board that is attached on a red door ).So that input-image is in the RGB space. I realized a little program that simply draws an Elllipse on the original image by using a hand-rectangle as exactly as possible.i obtained this rectangle as image and i extracted the ellipse inside it. Then i processed this ellipse image via Canny and Normal and Adaptative Threshold, i combined the result to obtain a binary image which contain only the section of dartboard without any number . Of course the previous speech doesn't consider the acute angle of the camera because we try to map the original acute ellipse to an Ellipse in the plane XY so maybe some error would happen during the counting score. Now i have to label the sectors of the final Binary image just to record the score-points that i have to assigned if a Dart arrive on that section. I don't know how to do it. sometime i can't find some relative point corrisponding to the dart head because it is black like some sector of the dartboard...So i think that i have to do something at the beginning to increase the contrast or something like this... Right in this way? I hope You can help me Greets Orazio D'Anna
Message-ID:<bac42f56-77c4-492c-98e5-ed7ce51bb30f@b16g2000yqb.googlegroups.com>
Subject:
Re: OpenCv on Darts Game
Date:Mon, 9 Feb 2009 00:18:10 +0100
On Jan 31, 9:08=A0pm, "VelociChicken" <b...@yahoob.com> wrote: > > hi all, > > I have to use again OpenCv library to realize a program to recognize > > in automatic the score in the Darts game [1] > > I need your help to plan the logical steps to achieve my goal (count > > the score in the Darts game) > > I will use 1 webcam focused on the darts table.(I think that the > > position of the webcam is fundamental) > > So i would like to ask what kind of pixel manipulation (filtering, > > pattern recognition) could i apply to recognize where arrows are and > > conseguentely the score following the rules in the wikipage [1] ? > > An idea that might need 2 cameras because of one dart covering another, b= ut > it's easy(ish) to do:- > =A0Place a camera on the ceiling or floor looking at the board at an acut= e > angle. > =A0Calibrate the board by hand, by creating an ellipse drawing program an= d > simply cover the boards edge and record this ellipse.. This can be automa= ted > if you want - but do that later. My guess is it would have to be really > accurate though. > =A0Set up the software so you can detect changes from empty board to dart= ed. > =A0The furthest change point is the tip of the buried dart head for each = dart, > beacuase of the acute angle used. > =A0Use the relative points position to the ellipse and calculate the dart > position. > =A0You'll need a high res camera that keeps focus across the board too. > > Just an idea...maybe crap.... =A0 =A0: ) > > VC Hi VC and JB. thanks a lot for your reply. To do some trial i took photos of my professional dartboard(which is used during the world champion) from an acute angle(i fixed a photocamera not in front of the dartboard but in the left side to take exaclty the Board that is attached on a red door ).So that input-image is in the RGB space. I realized a little program that simply draws an Elllipse on the original image by using a hand-rectangle as exactly as possible.i obtained this rectangle as image and i extracted the ellipse inside it. Then i processed this ellipse image via Canny and Normal and Adaptative Threshold, i combined the result to obtain a binary image which contain only the section of dartboard without any number . Of course the previous speech doesn't consider the acute angle of the camera because we try to map the original acute ellipse to an Ellipse in the plane XY so maybe some error would happen during the counting score. Now i have to label the sectors of the final Binary image just to record the score-points that i have to assigned if a Dart arrive on that section. I don't know how to do it. sometime i can't find some relative point corrisponding to the dart head because it is black like some sector of the dartboard...So i think that i have to do something at the beginning to increase the contrast or something like this... Right in this way? I hope You can help me Greets Orazio D'Anna



RSS News Feed