s huffleboard s corekeeper d esign r eview tim myers dan stella eric beisecker

25
SHUFFLEBOARD SCOREKEEPER DESIGN REVIEW Tim Myers Dan Stella Eric Beisecker

Upload: george-paul

Post on 15-Jan-2016

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: S HUFFLEBOARD S COREKEEPER D ESIGN R EVIEW Tim Myers Dan Stella Eric Beisecker

SHUFFLEBOARD SCOREKEEPERDESIGN REVIEW Tim Myers

Dan Stella

Eric Beisecker

Page 2: S HUFFLEBOARD S COREKEEPER D ESIGN R EVIEW Tim Myers Dan Stella Eric Beisecker

OUTLINE

Project Overview User Interface GUI Design Camera Cradle Design Technologies Run Time Operation Scoring and Image Processing Testing Strategy Difficulties Current Progress Questions

Page 3: S HUFFLEBOARD S COREKEEPER D ESIGN R EVIEW Tim Myers Dan Stella Eric Beisecker

SHUFFLEBOARD SCOREKEEPER – OVERVIEW Scores shuffleboard rounds

automatically. Game score and statistics are

displayed on an LCD Display. The Scorekeeper keeps track

of the action using two cameras connected to a PC to determine position of the pucks and their scoring value.

Players interface with the scorekeeper to start games and check high scores using a USB keypad.

Table-mountable system for use with multiple shuffleboard tables.

Shuffleboard Scorekeeper Cutaway view with clamps

Page 4: S HUFFLEBOARD S COREKEEPER D ESIGN R EVIEW Tim Myers Dan Stella Eric Beisecker

SHUFFLEBOARD SCOREKEEPER – DIAGRAMS

Shuffleboard Scorekeeper Side ViewShuffleboard Scorekeeper Block Diagram

Shuffleboard Scorekeeper Top View

Page 5: S HUFFLEBOARD S COREKEEPER D ESIGN R EVIEW Tim Myers Dan Stella Eric Beisecker

USER INTERFACE Users will interact

with the Shuffleboard scorekeeper using a USB Keypad.

One keypad for each side of the table

Text entry is done using a “phone style” key combination.

Situational buttons ensure “scorekeeping errors” can be handled easily.

Page 6: S HUFFLEBOARD S COREKEEPER D ESIGN R EVIEW Tim Myers Dan Stella Eric Beisecker

GUI - DESIGN PROBLEMS

Users will be navigating the GUI with a keypad

Users will be standing five feet away from the screen

Page 7: S HUFFLEBOARD S COREKEEPER D ESIGN R EVIEW Tim Myers Dan Stella Eric Beisecker

GUI - SOLUTIONS

Use a minimalistic design Make selected object obvious, bright colors,

large fonts Keep GUI flow logical

Page 8: S HUFFLEBOARD S COREKEEPER D ESIGN R EVIEW Tim Myers Dan Stella Eric Beisecker

GUI DESIGN FLOW CHART

Page 9: S HUFFLEBOARD S COREKEEPER D ESIGN R EVIEW Tim Myers Dan Stella Eric Beisecker

CAMERA CRADLE DESIGN

Unobtrusive to game play Sturdy for camera

support “Oversized cross beam”

is bolted in place for flexibility

Page 10: S HUFFLEBOARD S COREKEEPER D ESIGN R EVIEW Tim Myers Dan Stella Eric Beisecker

TECHNOLOGIES AForge

C# based - Similar to java Robust library of image processing classes Includes video capture classes Excellent demo programs Free!

SQL Keep track of users to remember scores Easy C# interface Transferability Free!

Page 11: S HUFFLEBOARD S COREKEEPER D ESIGN R EVIEW Tim Myers Dan Stella Eric Beisecker

RUN TIME OPERATION Separate Tasks

Each side of the table has a camera Cameras have different tasks depending on turn Observing motion vs. scoring Cameras switch tasks on turn change

Scoring Task Observe changes in puck position Score based on puck position

Motion Task Detect puck “toss” Signal scoring task to score current puck

positions.

Page 12: S HUFFLEBOARD S COREKEEPER D ESIGN R EVIEW Tim Myers Dan Stella Eric Beisecker

WHAT’S BEHIND THE SCORING

Several different image processing techniques can be used to separate the playing field into components that can be represented separately. Scoring Lines Table Edges Puck centers

Once each component set is available for observation the locations of each item can be compared to one another to determine relative location.

The relative location can then be used to determine how close each puck is to one another and where each puck is located on the overall playing field.

Before the game begins, an initial frame of the table will be taken and then processed in order to establish the scoring lines and table boundaries that will be used for scoring. This is the initial calibration and happens on startup.

A single frame will be taken from both cameras, one at a time, and then analyzed.

Page 13: S HUFFLEBOARD S COREKEEPER D ESIGN R EVIEW Tim Myers Dan Stella Eric Beisecker

CLEAN ½ TABLE SHOT

Page 14: S HUFFLEBOARD S COREKEEPER D ESIGN R EVIEW Tim Myers Dan Stella Eric Beisecker

ESTABLISHING THE SCORING LINES

The initial playfield frame will be processed with an edge detection algorithm.

The edge detection algorithm will show the edges of the table, the edges of the actual playfield, and the edges between each end of a scoring line and the table.

