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.

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.......

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!

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!!!!

Monday, June 8, 2009

To Do List

Things to do this week:
(Wk starting 08/06/2009)

Read and search for some papers - this should help me get a feel for the subject and give me some ideas......hopefully!

Set up and get some data from the camera - having already selected the camera I'm going to use, I NEED to test it.

Shimmers - install software, figure out how to work them, get data from them. (blog to come on this!)

Set up my environment - put the pool table in an appropriate place and mount the camera above it.

Get new projector or move existing projector above pool table similar to camera

Take note of any equipment I need to source

Install LaTeX


Undoubtedly, unexpected problems will crop up when setting up this equipment and getting data from it. Hence why I'm giving it quite a large time scale......but hopefully I'll get more achieved this week! I'll be sure to update this if I do!

And so it begins.......

ODCSSS 2009 has been running for a week, and now the hard work is about to begin.


My project is entitled: Learn to play like Minesota Fats: augmented
reality in the pool hall, under the supervision of Dr. Lorcan Coyle and is situated in UCD.


I will briefly explain my understanding of the project and what I hope to accomplish:

Pool, snooker or billiards are all quite similar and challenging games with a large amount of factors to be considered and mastered to make a perfect shot - accuracy in hitting the cue ball, force to hit cue ball, best way to hold and use the cue, angle to hit the subject ball at etc......
With the aid of varying amounts of equipment: the pool table (obviously), camera(s), shimmers, projectors, laser(s) (and maybe some more), I aim to really get to grips with the physics of pool. To study the forces and collisions involved using the data took from the camera(s) and shimmers. I will use numerical packages to do my number crunching and develop graphs to filter and accumulate the data. Once I have a clear understanding, this can then be used to determine the best possible shot - and hence be used to educate the player.
With long term use, this should improve the skill of the player.

Initially my priority is not to develop a 3D GUI of the pool hall, but to really understand the shot in question, and using the projector and/or lasers to help the player i.e. follow a line projected onto the table to obtain that perfect shot, or the laser to indicate where they should hit the cue ball etc.


Ideally I hope to develop a good pool tutor that could be used successfully in the real world with minimal technicality.

In general, I look forward to the remaining 11 weeks in the ODCSSS program. I hope to make some great friends, learn and absorb as much knowledge as I can and really get a feel for researching!

Heres hoping it all goes to plan!!!!!