Giter Site home page Giter Site logo

headgazelib's Introduction

HeadGazeLib

Platform iOS license MIT

What is the Project

HeadGazeLib is a pure Swift library to empower iOS app control through head gaze without a finger touch.
See the story behind it here


The above teaser is available at example/demo.

Who May Wish to Use the Project

Any iOS developer who would like to introduce head-based control to their app. Ideal for accessibility and game control.

Dependencies

iPhone X, iOS 11, Swift 4

How to use the library

  1. Simply copy and paste the entire folder HeadGazeLib to your xcode project.
  2. Extend your ViewController from UIHeadGazeViewController and change the button outlet reference class from UIButton to UIHoverableButton or UIBubbleButton
class MyViewController: UIHeadGazeViewController{
    @IBOutlet weak var myButton: UIBubbleButton! // UIButton!
}
  1. Similarily, change the button class from UIButton to UIHoverableButton or UIBubbleButton in the identity inspector of storyboard

  2. Define head gaze event handler through UIHeadGazeRecognizer instance in MyViewController class

class MyViewController: UIHeadGazeViewController{
//.....
  private var headGazeRecognizer: UIHeadGazeRecognizer? = nil

  override func viewDidLoad() {
    super.viewDidLoad()
    setupGestureRecognizer()
  }
  private func setupGestureRecognizer() {
    // set button dwell duration
    self.myButton.dwellDuration = 1 // in second
    
    // add head gaze recognizer to handle head gaze event
    self.headGazeRecognizer = UIHeadGazeRecognizer()
    
    //Between [0,9]. Stablize the cursor reducing the wiggling noise.
    //The higher the value the more smoothly the cursor moves.
    super.virtualCursorView?.smoothness = 9
    
    super.virtualCursorView?.addGestureRecognizer(headGazeRecognizer)
    self.headGazeRecognizer?.move = { [weak self] gaze in

        self?.buttonAction(button: (self?.myButton)!, gaze: gaze)

    }
  }
  private func buttonAction(button: UIButton, gaze: UIHeadGaze){
    guard let button = button as? UIHoverableButton else { return }
    // The button instance would trigger TouchUpInside event after user specified seconds
    button.hover(gaze: gaze) 
  }
  
  @IBAction func myBtnTouchUpInside(_ sender: UIBubbleButton) {
     print("Button clicked by head gaze.")
  }
//....
}

For working demo, we have prepared three examples:

  1. demo: A simple jump start example showing how to empower a regular iOS app with head control with minimum code change.
  2. HeadSwipe: A more serious example - swipe daily deal on eBay with head control
  3. Sensitivity: An example on how to use UIMultiFuncButton to track the location and timestamp of the cursor as user is "clicking" the button. Useful for sensitivity analysis.

Citation

If you find this work useful in your research, please consider citing:

Cicek, Muratcan, Jinrong Xie, Qiaosong Wang, and Robinson Piramuthu. "Mobile Head Tracking for eCommerce and Beyond." arXiv preprint arXiv:1812.07143 (2018).

BibTeX entry:

@article{cicek2018mobile,
  title={Mobile Head Tracking for eCommerce and Beyond},
  author={Cicek, Muratcan and Xie, Jinrong and Wang, Qiaosong and Piramuthu, Robinson},
  journal={arXiv preprint arXiv:1812.07143},
  year={2018}
}

License

Copyright 2018 eBay Inc.
HeadGazeLib is available under the MIT license. See the LICENSE file for more info.

Developers

Jinrong Xie, Muratcan Cicek, Qiaosong Wang, Robinson Piramuthu

headgazelib's People

Contributors

fyreek avatar rpiramuthu avatar stonexjr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

headgazelib's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.