Tuesday 10 April 2012

Getting and Using the Pocket Co-ordinates

The Pockets were marked as 1's on the 2-d map of the table. Only the Corner pockets were found, not the centre pockets as these could be added later.

The table was split into quarters as it was assumed the image taken would be close enough to the table so that each pocket would be in a quarter of the image.

The image was then scanned and the 4 corner pockets were found and saved in two arrays; One which stored the X co-ordinates and one which stored the Y Co-ordinates.

Theta (for Rotation) = arctan(Ytopright-Ytopleft)/(Xtopright-Xtopleft)

Xshift = Xtopleft, Yshift = Ytopleft

resize X = Xbottomright

resize Y = Ybottomright

Chris

No comments:

Post a Comment