scieee AI-readable full text Open interactive document viewer

SVMT: A MATLAB toolbox for stereo-vision motion tracking of motor reactivity

Vousdoukas, Michalis Ioannis; Idrissi, Sofia; Vila, Jaime; Perakakis, Pandelis

Abstract

This article presents a Matlab-based stereo-vision motion tracking system (SVMT) for the detection of human motor reactivity elicited by sensory stimulation. It is a low-cost, non-intrusive system supported by Graphical User Interface (GUI) software, and has been successfully tested and integrated in a broad array of physiological recording devices at the Human Physiology Laboratory in the University of Granada. The SVMT GUI software handles data in Matlab and ASCII formats. Internal functions perform lens distortion correction, camera geometry definition, feature matching, as well as data clustering and filtering to extract 3D motion paths of specific body areas. System validation showed geo-rectification errors below 0.5 mm, while feature matching and motion paths extraction procedures were successfully validated with manual tracking and RMS errors were typically below 2% of the movement range. The application of the system in a psychophysiological experiment designed to elicit a startle motor response by the presentation of intense and unexpected acoustic stimuli, provided reliable data probing dynamical features of motor responses and habituation to repeated stimulus presentations. The stereo-geolocation and motion tracking performance of the SVMT system were successfully validated through comparisons with surface EMG measurements of eyeblink startle, which clearly demonstrate the ability of SVMT to track subtle body movement, such as those induced by the presentation of intense acoustic stimuli. Finally, SVMT provides an efficient solution for the assessment of motor reactivity not only in controlled laboratory settings, but also in more open, ecological environments.

Full text

