This page contains the use cases for MouseTrap.

1. Main Use Cases

1.1 Start MouseTrap

1.2 Identify Tracking Points

This use case is used upon start up to initialize the image and set up the pointer movement.

  1. Capture image from camera (Controller)
  2. Detect feature and identify tracking points from image (Model)
  3. Calibrate the pointer manager (i.e., set up the kind of pointer manager (joystick and screen)
  4. Update heads-up display (HUD) (View)

1.3 Track Changes

This is the main use case for mousetrap which utilizes a Model-View-Controller architecture. First time we get the image, calculate the points for the appropriate feature.

  1. Capture new image from camera (Controller)
  2. Find previous tracking points in new image (Model)
  3. Calculate change in tracking points between previous and new image (Model)
  4. Interpret change by pointer manager to determine what type of change is required (Model)
  5. Move the pointer based on pointer manager (View)
  6. Update heads-up display (HUD) (View)

Current threads:

  1. Update pointer
  2. Update screen
  3. Calculate points - takes an X image and figures out the difference and calculates the difference
  4. UI


Controller - Coordinates all of the actions

  • Currently in Controller class
  • Starts update frame and update point threads
  • Pulls settings out of settings file
  • Starts camera
  • Starts GUI
  • Methods
    • get_image():image - Gets the image from the Camera Class (UC 1,2 #1)
    • get_points(image):points[] - Gets Points from Tracker class (UC 1 #2, UC 2 #2)
    • initalize(points[]) - Initialize Pointer Manager (UC 1 #3)
    • update(points[],image) - Update HUD class (UC 1 #4, UC 2 #6)
    • update(points[]):(dx,dy) - Update Pointer Manager (UC 2 #4)
    • move((dx,dy)) - Move the pointer (UC #5)

Camera - Interface with physical camera

  • Currently in _ocv (partial)
    • At least three functions

Tracker - Coordinates the detection of a feature and tracking of motion <Need a paragraph describing how the Tracker/FeatureDetector/MotionTracker work together.>

  • Thread for Calculate points goes here
  • Methods
    • get_points(image):points[] - Gets points from Feature Detector (UC 1 # 2)
    • get_points(old:image, new:image,old:points[]):points[] (UC 2 #3)

FeatureDetector - Detects the appropriate feature in an image

  • Currently in IDM (Image Detection Module)
    • Forehead, Eyes, Color (not used?), Finger (not used?)

MotionTracker - Calculates the change between two images

  • Currently in _ocv (partial), (partial)
  • Finds a point in new image based on previous image
  • Calculate change between points in previous and new image

PointerManater - Manages the change in pointer movement based on settings and algoritm (screen, joystick)

  • Currently in Scripts
  • Interprets change
  • Moves pointer

HeadsUpDisplay - Displays image and any necessary graphics (e.g., box) to window

Pointer - Coordinates the physical movement and clicking

Settings - Save/Load to Settings File

Replace Dubug class w/ Python Logger

File Structure

New File Structure

  • mousetrap
    • Controller
    • core
      • Camera
      • PointerManager

      • Pointer
      • Settings
      • HUD
      • Tracker
        • Motion Tracker
        • Feature Detector
      • features (sub classes of feature detectors)
      • pointermgrs (sub classes of Pointer Managers)
    • ui
      • GTK Stuff
    • addons

Projects/MouseTrap/UseCases (last edited 2014-04-10 17:57:02 by Logan Hotchkiss)