GitHub - gfxdisp/castleCSF: castleCSF - A Contrast Sensitivity Function of Color, Area, Spatio-Temporal frequency, Luminance and Eccentricity (original) (raw)

castleCSF - A Contrast Sensitivity Function of Color, Area, Spatio-Temporal frequency, Luminance and Eccentricity

This repository contains both the code and the data for a contrast sensitivity model, as the function of

The details about the model and the dataset can be found on the project website.

Code

Currently, the code is provided as a Matlab class in the directory matlab.

Examples

Please check the directory examples to use castleCSF for predicting and plotting contrast sensitivity.

Broadcasting across multiple dimensions

castleCSF fully support broadcasting. For example, to predict sensitivity for all combinations of spatial and temporal frequencies, you can run:

csf_model = CSF_castleCSF();

t_frequency = logspace( 0.1, log10(64), 30 );           % Temporal frequency in Hz
s_frequency = logspace( log10(0.5), log10(64), 30 );    % Spatial frequency in cycles per degree

csf_pars = struct( 's_frequency', s_frequency, 't_frequency', t_frequency', 'area', 1, 'luminance', 100 );
S = csf_model.sensitivity( csf_pars );        

Note that s_frequency is passed as a [1 30] tensor and t_frequency as a [30 1] tensor (see the transpose). The resulting sensitivity tensor S has the size of [30 30].

To compute sensitivity for large number of data points, use broadcasting instead of calling csf_model.sensitivity multiple times. See also matlab/examples/plot_spatiotemporal_csf.m.

Data

Each datapoint represents a Gabor patch at the detection threshold, either for individual observers, or averaged across all observers. The sensitivity is averaged in the log-contrast space.

The data is stored in the CSV files:

If no individual data is available in a dataset/paper, it is excluded from data_individual.csv.

The columns are identical as in data_individual.csv but without the columns observer and age.

The background IDs are unique across all datasets so that the tables data* and backgrounds can be merged using bkg_id as the key.

bkg_id - the unique ID of the background colour L, M, S - LMS colour coordinates R - rod response or scotopic luminance (CIE 1951 scotopic luminous function) bkg_label - string label of the background (e.g. 'red', 'white', 'd65') dataset - the ID of the dataset

The colour directions IDs are unique across all datasets so that the tables data* and color_direction can be merged using color_direction as the key.

col_dir_id - the unique ID of the colour direction L_delta , M_delta, S_delta - the vector defining the direction in the LMS colour space dataset - the ID of the dataset

Columns:

Release Notes

The detailed list of changes can be found in ChangeLog.md.