DetectSaccades360IVT.m 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. % DetectSaccade360IVT.m
  2. %
  3. % This function uses a simple speed threshold to detect saccades as in the I-VT
  4. % algorithm of Salvucci, Dario D., and Joseph H. Goldberg. "Identifying
  5. % fixations and saccades in eye-tracking protocols." Proceedings of the 2000
  6. % symposium on Eye tracking research & applications. ACM, 2000.
  7. %
  8. % input:
  9. % data - data from the ARFF file
  10. % metadata - metadata from the ARFF file
  11. % attributes - attributes from the ARFF file
  12. % typeOfMotion - 1 -> eye FOV, 2 -> eye+head
  13. % velThreshold - velocity threshold for I-Vt
  14. %
  15. % output:
  16. % result - logical vector with same length as input data and true where a saccade was detected
  17. function result = DetectSaccades360IVT(data, metadata, attributes, typeOfMotion, velThreshold)
  18. [eyeFovVec, eyeHeadVec, headVec] = GetCartVectors(data, metadata, attributes);
  19. if (typeOfMotion == 1)
  20. vecList = eyeFovVec;
  21. elseif (typeOfMotion == 2)
  22. vecList = eyeHeadVec;
  23. else
  24. error('Uknown motion');
  25. end
  26. timeInd = GetAttPositionArff(attributes, 'time');
  27. speed = GetSpeed(vecList, data(:,timeInd));
  28. result = speed > velThreshold;
  29. end