Graphical User Interface: Problems and Deliverables
Deliverables:
The GUI needs to be functional in its operation in linking the user to the algorithms and calculations contained within the application. This needs to be simple and intuitive to use for a new user and appealing and easy pleasing to a regular user.
The GUI also acts as the controller for the other functions (Image Capture and Geometry) and calls them when the user requires them and uses info from them to tell the user if the shot is going to be a hit or miss.
The GUI will also take the information from the geometry, and passes it on to the user in the form of a ‘beep’. This ‘beep’ will be calibrated so that the gaps get smaller the closer the shot is to the pocket, until a constant ring when the shot will be a hit.
Expected Problems:
• Application runs too slowly for it to be useable, time will need to be spent improving the speed and reduce the size of the program.
• Bugs in the code prevent it from running; time will need to be spent testing program and all possibilities within it to weed out problems.
Potential Problems:
• Information passed to Image capture is wrong or not detailed enough.
• Information from Geometry is wrong or incorrect.
• Design is not functional or eye catching
• Completion of code does not meet time schedule
• The GUI is functional, but when other sections are added it no longer is.
Information to be passed to Image Capture:
• Turning on the camera and preparing it for image capture
Information to be received from Geometry:
• Whether the shot is going to be a hit or miss
• If the shot is a miss, the distance the shot is away from the pocket
Steps in the Design and Implementation of the GUI:
• Two Algorithms designed, one which starts with user and ends with image capture and another which starts with geometry and ends with ‘beep’ to user.
• A design drawn out and agreed upon
• Design created and coded, as an empty shell with no functions within
• Design approved
• Main function added i.e. Screen shows the image seen by the camera and the image capture function is called upon.
• Noise alert function added
• Noise alert function tested using self inputted numbers
• Noise alert implemented with numbers from Geometry function
• Testing application with full implementation of the image capture and geometry.
Optional Extras:
• Options menu for user to personalize the way the application is run or shown
• Recorded statistics for the users hit, miss ratio etc
• Use of accelerometer within the phone to make sure the phone is flat
• Use of web server to display the image seen by the camera on a computer screen, and line of the expected path plotted
|
Algorithm for the GUI |
Image Capture and analysis: Problems and Deliverables
Deliverables:
The image capture and analysis needs to efficiently obtain an image using the mobile phones camera when held above the pool table. Once this image has been captured the analysis can be undertaken. From the image analysis the table’s dimensions such as the edges and pockets need to be defined. Also each ball needs to be located on the table and each ball differentiated from each other, the angle and direction of the cue need to be defined. All this information must be sent to the geometry calculation section so the shot assistant can be calculated.
Problems
• Not enough of the table is ‘in view’ using the camera so the shot cannot be predicted when the data is passed to the geometry calculation.
• Data from the image analysis could be in the wrong format for the geometry calculations
• None of the balls could be detected.
• The mobile phone is not level so that the image analysis creates incorrect locations for the balls and cue.
• Mobile phone is moved about to much so that an accurate image could not be taken
·
Information to be sent to Geometry Calculations:
The geometry calculation sections will need the following information so that the calculations for the shot can be executed. They are;
• The table’s dimensions such as the boundary of the table and the location of each of the pockets.
• The different ball types such as the difference between the coloured and striped balls and the cue ball which is white.
• Ball location, the position at which each ball is on the table.
• The initial cue angle held by the player.
Information to be sent to the GUI:
• The new image needs to be displayed on the screen of the mobile phone.
• If the image being captured is not big enough for the full analysis I.e. the edges of the table of pockets could not be seen.
Information to be received from GUI:
• The GUI will prompt the image capture section when the camera needs to be turned on.
• Image capture algorithm will be prompted to be executed by the GUI.
• The GUI will send the sounds.
Steps in the Design and Implementation of the Image capture and analysis:
• Create a program which takes an image with the mobile phone’s camera ready for the analysis.
• Create and implement an algorithm for defining each the table dimensions.
• Choose an appropriate way of storing the information which will be sent for the geometry calculations.
• Create and implement an algorithm to distinguish the different types of balls and the balls location on the table.
• Create and implement and algorithm to detect the angle and direction of the cue in relation to a specific ball.
• Send actual information the geometry calculations section
|
Algorithm for the Image Capture |
Geometry Calculations: Problems and Deliverables
Deliverables:
Geometry Calculations section is required to take the information passed from the image capture and analysis and calculates whether or not the ball which is being aimed at is going to be hit. Once the ball has been targeted an algorithm needs to calculate a potential shot in which the ball will be potted and the amount of correction needed by changing the angle of the cue in relation to the cue ball.
Expected Problems:
• Balls cannot be lined up with hole (no direct shot).
• Confused by 2 balls on table – aiming for wrong one but correct colour.
• Aiming for wrong user’s ball.
Potential Problems:
• Code runs too slowly to calculate correct cue position in the allocated time.
• Program calculates balls heading in wrong direction.
Information to be sent to the GUI:
• Whether the current shot is going to be a hit or a miss.
• The distance the cue needs to be moved to correct the shot.
Information to be received from image capture and analysis:
• The dimensions of the pool table such as the edges and the location of each pocket.
• The location of each ball and what type of ball they are.
• The angle of the cue with relation the cue ball.
Steps in the Design and Implementation of the geometry calculation:
• Create calculations from collision theory to predict which direction the balls will move in.
• Design an algorithm with for the collision movement.
• Create the program and test with ‘fake’ values.
• Test with real values obtained from the image capture and analysis.
• Send the proposed improvements to the GUI.
|
Algorithm for the Geometry |