Code Monkey home page Code Monkey logo

gazepointheatmap's Introduction

Gaze Point Heat Map

Easy to use command line based tool to generate a gaze point heat map from a csv file. ๐Ÿ‘๏ธ

Usage

Install the required dependencies from the command line.

pip install -r requirements.txt

This tool was created based on Python 2.7. Make sure you are on that Python version to avoid problems.

Run the script from the command line.

python gazeheatplot.py gaze-data.csv 1440 900 [-a 0.6] [-o output-name] [-b /Me/bg-image.png] [-n 200] [-sd 33]

Data Format

Each line contains at least the X- and Y-values. If you have fixation data and want to take the duration into account you can add it to the end of each row. The data has to be formatted in the CSV format (comma-separated values).

X Y Duration (optional)
123 654 226
134 662 234
... ... ...

Shortcut and Additional Arguments

GENERAL ARGUMENTS:
-h                    --help                                 show help message and exit

REQUIRED ARGUMENTS:
input-path                                                   path to the csv input
display-width                                                an integer representing the display width
display-height                                               an integer representing the display height

OPTIONAL ARGUMENTS:
[-a ALPHA             --alpha ALPHA                          alpha of the gaze overlay                 ]
[-o OUTPUT_NAME       --output-name OUTPUT_NAME              name of the output file                   ]
[-b BACKGROUND_IMAGE  --background-image BACKGROUND_IMAGE    path to the background image              ]

ADVANCED OPTIONAL ARGUMENTS:
[-n  N_GAUS_MATRIX    --n-gaussian-matrix N_GAUSS_MATRIX     width and height of gaussian matrix       ]
[-sd STAND_DEVIATION  --standard-deviation STAND_DEVIATION   standard deviation of gauss distribution  ]

Note: To add a background image make sure to provide the whole path and only png images without an alpha channel which are not larger than the provided display width and display height.

Results

Example Output

Attribution

The script is based on the heat map plotter of PyGaze.

gazepointheatmap's People

Contributors

tobiasroeddiger 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

gazepointheatmap's Issues

I got this TypeError. How to deal with this?? And is this command right? Please answer.

python gazeheatplot.py data.csv 1440 900 -a 0.6 -o result.png -b ./E
xample_Output/bg-image.png -n 200 -sd 33
Traceback (most recent call last):
File "gazeheatplot.py", line 227, in
draw_heatmap(gaze_data, (display_width, display_height), alpha=alpha, savefilename=output_name, imagefile=background_image, gaussianwh=ngaussian, gaussiansd=sd)
File "gazeheatplot.py", line 127, in draw_heatmap
fig, ax = draw_display(dispsize, imagefile=imagefile)
File "gazeheatplot.py", line 48, in draw_display
screen[y:y + h, x:x + w, :] += img
TypeError: slice indices must be integers or None or have an index method

java version

hi
i hava a question about this script
is it possible to convert this code into a java code that could be run in android studio app?

how to get the csv file

Hi! Can you tell me how to get the axis of csv file?
I so appreciate if you can tell me that.

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.