Please cite this article in press as: M.I. Vousdoukas, et al., SVMT: A MATLAB toolbox for stereo-vision motion tracking of motor reactivity, Comput. Methods Programs Biomed. (2012), doi:10.1016/j.cmpb.2012.01.006 ARTICLE IN PRESS COMM-3340; No. of Pages 12 c o m p u t e r m e t h o d s a n d p r o g r a m s i n b i o m e d i c i n e x x x ( 2 0 1 2 ) xxx–xxx jo ur n al hom ep age : www.intl.elsevierhealth.com/journals/cmpb SVMT: A MATLAB toolbox for stereo-vision motion tracking of motor reactivity M.I. Vousdoukasa,∗, P. Perakakisb,c, S. Idrissib, J. Vilab aForschungszentrum Küste, Merkurstraße 11, 30419 Hannover, Germany bDepartment of Personality, Evaluation and Psychological Treatment, Faculty of Psychology, University of Granada, Campus Cartuja, 18071 Granada, Spain cLaboratory of Experimental Economics, University Jaume I, Avda. Sos Baynat, 12071 Castellón, Spain a r t i c l e i n f o Article history: Received 5 May 2011 Received in revised form 16 January 2012 Accepted 17 January 2012 Keywords: Motor reactivity Sensory stimulation Stereo vision Image processing Matlab Computer software a b s t r a c t This article presents a Matlab-based stereo-vision motion tracking system (SVMT) for the detection of human motor reactivity elicited by sensory stimulation. It is a low-cost, non-intrusive system supported by Graphical User Interface (GUI) software, and has been successfully tested and integrated in a broad array of physiological recording devices at the Human Physiology Laboratory in the University of Granada. The SVMT GUI software handles data in Matlab and ASCII formats. Internal functions perform lens distortion correction, camera geometry definition, feature matching, as well as data clustering and filtering to extract 3D motion paths of specific body areas. System validation showed geo-rectification errors below 0.5 mm, while feature matching and motion paths extraction procedures were successfully validated with manual tracking and RMS errors were typically below 2% of the movement range. The application of the system in a psychophysiological experiment designed to elicit a startle motor response by the presentation of intense and unexpected acoustic stimuli, provided reliable data probing dynamical features of motor responses and habituation to repeated stimulus presentations. The stereo-geolocation and motion tracking performance of the SVMT system were successfully validated through comparisons with surface EMG measurements of eyeblink startle, which clearly demonstrate the ability of SVMT to track subtle body movement, such as those induced by the presentation of intense acoustic stimuli. Finally, SVMT provides an efficient solution for the assessment of motor reactivity not only in controlled laboratory settings, but also in more open, ecological environments. © 2012 Elsevier Ireland Ltd. All rights reserved. 1. Introduction In experimental psychophysiology, human motor reactivity to sensory stimulation is usually indexed by surface electromyography (EMG), which requires the placement of several electrodes on the skin surface [1]. This limits the mobility of the subject and reduces the possible contexts in which motor responses can be recorded and evaluated. In ∗Corresponding author. Tel.: +49 511 762 9231; fax: +49 511 762 9219. E-mail addresses: [email protected], [email protected] (M.I. Vousdoukas). addition, EMG captures only the activity of specific muscle groups, whereas certain motor reflexes to sensory stimuli, such as the startle reflex, involve a global motor response characterized by complex muscle contraction patterns at different body areas [2]. A detailed investigation of these global motor reactivity patterns, in relation to underlying physiological control mechanisms, could result in a more systematic mapping of psychophysiological processes under sensory stimulation. 0169-2607/$ – see front matter © 2012 Elsevier Ireland Ltd. All rights reserved. doi:10.1016/j.cmpb.2012.01.006 Please cite this article in press as: M.I. Vousdoukas, et al., SVMT: A MATLAB toolbox for stereo-vision motion tracking of motor reactivity, Comput. Methods Programs Biomed. (2012), doi:10.1016/j.cmpb.2012.01.006 ARTICLE IN PRESS COMM-3340; No. of Pages 12 2 c o m p u t e r m e t h o d s a n d p r o g r a m s i n b i o m e d i c i n e x x x ( 2 0 1 2 ) xxx–xxx In this paper, we present a Matlab-based stereo-vision motion tracking (SVMT) system developed at the Human Physiology research group in the University of Granada. SVMT is a low cost, non-intrusive alternative method for the detection of motor reactivity that has so far been tested in controlled laboratory settings. However, due to its portability and flexibility, we envision its future use in more open, ecological environments. The SVMT software presented here combines freely available Matlab toolboxes with a set of specially designed functions, and has been successfully tested/validated in terms of its stereo-geolocation and motion tracking performance, including comparisons with the eyeblink startle measured by surface EMG. 2. Computational methods and theory The system consists of the following components: (a) 3- D stereo-triangulation, involving accurate description of the stereo-camera system geometry, i.e. estimation of the centres of view and orientations on a common Cartesian coordinate system, in order to reproduce 3-D surfaces; (b) feature matching, related to the robust identification of common features (keypoints) between images; and (c) motion trajectory extraction, focussing on the processing of the keypoints in order to obtain the subject’s location and displacement in 3D space and time. These components are described in detail below. 2.1. Lens distortion correction Most camera lenses impose a certain amount of distortion on the acquired sceneries, the correction of which is fundamental for the precise transformation from image to real world coordinates. Distortion can be radially symmetric about the principal point (radial distortion), or symmetric along a line directed through the principal point (tangential distortion) [3]. Typical types of distortion are the barrel distortion and the pincushion distortion, with the former resulting in a tendency of image points to concentrate over the border, while the ones close to the image centre spread on a radial direction. The opposite behaviour is found in the case of pin-cushion distortion, in which images are shrinking towards the centre [4]. Lens distortion correction, or alternatively camera calibration procedure, includes the estimation of the camera’s intrinsic parameters operations and can be expressed mathematically through the K matrix: K =⎛ ⎝ ˛ 0 u0 0 ˇ v0 0 0 I ⎞ ⎠(1) where ˛, ˇ correspond to the focal length measured in u and v pixel units respectively, u0and v0to the image centre [called also principal point, e.g. see [5]] and I is the identity matrix. Camera calibration is very well documented in the literature [e.g. see [3,5–8]]. In the present application we used a freely available MATLAB Camera Calibration Toolbox developed by Bouguet [6]. An A3 size checkerboard with vertical and horizontal rectangle dimensions 24 mm and 26 mm respectively, was located in both cameras’ Field Of View (FOV) at several positions, while synchronised image acquisition was active, to obtain pairs of images for each perspective of the pattern. Due to the good contrast of the checkerboard pattern, the corners of each box were extracted for all images using a semi-automatic procedure, resulting in a cloud of points with known coordinates in both image and real world space (relative to each other). The toolbox uses the above as input to iterative solvers so as to define the camera’s intrinsic parameters, which were estimated once for each camera and were then assumed constant. According to the results, the mean of the calibrated values differed significantly from nominal values for all variables (with deviations ranging between 2.5% and 5%) and errors >10 pixels (in the corners of the frames) were observed for the original distorted frames. 2.2. The projection matrix In the present application the pinhole camera model is assumed, according to which the world and image location of each point in the field of view are aligned to the camera Centre Of View (COV). Homogenous coordinates are used in the expression of the camera model, as they provide simplicity of notation and computational generality [4]; they are obtained from geographic coordinates after adding an extra dimension with values equal to one. The transformation from metric system coordinates (X, Y, Z) to image coordinates (U, V) and vice versa, utilizing homogenous coordinates, is performed using the 3 × 4 perspective transformation matrix P [9]: P⎡ ⎢ ⎣ X Y Z 1 ⎤ ⎥ ⎦=⎡ ⎣ U V 1 ⎤ ⎦(2) The P matrix can be decomposed as: P = KR[I| − C] (3) where K is the camera calibration matrix expressed by Eq. (1), I is the identity matrix, and C and R are the translation and rotation matrices of the camera’s COV respectively [4,10]. The C translation matrix accounts for the camera COV position Cartesian coordinates (Xcam, Ycam, Zcam) in the world coordinate reference system and can be represented as: C =⎡ ⎣ Xcam Ycam Zcam ⎤ ⎦(4) The R matrix expresses the effective orientation of the COV and is defined by three angles COV-pan, COV-tilt, COV-roll, relative to the Cartesian system of coordinates: R =⎡ ⎣ m11 m12 m13 m21 m22 m23 m31 m32 m33 ⎤ ⎦(5) Please cite this article in press as: M.I. Vousdoukas, et al., SVMT: A MATLAB toolbox for stereo-vision motion tracking of motor reactivity, Comput. Methods Programs Biomed. (2012), doi:10.1016/j.cmpb.2012.01.006 ARTICLE IN PRESS COMM-3340; No. of Pages 12 c o m p u t e r m e t h o d s a n d p r o g r a m s i n b i o m e d i c i n e x x x ( 2 0 1 2 ) xxx–xxx 3 2.3. Stereo-triangulation When the camera’s COV orientation and location and thus the P matrix are defined for each point in the field of view, Eqs. (1)–(5) result in a system of 2 equations (one for each image coordinate U, V) with 3 unknowns, the feature’s x, y, z world coordinates. Geometrically, this means that the feature can be anywhere along the line defined by the camera’s COV and its image coordinates [11]. When the feature is monitored by two cameras, its position is defined by the cross-section of each camera’s line. As a result, the system of equations can be solved analytically, as long as the cameras’ geometries are defined in the same coordinate system, a process called stereo-triangulation. The projection matrix R estimation is an essential step for camera calibration. Thus, the dual camera array geometries were defined using the common checkerboard corner features, detected during the two cameras calibration procedure. Synchronous image acquisition allowed association of the identified checkerboard corners between the Camera 1 and Camera 2 frames. These common features, once introduced to Eq. (2), result in an over-specified system, permitting the selection of an optimal solution for the camera angles [for a detailed description see [5,6]] and COV through an iterative solver [Nelder–Mead simplex method, see [12]]. The present application aims to record the subject’s amplitude and velocity of displacement. Therefore, an absolute coordinate system (linked to geographic coordinates) is not necessary. Thus, the COV of the left camera was considered as the origin of the Cartesian coordinate system. The above coordinates can be easily transformed to a fixed system by indentifying three or more points of known locations to the desired system and using them as reference to estimate the P matrix [see also [13]]. 2.4. Feature matching As mentioned above, an essential step for motion tracking and geo-location is to identify common features at both cameras’ frames at the same instant. Associate pairs of keypoints between images were identified using the approach of Lowe [14], modified in MATLAB accordingly for the needs of the present application. The method was designed to extract distinctive invariant features from images considering rotation, affine distortion, changes in illumination and noise, while small computational times were achieved by following a cascade filtering approach. The four major stages of computation used by the algorithm to generate the set of image features are: (a) space-scale extrema detection, (b) keypoint localization, (c) orientation assignment, and (d) keypoint descriptor. Detailed description of the algorithm is beyond the scope of the present contribution and can be found in Lowe [14]. In the case of the processed imagery, the number of identified features on each image was found to vary from 300 to 500, most of which were located on the subject’s body (the homogeneous background did not generate keypoints). Shutter speed was set to its minimum value (0.12 ms) in order to avoid blurring during fast movements. However, in such cases some blurring is inevitable and the number of features can be reduced, but still more than 200 pairs of keypoints are typically produced. The keypoint identification steps are described below and according to the following image notation; L-m and R-n imply the mth and nth frame (where m and n are frame numbers) of the left (L) and right (R) camera respectively. 1. Features are identified in all images from both cameras. 2. The algorithm propagates through the set of images and matches common keypoints between frames L-1 and L-i, where i = 2–N and N is the total number of acquired images per camera. All matches are indexed according to their occurrence on frame L-1 (Fig. 1a). 3. Similarly the whole set of image pairs is processed to identify keypoint matches between frames L-i and R-i, keeping the indexing of the previous step (Fig. 1b). 4. Keypoint matches are geo-located according to Eq. (2) and Section 2.2 (see also Fig. 2). In brief, the above description implies that initially indexed and geo-located keypoint pairs (step 2), are tracked through the frames sequence (step 3) and geo-located (step 4). This results in a cloud of points for each instant (see Fig. 2), which result in keypoints’ motion trajectories. 2.5. Motion trajectory extraction The ‘keypoints cloud’ shown in Fig. 2 contains the most detailed description of the subject’s movement. Individual keypoint motion trajectories are generated after combining all keypoint instantaneous positions. Given that specific body areas (i.e. head, arms, core) are usually of interest for the analysis of typical human motor reactivity, individual keypoints are grouped into clusters, each associated to a predefined body area. The association of the identified keypoints to the body areas of interest takes place by processing frame L-1, following two possible approaches: 1. The feature-matching algorithm identifies specially designed markers attached at the subject’s body areas of interest, after processing frame L-1 along with pictures of the markers (Fig. 3). 2. Body areas are manually defined on the first frame of each video sequence; this approach is also automatically applied either when the automatic procedure fails (e.g. Fig. 3), or if the user does not provide any marker photos. The feature clustering and trajectory extraction takes place according to the following steps: 1. Body areas are associated to the identified keypoints, according to the procedure described above. 2. For each temporal step, all the keypoint positions associated to each body area are averaged to generate the ‘representative body area position’. −→ rp(t) =1 w w  j=1 −→ rp,j(t) (6) Please cite this article in press as: M.I. Vousdoukas, et al., SVMT: A MATLAB toolbox for stereo-vision motion tracking of motor reactivity, Comput. Methods Programs Biomed. (2012), doi:10.1016/j.cmpb.2012.01.006 ARTICLE IN PRESS COMM-3340; No. of Pages 12 4 c o m p u t e r m e t h o d s a n d p r o g r a m s i n b i o m e d i c i n e x x x ( 2 0 1 2 ) xxx–xxx Fig. 1 – Performance of the keypoint matching algorithm between frames L-6/L-1 (a) and between simultaneously acquired frames from both cameras, L-6, R-6 (b). The color of the dots denotes different areas of the subject’s body (red, head; magenta, core; yellow, left shoulder; and green, right shoulder) and the numbers the index of each keypoint, which allows tracking of each feature through the image sequence. (For interpretation of the references to color in this figure legend, the reader is referred to the web version of this article.) where −→ rp= (x, y, z) expresses Cartesian coordinates, p is the cluster index number and w is the number of keypoints per cluster. 3. Instantaneous velocities are estimated: −→ u =∂−→ r ∂t (7) 4. Following, instantaneous velocities from all points belonging into each cluster are averaged to produce the ‘cluster velocities’. −→ Up(t) =1 w w  j=1 −→ uj(t) (8) An example of the above procedure is shown in Fig. 4, where the blue lines correspond to the x, y, z positions of all keypoints belonging to specific body areas (defined at step 1) and the black dashed line shows the final motion paths. 3. The stereo-vision motion tracking software 3.1. System installation After camera installation and connection to the manufacturer’s image acquisition software, the individual and stereo camera calibration described in Section 2 has to be performed. Our software has been designed to use the calibration export files of the Bouguet MATLAB toolbox [6] directly. This procedure is necessary only during the initial system installation and has to be repeated only in case the relative camera positions and orientations change. A directory structure with all the necessary data files has to be prepared following recommendations given in Appendix I. The SVMT algorithm has been tested successfully in MATLAB Releases 2009a and 2010a in Windows XP SP2, Mac OS and Ubuntu 10.04 64bit platforms. It was run successfully in commercial laptop and desktop computers of 2008 up to 2011 standards and has not shown to be exceptionally computationally intensive. For some platforms (other than Linux or Windows) the SIFT keypoint identification algorithm has to be compiled to produce a working executable. The SVMT software is freely available at https://sourceforge.net/projects/svmt. 3.2. Basic inputs The processing of each event is performed by the function event process, through the operations described below and in the flow diagram shown in Fig. 5. The function requires two MATLAB data structures as input; one with the processing and visualization parameters (params) and another with the paths definition (paths). Images of the patterns for automatic area Please cite this article in press as: M.I. Vousdoukas, et al., SVMT: A MATLAB toolbox for stereo-vision motion tracking of motor reactivity, Comput. Methods Programs Biomed. (2012), doi:10.1016/j.cmpb.2012.01.006 ARTICLE IN PRESS COMM-3340; No. of Pages 12 c o m p u t e r m e t h o d s a n d p r o g r a m s i n b i o m e d i c i n e x x x ( 2 0 1 2 ) xxx–xxx 5 Fig. 2 – Keypoint pairs stereo-triangulation procedure for two instantaneous L-R camera frames (a and b). Blue dots show the detected keypoint locations in 3-D perspective (c), as well as frontal, side and top 2-D views (d, e and f, respectively). Colors denote different areas of the subject’s body (red, head; magenta, core; yellow, left shoulder; and green, right shoulder). (For interpretation of the references to color in this figure legend, the reader is referred to the web version of this article.) identification can be provided as an optional input. All inputs are described in detail in Appendix II and can be generated by a Graphical User Interface (SVMT GUI) developed to facilitate the use of the SVMT toolbox (Fig. 6). However, users more familiar with programming are encouraged to use the scripts SVMT batch and SVMT batch preparation, which allow the processing of several events in batch mode. 3.3. Image input For the present application, images are exported by the image acquisition software in two separate ASCII files, one for each camera, named CameraLeft.tmp and CameraRight.tmp, containing the complete event image set. They are imported into SVMT in the form of a MATLAB data structure generated by the read tmp function. For a different filename and image storage protocol, only the read tmp function has to be modified accordingly to implement the SVMT toolbox. 3.4. Area definition The appropriate body areas are defined either manually or automatically through the define sections function. For manual definition, SVMT requests the user to manually define (using the mouse) the perimeter of sections on frame L-1 which contain the body areas of interest. For automatic identification, specially designed markers are attached at the subject’s body areas of interest and are identified after comparison with images of the markers alone (see patterns data structure, Appendix II, as well as Section 2.4). 3.5. Keypoint identifier The keypoint identification algorithm is applied on pairs of images according to the procedure described in Section 2.4, implemented by the keypoints3 function. The extracted keypoints are associated with the pre-defined body areas Please cite this article in press as: M.I. Vousdoukas, et al., SVMT: A MATLAB toolbox for stereo-vision motion tracking of motor reactivity, Comput. Methods Programs Biomed. (2012), doi:10.1016/j.cmpb.2012.01.006 ARTICLE IN PRESS COMM-3340; No. of Pages 12 6 c o m p u t e r m e t h o d s a n d p r o g r a m s i n b i o m e d i c i n e x x x ( 2 0 1 2 ) xxx–xxx Fig. 3 – Automatic identification of body areas based on predefined picture markers. (see Sections 2.5 and 3.4) through the identify sections patterns function and their geo-location is performed by the geolocate sections function based on the theoretical background provided in Sections 2.2 and 2.3. 3.6. Trajectory extraction For each keypoint, distinct positions tracked in time are combined to generate the final trajectory through the function post process. The individual trajectories are further processed in the extract section trajectories velocities function to generate the pre-defined body areas’ motion paths and their corresponding velocity and acceleration time series (see also Section 2.5). 3.7. Data export Once the processing procedure is completed, all the intermediate and final results are summarized in the MATLAB data structure event (see also Appendix II), which is exported in a user-defined directory (see also Appendix I). The same data structure is used as input in a set of functions oriented towards easy visualization and validation of the results (e.g. trajectory extraction plot, trajectories 3Dplot, velocities plot, trajectories plot, make event video). The activation of the above functions is an option during the initiation of the main event process function of the SVMT algorithms and an option on the GUI interface (see also Section 3.2 and Appendix I and Fig. 6). Table 1 – Camera technical specifications [15]. Specification FFMV-03M2M/C Image sensor type 1/3 progressive scan CMOS Shutter type Global shutter using Micron TrueSNAPTM technology Image sensor model Micron MT9V022 Maximum resolution 752 (H) × 480 (V) Pixel size 6.0 ␮m × 6.0 ␮m Analog-to-digital converter On-chip 10-bit ADC Video data output 8 and 16-bit digital data Image data formats 8-bit and 16-bit raw Bayer data (color models) Digital interface 6-pin IEEE 1394a for camera control, video data, power Transfer rates 400 Mb/s Maximum frame rate 752 × 480 at 61 FPS 320 × 240 at 112 FPS (region of interest) 320 × 240 at 122 FPS (2 × 2 pixel binning) Partial image modes Pixel binning and region of interest modes via Format 7 General purpose I/O ports 7-pin JST GPIO connector, 4 pins for trigger and strobe, 1 pin +3.3 V, 1 Vext pin for external power Gain control Automatic/manual, 0–12 dB Shutter speed Automatic/manual, 0.12–512 ms Gamma 0–1 (enables 12-bit to 10-bit companding) Synchronization Via external trigger, software trigger, or free-running External trigger modes IIDC v1.31 Trigger Modes 0 and 3 Power requirements 8–30 V via IEEE-1394, less than one (1) Watt Dimensions (L × W × H) 24.4 mm × 44 mm × 34 mm Mass 37 g (including tripod adapter) Camera specifications IIDC 1394-based Digital Camera Specification v1.31 Memory storage Three memory channels for user configurable power-up settings Lens mount CS-mount (5 mm C-mount adapter included) M12 microlens mount2 Compliance CE, FCC Class B, RoHS Operating temperature 0–45◦C Storage temperature −30◦to 60◦C Warranty 1 year 4. Test implementation and validation 4.1. Equipment and experimental layout The SVMT method was originally developed to process imagery obtained during experiments designed to elicit the activation of motor reflexes, in the laboratory of the Human Physiology research group at the University of Granada in Spain. The image acquisition system consists of a Pentium IV Personal Computer and two PointGrey FireFly MV video cameras (Table 1), fixed on an aluminium base with dimensions 20 cm × 5 cm × 0.5 cm. The base is constructed in such a way that the relative position and viewing angles of the cameras are not affected during the platform’s transport, which can be fixed on a camera tripod with standard 1/4-20 tpi Please cite this article in press as: M.I. Vousdoukas, et al., SVMT: A MATLAB toolbox for stereo-vision motion tracking of motor reactivity, Comput. Methods Programs Biomed. (2012), doi:10.1016/j.cmpb.2012.01.006 ARTICLE IN PRESS COMM-3340; No. of Pages 12 c o m p u t e r m e t h o d s a n d p r o g r a m s i n b i o m e d i c i n e x x x ( 2 0 1 2 ) xxx–xxx 7 0 90 180 270 360 x (mm) Head a Left shoulder b Right shoulder c Core d 0 90 180 270 360 y (mm) e f g h −1 0 1 2 3 0 90 180 270 360 z (mm) time (s) i −1 0 1 2 3 time (s) j −1 0 1 2 3 time (s) k −1 0 1 2 3 time (s) l −40 −20 0 20 40 u (mm/s) −160 −110 −60 −10 40 u (mm/s) −20 −5 10 25 40 u (mm/s) Keypoints Final trajectory Velocity Fig. 4 – Final trajectory extraction procedure. Blue lines show the x-, y- and z-locations (rows) of keypoints along the frame sequence (horizontal axis denotes time), while the black dashed lines show the final motion paths. Columns correspond to different body areas (Head, left-right shoulder and core). The right vertical axis and the gray, dashed-dotted line correspond to the velocity. (For interpretation of the references to color in this figure legend, the reader is referred to the web version of this article.) (threads per inch) screw dimensions. The cameras (Point- Grey FFMV-03M2C-CS) were selected on the grounds that they combine several desired characteristics for the given application: Fig. 5 – The SVMT toolbox flow diagram. - Their small size (44 mm × 34 mm × 24.4 mm) is important in order not to affect the subject’s behaviour (thus avoiding bias to the obtained data), and comes in line with the nonintrusive nature of the system. Fig. 6 – The SVMT toolbox graphical user interface. Please cite this article in press as: M.I. Vousdoukas, et al., SVMT: A MATLAB toolbox for stereo-vision motion tracking of motor reactivity, Comput. Methods Programs Biomed. (2012), doi:10.1016/j.cmpb.2012.01.006 ARTICLE IN PRESS COMM-3340; No. of Pages 12 8 c o m p u t e r m e t h o d s a n d p r o g r a m s i n b i o m e d i c i n e x x x ( 2 0 1 2 ) xxx–xxx 50 100 150 200 50 100 150 200 250 300 Manual (mm) SVMT (mm) RMSE=5.61 mm a 050 100 150 200 −50 0 50 100 time (s) z (mm) RMSE=0.83 mm b −50 050 100 −100 −50 0 50 100 SVMT (mm) Theoretical (mm) RMSE=0.96 mm c x y z Metronome SVMT x y z Fig. 7 – System validation comparing the SVMT motion paths with those obtained by manual tracking of the same movement: RMSE for the x, y, and z positions are equal to 1.96, 9.36, and 1.07 mm, respectively (a). System validation comparing the SVMT motion paths of the upper moving part of a mechanical metronome against the theoretical positions: (b) comparison of z-position time series, and (c) scatter plots. Colors red, green, blue, indicate x, y, z coordinates, respectively. (For interpretation of the references to color in this figure legend, the reader is referred to the web version of this article.) - They provide image resolution and acquisition rate (752 × 480 pixels at 61 frames per second (fps)), as well as minimum shutter speeds of 0.12 ms that are low enough to reduce blur during fine and rapid movements expected in the present application. - They allow robust software or external trigger synchronization and ‘time-stamping’ of the camera images, which is vital for a stereo-vision application, as well as to synchronize motion tracking data with other physiological measurements. The cameras are installed in a room with dimensions of 2.5 m × 3 m × 3 m and Faraday Caging, and are both connected to the PC through an IEEE-1394a Firewire PCI card, which controls synchronous image acquisition. Since stereo calibration is valid only for specific geometries, the cameras are fixed on a stable base, assuring that their relative positions and orientation remain stable. The PC is located outside the room, integrated in a broad array of physiological recording devices (Coulbourne Instruments, PA; Biopac Systems Inc., CA). A second PC running E-Prime stimulus presentation software (Psychology Software Tools Inc., PA) controls timing precision, transmitting (through the parallel port) an external trigger that is used for the synchronization of all data acquisition devices. In addition, for each image, the PointGrey software records timestamps with accuracy of few milliseconds. Experimental subjects are facing the camera array, which is located at a distance of approximately 1.5 m. The approximate FOV dimensions do not exceed 1 m for all 3 coordinate system dimensions. We tested the stereo motion tracking software in a psychophysiological experimental context by analysing a series of images obtained at a sampling rate of 30 frames per second during the elicitation of a startle response to intense acoustic stimulation. Image acquisition initiated automatically 1 s before the presentation of the acoustic stimulus and continued for 3 s post-stimulus. The acoustic stimulus was a burst of white noise containing frequencies in the 20 Hz to 20 kHz range, 105 dB intensity and instantaneous rise-time. The noise was generated by a Coulbourn auditory stimulus generator and presented binaurally through headphones (Telephonic TDH Model-49, Telephonic Corporation, NY). The eyeblink component of the startle response was measured by recording the electromyographic activity from the orbicularis oculi muscle beneath the left eye using Ag/AgCl miniature electrodes. The raw EMG signal, sampled at 1 kHz, was amplified (30,000), and frequencies below 90 Hz and above 300 Hz were filtered, using a Coulbourn S75-01 bioamplifier. The signal was subsequently rectified and integrated using a Coulbourn S76-01 contour-following integrator, with a time constant of 100 ms. The psychophysiological test was performed on ten undergraduate psychology students (three male and seven female), who participated in the experimental session for course credit. Each subject received three stimuli with an inter-stimulus interval of 2 min. A resting period of 10 min for adaptation to laboratory conditions preceded the presentation of the first stimulus. 4.2. Results During the development stage and prior to its use in an experimental context, substantial validation efforts took place in order to assess the overall accuracy of the SVMT method. This accuracy is mostly affected by the combination of stereo-triangulation errors, the feature matching algorithm performance, and artefacts of the final motion paths extraction procedure. All the above are discussed independently in the following sections. Please cite this article in press as: M.I. Vousdoukas, et al., SVMT: A MATLAB toolbox for stereo-vision motion tracking of motor reactivity, Comput. Methods Programs Biomed. (2012), doi:10.1016/j.cmpb.2012.01.006 ARTICLE IN PRESS COMM-3340; No. of Pages 12 c o m p u t e r m e t h o d s a n d p r o g r a m s i n b i o m e d i c i n e x x x ( 2 0 1 2 ) xxx–xxx 9 −2 0 2 4 6 x (mm) Head a Left shoulder b Right shoulder c Core d −10 −5 0 y (mm) e f g h −1 0 1 2 3 −4 −2 0 z (mm) time (s) i −1 0 1 2 3 time (s) j −1 0 1 2 3 time (s) k −1 0 1 2 3 time (s) l 1st trial 2nd trial 3rd trial Fig. 8 – Motion trajectories extracted from the three consecutive presentations of an intense acoustic stimulus to a representative subject. Rows indicate Cartesian coordinate system axes and columns represent different body areas. In each graph, the first presentation of the stimulus is represented by a red continuous line, the second by a green dashed line and the third by a blue, dash-dotted line. Specific dynamical features of motor responses are observed, while habituation to repeated stimulus presentations is also evident. (For interpretation of the references to color in this figure legend, the reader is referred to the web version of this article.) 4.2.1. Stereo-triangulation accuracy Stereo-triangulation errors were estimated during the camera calibration procedure and the camera geometry definition steps (see also Sections 2.1–2.3), as the checkerboard features provide detailed ground truth information to access performance in three dimensions. For the present application, we define the lateral, anteroposterior and superior-inferior axes as the x-, y-, and z-axes, respectively. The stereo-triangulation accuracy is limited by the pixel footprint (distance per pixel ratio), which is directly controlled by the distance from the object, the distance of the cameras, and the image pixel resolution. Validation results showed that pixel footprints for the presently used stereoscopic system are around 0.5 mm. They were also found to be slightly higher for the anteroposterior axis (y). As a result, the estimated stereo-triangulation RMS error for the x–z and y–z planes was 0.3 mm, which is slightly lower than the error for the x–y plane (RMS error of 0.5 mm). 4.2.2. Feature matching performance The SIFT algorithm has been extensively validated and applied for computer vision [14] and numerous other applications including commercial image stitching software (http://www.kolor.com/panorama-software-autopano- pro.html) and even coastal video monitoring [9,10], and has been proved very robust. The patterns used for the present application were selected after extensive testing, thus ensuring that they consistently produce a satisfactory amount of extracted keypoints (>10). In addition, the feature matching and tracking procedure was further validated by comparing the SVMT results with those of manually extracted motion paths for 4 specific features on the image. The features were manually identified (clicked with a mouse) along the entire image set (from both cameras) and stereo-triangulation followed. Such validation took place for two different events, with 3 different users performing manual tracking, in order to control for bias introduced by individual human performance. The overall RMS error was 5.6 mm, which corresponds to less than 3% of the movement range (Fig. 7a), which is well below the acceptable maximum for the present application. A closer look showed that the above error corresponds to the anteroposterior axis where the stereo-triangulation errors are higher (see previous section), while for the other two axes RMS errors were less than 2 mm (Fig. 7a). Moreover, it is expected that manual matching is less reliable than automatic, due to manual feature selection artefacts. 4.2.3. Validation using a metronome Additional testing was performed by processing image sequences from an analogue metronome with a spherical pattern attached on its higher moving part. The metronome was set to perform a periodic motion with a period of 2 s and