After the edge detection algorithm, a vertical line detection algorithm and a horizontal line detection algorithm is run on the new frame.

The horizontal lines will be the edges of the scoring lines, the actual playfield to the gutter, and gutter to the table wall, and the vertical lines the edges of the actual playfield to the gutter and the gutter to the table wall.

If using the knowledge that viewing the pixels from the center towards the edges, the first vertical lines reached are the gutter edges, the gutters can be located.

On top of this the boundaries of the scoring lines can be determined. Their length as well as their width(The area in between their respective edges) can be used to determine their slope and thickness.

Page 15: S HUFFLEBOARD S COREKEEPER D ESIGN R EVIEW Tim Myers Dan Stella Eric Beisecker

EDGE DETECTED TABLE SHOT

Gutter Edge

ScoringLine Center

Page 16: S HUFFLEBOARD S COREKEEPER D ESIGN R EVIEW Tim Myers Dan Stella Eric Beisecker

THE ALGORITHM

The algorithm to determine bounds will use three different images. The original color image The horizontal line image The vertical line image

All three images will share “coordinates” so a single pixel is essentially represented in three different ways.

Starting from the top and the center of the frame every column will be trolled for horizontal lines as long as the current pixel is not the color of the gutter (green) in the color image.

The columns will be searched until the current pixel is also a vertical pixel in the vertical line image. This means that the gutter end is reached.

All of the separate line data is then stored to have their slopes and “coordinate” locations kept for referencing later without needing to re-establish any boundary lines.

Page 17: S HUFFLEBOARD S COREKEEPER D ESIGN R EVIEW Tim Myers Dan Stella Eric Beisecker

THREE SHOT EXAMPLE

Page 18: S HUFFLEBOARD S COREKEEPER D ESIGN R EVIEW Tim Myers Dan Stella Eric Beisecker

THE ACTUAL SCORING Since the boundaries of the playing field and the scoring lines are kept.

Scoring a zone is pretty simple. Once notified by the motion task, the frame will be taken and color

detected for both red and then blue to get the puck colors. These locations are then compared to the stored boundaries to get relative locations.

The puck closest to the bottom table edge will earn points for that team for every puck they have closer than the first puck of the opposite color. The locations of the pucks are compared to the scoring lines and the other pucks to determine the overall score.

Normal Frame Blue Color Detect Red Color Detect

Stored Edge lines Closest Puck

Page 19: S HUFFLEBOARD S COREKEEPER D ESIGN R EVIEW Tim Myers Dan Stella Eric Beisecker

TESTING STRATEGY Unit Testing

NUnit Write tests to ensure proper

functioning of code Easy detection of failure due to

code changes Integration Testing

Write user stories for different play scenarios

Maximum coverage of edge cases and possible player actions

Manual Execution

Page 20: S HUFFLEBOARD S COREKEEPER D ESIGN R EVIEW Tim Myers Dan Stella Eric Beisecker

DIFFICULTIES Image Processing

Puck Detection Scoring Turn Detection (Motion) Hangers

Puck Collisions “KnockOffs”

Cameras Capture Speed Resolution

Page 21: S HUFFLEBOARD S COREKEEPER D ESIGN R EVIEW Tim Myers Dan Stella Eric Beisecker

SITUATIONAL DIFFICULTIES

1.) Differentiating colors Reason: Could blur edge lines and possibly lose the edge of

the table or scoring lines. Solution: LED Lights, and carefully selected paint colors

2.) Poor camera angle Reason: Losing horizontal or vertical lines due to the angle

they are at. Solution: Tightly Fixed Cradles

3.) Camera shaking/Table being knocked mid turn Reason: The scoring lines won’t be calibrated every puck

throw in order to save processing time. Solution: Tightly Fixed Cradles, possible recalibration

between rounds, and an option to recalibrate/rescore.

Page 22: S HUFFLEBOARD S COREKEEPER D ESIGN R EVIEW Tim Myers Dan Stella Eric Beisecker

CURRENT PROGRESSTask Completion Deadline

Color Detection/ Puck location

90% 9/10/08

Boundary Creation 50% 9/10/08

Actual Scoring 0% 9/25/08

GUI Design 100% 7/9/08

GUI Prototype 100% 7/18/08

Full GUI Implementation

45% 10/24/08

Turn Tracking 5% 10/6/08

Motion Detection 90% 9/10/08

Stat Calculation 20% 10/20/08

Page 23: S HUFFLEBOARD S COREKEEPER D ESIGN R EVIEW Tim Myers Dan Stella Eric Beisecker

CURRENT PROGRESS

Page 24: S HUFFLEBOARD S COREKEEPER D ESIGN R EVIEW Tim Myers Dan Stella Eric Beisecker

FUTURE ENHANCEMENTS Database of Users

Keep track of player scores for multiple games Additional Statistics

Number of wins, loses, playtime, average score, etc. Playing Music

Play music during game play Player Icons

Customized icons associated with player names Tournament Support

Option to support elimination tournaments instead of single games

Additional Lighting Add lights to camera cradle to ensure proper lighting

Page 25: S HUFFLEBOARD S COREKEEPER D ESIGN R EVIEW Tim Myers Dan Stella Eric Beisecker

QUESTIONS?