Below is a graph of the distance (in pixels) that a ball travels following a strike from the cue vs. the strength exerted by the player on the cue.I recorded myself for about 10 minutes striking a red ball down the table (red for good contrast against the blue surface) at different strengths, some soft some hard. The shimmer was attached to the cue and reacted to a strike by a sudden spike in its data values, particularly on the y axis. The data was then processed by cutting before and after images of each shot out of the video and measuring the distance between the ball's positions, the shimmer data was exported to Excel (this resulted in approx 42,000 rows X 3 columns (x,y,z axes)). With Excel, by plotting graphs I identified the shots. While experimenting, to serve as a divider between each shot, I shook the cue vigorously. Once I identified the shots,I took the difference between the max and min values of y axis and plotted this vs. the distance calculated.
The following graphs illustrates this:
Shake
Monday, July 27, 2009
Final 4 weeks!
Well since the last time I wrote on this, midterm presentations are finished and we are now entering into the final 4 weeks of the programme!
The camera and shimmer are working well together and I've got some experimental results on distance and the force on the cue........finally!
I've just started to write some sections of my report so as not to leave it all to the last minute!
I hope to have a good working demo by the end of the next four weeks even though alot of work has to be done in the meantime!
What this demo will actually be is yet to be determined.....it'll be a surprise..... :)
The camera and shimmer are working well together and I've got some experimental results on distance and the force on the cue........finally!
I've just started to write some sections of my report so as not to leave it all to the last minute!
I hope to have a good working demo by the end of the next four weeks even though alot of work has to be done in the meantime!
What this demo will actually be is yet to be determined.....it'll be a surprise..... :)
Saturday, July 4, 2009
Update (03.07.2009)
Update..........
I have the camera set-up and pool table in position! I've finally had some success with the shimmer - I can now use it to calculate the angle of the cue to the table and it's also giving me some visual output, so now I know how the striking of a ball appears via the shimmer.
Distance can be measured (in pixels) by using the mouse to click on the two points you want to measure between. With some experimentation, 1 pixel is equivalent to approximatly 0.61cm. However, this is useless for measuring the distance the ball travelled, so camera tracking is now my main priority. Not only is it the best way to measure the distance the ball travelled on the table, it will also be essential when dealing with angles later,so it is a key ingredient to the success of the project.
Following this Fridays meeting with Benoit, we decided on trying to use matlab for camera tracking, if this is unsuccesful or taking too long, to look into using some other ways and output data we need to matlab such as distance & angle.
Fingers crossed......
I have the camera set-up and pool table in position! I've finally had some success with the shimmer - I can now use it to calculate the angle of the cue to the table and it's also giving me some visual output, so now I know how the striking of a ball appears via the shimmer.
Distance can be measured (in pixels) by using the mouse to click on the two points you want to measure between. With some experimentation, 1 pixel is equivalent to approximatly 0.61cm. However, this is useless for measuring the distance the ball travelled, so camera tracking is now my main priority. Not only is it the best way to measure the distance the ball travelled on the table, it will also be essential when dealing with angles later,so it is a key ingredient to the success of the project.
Following this Fridays meeting with Benoit, we decided on trying to use matlab for camera tracking, if this is unsuccesful or taking too long, to look into using some other ways and output data we need to matlab such as distance & angle.
Fingers crossed......
Monday, June 22, 2009
Camera Update
So this is as far as I've gotten with the camera:
By using the software that comes with the Panasonic camera, I successfully saved some video of me hitting the balls randomly around the table, and converting them to an avi file (Matlab can work with avi format)
I can now import this saved data and using Simulink, I can detect the edges, and overlay them onto a greyscale version of the video.
Overall I'm happy I got my problems resolved and now I can continue on with pixel analysis and also a top priority is to get pool table into position so I can mount the camera above it and record some quality data.
By using the software that comes with the Panasonic camera, I successfully saved some video of me hitting the balls randomly around the table, and converting them to an avi file (Matlab can work with avi format)
I can now import this saved data and using Simulink, I can detect the edges, and overlay them onto a greyscale version of the video.
Overall I'm happy I got my problems resolved and now I can continue on with pixel analysis and also a top priority is to get pool table into position so I can mount the camera above it and record some quality data.
Meeting with Benoit (19.06.2009
At today's meeting we discussed the problems I encountered with the networked camera during the week.
I became very bogged down this week in getting the ip camera to stream data into matlab.
From reading blogs & discussions online this is a very difficult task that people have spent alot of time mastering.
I successfully managed to import still frames but not video.
Today we decided to record maybe 15 minutes of data, save this and use this video to implement functions and methods.
I should be able to import this saved data into matlab without much difficulty.
Although this means I'm not working with realtime data, if I can get my methods to work,it's only a matter of a technical adjustment to get the data streaming in real time.
Fingers crossed.......
I became very bogged down this week in getting the ip camera to stream data into matlab.
From reading blogs & discussions online this is a very difficult task that people have spent alot of time mastering.
I successfully managed to import still frames but not video.
Today we decided to record maybe 15 minutes of data, save this and use this video to implement functions and methods.
I should be able to import this saved data into matlab without much difficulty.
Although this means I'm not working with realtime data, if I can get my methods to work,it's only a matter of a technical adjustment to get the data streaming in real time.
Fingers crossed.......
Friday, June 12, 2009
Meeting with Benoit and Lorcan (12/06)
At this meeting we looked forward at the coming four weeks and discussed the following work plan:
Week 1:
Get pool table in position, camera set up and Shimmer in (or on) cue.
Sort runtime errors with Shimmer and try and get and interpret accelerometer data
Decide on (and maybe order projector)
Week 2:
Analyze data from camera - edges, ball colour, distance etc.
Translate into data that can be used.
Week 3:
Plan formulas, methods to implement on matlab to calculate best shot. (I reckon this will take a while as it is important i get this right)
Week 4:
Implement on matlab.
Generate results, graphs etc.
While waiting for a resolution to problems with Shimmer software, we decided it would be best to get started with using matlab to detect a networked camera
and to get it to display data as a matix. Possibly using TWAIN? I will research this further.
With regards to a projector, one can be ordered. Or a potential work around would be to use one already on 3rd floor and imitate pool surface on a desk underneath it.
The projector will not be in use for another few weeks so ideas can still be trashed out on this subject! (comments welcome)
The positioning of the Shimmer is also interesting as we could strap it to the cue or to the hand of the player (it must be at easy access for recharging). Also in our meeting I was made aware of the complications the shimmer has with identifying each axis as its relative to the downward force of gravity although this could also be used to calculate the angle of the cue to the table, which would prove useful.
Other things discussed identified more areas of experimentation/research such as elasticity of table and quality of camera (i.e. would even one pixel out create a large enough error on a shot to miss it, especially on a long pot?)
The spin on the ball was also identified as an even more complicating factor so to begin with, I'll work with straight on shots to reduce spin.
Even more food for thought from this meeting included: painting the cue with a bright colour to identify it easily by camera.
I hope to have some coding and clear output by the end of this period; this may be too ambitious but I'll try!
Week 1:
Get pool table in position, camera set up and Shimmer in (or on) cue.
Sort runtime errors with Shimmer and try and get and interpret accelerometer data
Decide on (and maybe order projector)
Week 2:
Analyze data from camera - edges, ball colour, distance etc.
Translate into data that can be used.
Week 3:
Plan formulas, methods to implement on matlab to calculate best shot. (I reckon this will take a while as it is important i get this right)
Week 4:
Implement on matlab.
Generate results, graphs etc.
While waiting for a resolution to problems with Shimmer software, we decided it would be best to get started with using matlab to detect a networked camera
and to get it to display data as a matix. Possibly using TWAIN? I will research this further.
With regards to a projector, one can be ordered. Or a potential work around would be to use one already on 3rd floor and imitate pool surface on a desk underneath it.
The projector will not be in use for another few weeks so ideas can still be trashed out on this subject! (comments welcome)
The positioning of the Shimmer is also interesting as we could strap it to the cue or to the hand of the player (it must be at easy access for recharging). Also in our meeting I was made aware of the complications the shimmer has with identifying each axis as its relative to the downward force of gravity although this could also be used to calculate the angle of the cue to the table, which would prove useful.
Other things discussed identified more areas of experimentation/research such as elasticity of table and quality of camera (i.e. would even one pixel out create a large enough error on a shot to miss it, especially on a long pot?)
The spin on the ball was also identified as an even more complicating factor so to begin with, I'll work with straight on shots to reduce spin.
Even more food for thought from this meeting included: painting the cue with a bright colour to identify it easily by camera.
I hope to have some coding and clear output by the end of this period; this may be too ambitious but I'll try!
Wednesday, June 10, 2009
Review of "Building a 3D Model of a Snooker Table Using Computer Vision Final Report"
Building a 3D Model of a Snooker Table
Using Computer Vision
Final Report
Student Name: Hao, Guo
I was advised to read this report - Building a 3D Model of a Snooker Table using computer vision by Hao, Guo in DIT.
I found it very useful for my project.
The discussion about the the various software used in broadcasting such as FoxTrax Hockey Puck Tracking System, PISTE (which minimizes the usage of sensors or cameras, so as to reduce interference, and to create content at almost the same time as the event is carried out) and The Hawk-eye system (as used in Wimbledon) very interesting.
Hao discussed edge detection using gradient operators, hough transforms and Canny edge detection. Hough Transforms could be used for both circle and line detection which is especially useful when dealing with a game of pool!
In my reading to date, I've not yet found a better approach to identifying the edge of the table then this Hough Transform approach.
A potential improvement would be to put white strips alone the edge of the pool table to ease pick up by camera. It is also easy to get centre points on circle and radius which will be necessary for calculations later.
Thresholding and Contour Flowing are also discussed. With thresholding, a pixel is scanned and by the value of the pixel it can fall below or above the threshold or level set, and hence identifys shapes by assigning, for example, black to colours below threshold and white to those above. Contour Flowing can be used to detect any shaped objects.
Hao uses a method of PMI, which is basically listing the pros and cons of a particular method and adding some additional comments without rushing too quickly to a decision. In my opinion this is an excellent way of approaching and deciphering which method to choose and I shall use it for future decision making in my project
The remaining part of the dissertation deals with the software design and approach adapted (RAD in this case). This is irrelevant to me, and I couldn't implement the source code. However i did find some use in looking at this section, the layout of screen shots and graphs etc which will stand to me at the end of the project
Overall this was a good dissertation to read and so far in my research has been the most useful paper I've read.
Hopefully I'll find some more good ones!!!!
Using Computer Vision
Final Report
Student Name: Hao, Guo
I was advised to read this report - Building a 3D Model of a Snooker Table using computer vision by Hao, Guo in DIT.
I found it very useful for my project.
The discussion about the the various software used in broadcasting such as FoxTrax Hockey Puck Tracking System, PISTE (which minimizes the usage of sensors or cameras, so as to reduce interference, and to create content at almost the same time as the event is carried out) and The Hawk-eye system (as used in Wimbledon) very interesting.
Hao discussed edge detection using gradient operators, hough transforms and Canny edge detection. Hough Transforms could be used for both circle and line detection which is especially useful when dealing with a game of pool!
In my reading to date, I've not yet found a better approach to identifying the edge of the table then this Hough Transform approach.
A potential improvement would be to put white strips alone the edge of the pool table to ease pick up by camera. It is also easy to get centre points on circle and radius which will be necessary for calculations later.
Thresholding and Contour Flowing are also discussed. With thresholding, a pixel is scanned and by the value of the pixel it can fall below or above the threshold or level set, and hence identifys shapes by assigning, for example, black to colours below threshold and white to those above. Contour Flowing can be used to detect any shaped objects.
Hao uses a method of PMI, which is basically listing the pros and cons of a particular method and adding some additional comments without rushing too quickly to a decision. In my opinion this is an excellent way of approaching and deciphering which method to choose and I shall use it for future decision making in my project
The remaining part of the dissertation deals with the software design and approach adapted (RAD in this case). This is irrelevant to me, and I couldn't implement the source code. However i did find some use in looking at this section, the layout of screen shots and graphs etc which will stand to me at the end of the project
Overall this was a good dissertation to read and so far in my research has been the most useful paper I've read.
Hopefully I'll find some more good ones!!!!
Subscribe to:
Comments (Atom)


