- Participant ID: A unique identifier of the participants and/or experimental configuration.
- Size: Angular dimension (std of the Gaussian bracket) of the Gabor target in degrees. Recommended to be between 0.5 and 1 degree.
- Min Frequency: Minimum spatial frequency of the patch when the experiment begins. Min value is 0.5 cycles per degree.
- Max Frequency: Maximum spatial frequency of the patch when the experiment ends. Max value is 6 cycles per degree to avoid results affected by HMD anti-aliasing settings.
- Step Frequency: Incremental spatial frequency in cycles per degree. Value must be between min and max frequency.
- 9 positions: Checking this box allows the experiment to loop the frequency over 9 positions across the FOV determined by the shift.
- Angular Separation: The shortest angular distance in degree between various positions of the target.
- Background Noise: Checking this box opens the noise menu options.
- Noise Sigma: Standard deviation of the noise amplitude in gray levels (0-255)
- Gaussian Sigma: Standard deviation of the Gaussian kernel that adds noise correlation. Ranges from 0 to 9 only.
Instructions on Contrast Perception Evalution on Head-Mounted Displays
Introduction
This tool provides a test method to characterize contrast perception of human participants on virtual or augmented reality (VR or AR) head-mounted displays (HMDs). Contrast sensitivity response (CSR), as the reciprocal of the threshold (minimum detectable) contrast of the human participant, is measured at various spatial frequencies. This is achieved using a 2D sinusoidal pattern with predefined contrast and spatial frequency, known as a Gabor target. The Gabor target can be rendered at a single or 9 locations across the display field of view (FOV) as illustrated below.
Setup
Prior to the experiment, the testing conditions such as target size, location, spatial frequency, and background noise should be setup in the menu on the left side of the user interface using a compatible HMD controller and/or paired Bluetooth keyboard. During the perceptual experiments, the setup parameters cannot be changed. The setup parameters are listed and described in the Tool Menu below.
Tool Menu
Human Perceptual Experiment Setup
Following the procedures below to perform the perceptual experiment:
- After the experimental setup, click the button at the bottom right corner to enter immersive mode on the tested HMD. The test must be conducted in the immersive mode.
- Each experiment contains multiple trials to determine the threshold contrast of the Gabor target at various locations and spatial frequencies. The experiment will run from the minimum to maximum frequency over a fixed position at the center of FOV or 9 different positions across FOV. The first trial (trial 0) is for illustration and HMD alignment, which will be excluded from data processing. If needed, adjust the HMD position such that the target appears at the center of the HMD FOV
- In each trial, the target's contrast (starting as gray difference of 10, corresponding to a contrast of about 0.04) can be incremented or decremented by adjusting the display gray level using an HMD controller (thumbstick up or down) or paired Bluetooth keyboard (arrow up or down) until reaching the threshold contrast of each trial. See section below for details of HMD controller and Bluetooth keyboard control.
- Once the threshold contrast is obtained, press button "A" on the controller or Bluetooth keyboard to complete the current trial. For very poor image quality conditions, e.g., threshold contrast close to 1, the button "B" can be used to maximize the contrast to 1 for further adjustment.
- At the end of the experiment, all responses from the participant (i.e., measured threshold contrast) are saved as an output JSON file.
HMD Controller and Keyboard Control
- Arrow up (keyboard)/thumbstick up (HMD controller): Increase contrast of current target by one gray
- Arrow down (keyboard)/thumbstick down (HMD controller): Decrease contrast of current target by one gray
- A (keyboard and HMD controller): Confirm threshold contrast that completes the current trial and move to the next one
- B (keyboard and HMD controller): To maximize the current contrast to 1 for further adjustment (only to speed up contrast adjustment for poor visibility trials)
- esc: Exit immersive mode
Downloaded Results File
The JSON file compiles the results of the experiment, which should be downloaded from the HMD (in the “download” folder) to a PC for data analysis. The JSON file has the following format where the participant id and experimental configurations such as spatial frequencies, angular separation, and noise settings are listed in the header. For each trial, the user-determined threshold contrast, target spatial frequency, and position are recorded. All the data in each trial is stored in the responses array of the file.
Data Processing
This code is designed to analyze and visualize contrast sensitivity data from multiple experiments. Its main functions are:
- Data Processing: It processes multiple JSON files containing experimental results on contrast sensitivity.
- Data Aggregation: The code combines data from all input files and calculates average contrast sensitivity for each spatial frequency and position combination.
- Visualization: It generates a set of plots per target position showing the Contrast Sensitivity Response (CSR) for different positions in the visual field.
To use this code:
- Prepare the Data Files: Ensure your JSON files follow the structure shown above. Multiple JSON files from multiple subjects can be grouped for statistical analysis. Data from the same experimental group should be placed in the same Input Directory.
- Run the Script: Execute the python script. Specify Input Directory for the data and Output Directory for the plots in pop-up windows.
- Interpret the Results: The script will generate a figure (CSR with the mean and standard deviation of the grouped experiments) per measured target position in the visual field. These plots show how contrast sensitivity changes with spatial frequency for each position.
What the Plots Show
- X-axis: Spatial Frequency (cycles/degree)
- Y-axis: CSR on a logarithmic scale
- Each plot represents a different position in the visual field, based on the "position" array (unit in meters in the x, y, z direction) in each response
- The line in each plot shows the average contrast sensitivity across all processed files for that position
- Error bars (if included) represent standard error or standard deviation across multiple participants
Compatible HMDs
This tool has been validated for compatibility with the following HMDs: Meta Quest 2, Quest 3, and Magic Leap 2. Compatibility of other HMDs should be checked prior to use of this tool.