ap-3-11.dvi Acta Polytechnica Vol. 51 No. 3/2011 Determining the Position of Head and Shoulders in Neurological Practice with the use of Cameras P. Kutílek, J. Hozman Abstract The posture of the head and shoulders can be influenced negatively by many diseases of the nervous system, visual and vestibular systems. Wehavedesigned a systemand a set of procedures for evaluating the inclination (roll), flexion (pitch) and rotation (yaw) of the head and the inclination (roll) and rotation (yaw) of the shoulders. A new computational algorithm allows non-invasive and non-contact head and shoulder position measurement using two cameras mounted opposite each other, and the displacement of the optical axis of the cameras is also corrected. Keywords: shoulder posture, head posture, neurology, camera calibration. 1 Introduction Theobjectiveof our studywas todevelopa technique for precise head and shoulder posture measurement or, in other words, for measuring the native position of the head and shoulders in 3D space. The tech- nique set out to determine differences between the anatomical coordinate system of the head and shoul- ders and the physical coordinate system with accu- racy to two degrees for inclination, flexion/extension and rotation. No similar technique has previously been developed that can be widely and easily used in neurological clinical practice. Nevertheless, the tech- nique couldhave important applications, as there are many neurological disorders that affect the postural alignment position of the head and shoulders. These can be divided into three main groups: • Cervical blockages and diseases of the cervical spine often cause a wide range of positional ab- normalities. • Dystonic “movement disorders”. Abnormal body segment position is typical for dystonia. • Paralyses of eye muscles also often cause a posi- tion that attempts to compensate for the insuf- ficient function. In many cases, the abnormalities of the head and shoulder position can be small and difficult to ob- serve. In clinical practice, it has until now been pos- sible to quantify only those deviations that are well visible. Although an accurate method for measur- ing head and shoulder postural alignment could con- tribute to the diagnosis of vestibular disorders and some other disorders, this issue has not been system- atically studied in the past. At the present time, the use of an orthopedic go- niometer is the standardway to evaluate angles sim- ply and rapidly in clinical practice. However, there are some limitations, especially in the case of head and shoulder posturemeasurement. Due to the com- bination of three movement components, it is prob- lematic to use only a goniometer. Fig. 1: Examples of head position abnormalities Ferrario, V. F., et al, 1995 [1] developed a new method based on television technology that was faster thanconventionalanalysis. The subject’s body and facewere identified by 12 points. On the basis of an image analysis program, the specified angles were calculated after digitizing the recorded films. Galardi, G., et al, 2003 [2] developed an objec- tive method for measuring posture using Fastrack. Fastrack is an electromagnetic system consisting of a stationary transmitter station and four sensors. The head position in space was reconstructed (based on sensor signals) and was observed from the axial, sagittal and coronal planes. In this paper, we will describe our contribution and our proposed method for measuring head and shoulder position. The method is designed for use in neurology to discover relationships between some neurological disorders and postural alignment. Pic- 32 Acta Polytechnica Vol. 51 No. 3/2011 tures of the headmarked on the tragus and outer eye canthus, and shoulders marked on the acromion, are taken simultaneously by two digital cameras. 2 Methods Hozman, J., et al, 2004 [3] proposed a new method based on the application of three digital cameras with stands and appropriate image processing soft- ware. This new non-invasive head position measure- ment method was designed for use in neurology to discover relationships between some neurological dis- orders and postural alignment. The objective was to developa technique forpreciseheadposturemeasure- ment or, in otherwords, formeasuring the native po- sition of the head in 3D space. The technique aimed to determine differences between the anatomical co- ordinate system and the physical coordinate system with accuracy from one to two degrees for tilt and rotation. Pictures of the head marked on the tragus and the outer eye canthus are taken simultaneously by three digital cameras aligned by a laser beam. No similar technique has previously been developed that can be widely and easily used in neurological clinical practice. Head positionwasmeasuredwith precision of 0.5◦ in three planes (rotation-yaw, flexion-pitch and inclination-roll) [3]. Fig. 2: Anatomical horizontal and axis In our recent method for studying only head po- sition [5], two cameras are required for determining head positions. The rotation and inclination of the head is evaluated fromthedifferencebetween the tra- gus coordinates in the left-profile and right-profile image. The coordinates of the left and right tra- gus (Figure 2) are evaluated by finding the centre of the roundedmark attached to the tragus. The im- ages are captured simultaneously, using two cameras, which are situated on the same optical axis parallel with the frontal plane of the subject. It is a mathematically simple problem to deter- mine the tilt in the sagittal plane (flexion/extension) of the head from side shots (profile photographs). The flexion value was measured relatively as the in- clination of the connecting line between the tragus and the exterior eye corner. The angle between the anatomical and physical horizontal is determined by the angle between vector v (horizontal vector), given by the camera position, and vector u, which repre- sents the coordinates of the points evaluated in the image. The angle is calculated as follows (1): θ =arccos u · v |u| · |v| (1) where u = (a1x [px]− a2x [px], a1y [px] − a2y [px]), v = (1,0). a1x and b1x are the x-axis coordinates of the tragus in the right-profile and left-profile images, and a2x and b2x are the x-axis coordinates of the outer eye can- thus in the right-profile and left-profile images. The coordinates are evaluatedbyfinding the centre of the rounded mark attached to the tragus and outer eye canthus of the patient. The circumvolution extent (rotation) of the head is evaluated from the difference between the tragus coordinates in the left-profile and right-profile image (Figure 3). These images were captured simultane- ously, using two cameras, and the cameras are situ- ated on the sameoptical axis parallelwith the frontal plane subject. Fig. 3: Geometry used for measuring the head position After evaluating the coordinates of the tragus in the captured images, the angle of head rotation is calculated as follows (2): ϕ =arcsin (a1x [px]− b1x [px]) ·const ds [mm] . (2) where const= ccd [mm] · (D [mm]− ds [mm]) 2 · f [mm] · s [px] . 33 Acta Polytechnica Vol. 51 No. 3/2011 a1x and b1x are the x-axis coordinates of the tragus in the right-profile and left-profile images, ds is the diameter of the head, and const is a constant con- verting the distance between the tragus coordinates from pixels to millimeters. The quantity ccd is the width of theCCD sensor given by the camera’sman- ufacturer, D is thedistancebetween theCCDsensors (cameras), f is the focal length of the camera lens, and s is the x-axis image size. Forevaluatingthe inclinationweapplied the same method as was used for evaluating the rotation: φ =arcsin (a1y [px]− b1y [px]) ·const ds [mm] . (3) a1y and b1y are the y-axis coordinates of the tragus in the right-profile and left-profile. The calculation of const has to take into account the modified quan- tities for the y-axis, i.e. ccd is the height of the CCD sensor given by the camera’s manufacturer, and s is the y-axis image size. Fig. 4: Geometry used for measuring the shoulder posi- tion For evaluating shoulderposition,weuseamethod similar to themethod thatweuse for evaluatinghead position. We assume an approximation of the shoul- dermovementbyacircularmovementof themarkers, so the formula for determining shoulder rotation is: ϑ =arcsin (a3x [px]− b3x [px]) · const dr [mm] (4) where const= ccd [mm] · (D [mm] − dr [mm]) 2 · f [mm] · s [px] a3x and b3x are the x-axis coordinatesof theacromion in the right-profile and left-profile. Amedical doctor indicates these anatomical points with a red mark for easy location of the anatomical points in the pic- tures. If the clinical investigation is carried out by an experienced medical doctor, it is not necessary to apply colored marks to the anatomical parts of the body before making an examination using our cam- era system. ds is the distance between the acromions mea- sured by a medical doctor before a clinical examina- tion using our system. The value const is a constant converting thedistancebetween the acromioncoordi- nates frompixels to millimeters. The quantity ccd is the width of the CCD sensor given by the camera’s manufacturer, D is the distance between the CCD sensors (cameras), f is the focal length of the camera lens, and s is the horizontal x-axis image size. To evaluate the shoulder inclination we applied the same method as was used for evaluating the shoulder rotation: ζ =arcsin (a3y [px]− b3y [px]) · const dr [mm] (5) a3y and b3y are the vertical y-axis coordinates of the acromion in the right-profileand left-profile. The cal- culation of const has to take into account the modi- fied quantities for the vertical y-axis, i.e. ccd is the height of theCCDsensor givenby the camera’sman- ufacturer, and s is the vertical y-axis image size. The software also determines the angular dis- placement of the head to the shoulders for rotation, using the formula κ = ϑ − ϕ (6) and the angular displacement of the head to the shoulders for inclination λ = ζ − φ. (7) In the way described above, based on identifying anatomical points with the use of cameras, we can avoid influencing patientswhilewe aremeasuring the inclination (roll), flexion (pitch) and rotation (yaw) of the head and shoulders. Unfortunately, the measurement accuracy is de- termined by the accuracy of the calibration of the cameras. Problems of deviations ofCCD sensors and deviation of optical axes can be excluded by special hardware or by computationally intensive software. In the earlier version of our system, a laser collima- tor was tested and used. When the cameras are on the same optical axis, the right position is signaled by the LED diode (the laser beam is detected). A test version of our system currently uses soft- ware correction based on computational algorithms implemented in our software, or we can use, e.g, the Camera CalibrationToolbox in MatLab software for identifying and correcting the position of the cam- eras. Problems of deviations of CCD sensors and de- viation of optical axes can be excluded by scanning the correction mark on a transparent mask. In this way, we find the differences between the coordinates of this scanned point in the two frames. These differ- ences represent the deviations that will be used for 34 Acta Polytechnica Vol. 51 No. 3/2011 correcting the calculation. An easily adjusted for- mula for calculating, for example, the rotation is ϕ =arcsin (a1x [px] − b1x [px]− kx [px]) · const ds [mm] , (8) other assumptions are identical with the calculation without corrections. Fig. 5: Displacement of optical axes Fig. 6: The two-arm stand with fixed cameras and laser collimators For the angular deviation of optical axes, the cor- rection is more difficult. We have to apply special intensive software, e.g. the MatLab Camera Cali- bration Toolbox. This software enables accurate de- tection of the mutual positions of the optical axes by scanning the correction marks on a transparent mask/board. The software provides information on the mutual displacement and the mutual rotation of the optical axes of the cameras. Withourproposedsoftware,wefind thevalues for the relative position of the two axes of the cameras, i.e. the rotation vector [ω, ξ, ψ] and the translation vector [kx, ky, kz]. For calculating the position of the head and shoulders, one of the cameras must be se- lectedas themain cameraandwedetermine the rota- tion, inclination and flexion of head and shoulders in 3D space to the coordinate system of the main cam- era. The physician must also take this state into ac- count in the clinical examination. Using components of the rotation and translation vector, the formula for determining head rotation is ϕ = arcsin ⎡ ⎣(a1x [px]− b1x [px]) ·const ds [mm] + kx [mm]+ D [mm]−ds [mm] 2 · sinξ ds [mm] ⎤ ⎦ , where ξ is the angle of mutual rotation of the coor- dinate systems / the axis of the cameras, D = kz is the total distance between the cameras purposely adjusted to this distance, kx is the deviation of the optical axis due to the displacement the cameras and the deviation of the centers of theCCD sensors. The formula for calculating the inclination is defined in a similar way φ = arcsin ⎡ ⎣(a1y [px]− b1y [px]) · const ds [mm] + ky [mm]+ D [mm]−ds [mm] 2 · sinω ds [mm] ⎤ ⎦ Flexion/extension is calculated using the formula: θ =arccos u · v |u| · |v| + ψ, where ψ is the angle of mutual rotation of the co- ordinate system of the cameras. The plus sign, i.e. addition of the mutual rotation and displacement of the cameras, in general, determines the relation of the values, but the values can be positive or negative depending on the direction of the mutual rotation and displacement of the cameras. Other conditions are identical with the calcula- tions for the position of head and shoulders if the cameras aremounted and adjusted by a laser system which ensures that the position of the optical axes of the cameras is on the same axis. Similarly, the char- acteristics for calculating the angles of inclination, rotation and flexion are identical. 35 Acta Polytechnica Vol. 51 No. 3/2011 Fig. 7: Angular deviation of the optical axes Fig. 8: Flowchart of clinicalmeasurementsusingour cam- era system The cameras are opposite to each other, and we cannot take pictures of one pattern using two cam- eras. For this reason, we have to use a transpar- ent plate with colored correction marks or a planar checkerboard [9] located at a distance D/2 between the cameras. The correction procedure is such that themeasuredmark is scanned on a transparentmask which is located at a distance D/2 between the cam- eras. We can make the correction for rotation and inclination by observing the vertical and horizontal components of the coordinates and their mutual de- viations in the two images/photographs. The subse- quent image processing is the same as common cal- ibration procedures using a planar checkerboard [9]. The exact values of the displacements and rotations of the optical axes canbe added to the calculation for correcting the displacements or to refine the angles, Figure 8. It appears, however, that the angle correc- tion software is time consuming and impractical for medical practice, and for this reason it is used only for correcting the displacement of the optical axes and the CCD sensors. 3 Results Our method was tested in clinical practice, and pre- liminary experiments indicate that the method func- tions effectively. A user interface has been created for easy control of the new system (Figure 9). The first set of data was measured on 30 vol- unteers. The measured data shows that a healthy subject holds his/her head aligned with the physical coordinate systemwithin a range of ±5 degrees. Sta- tistical analyses of this sample show that all values (inclination, flexion, rotation) are in a normal distri- bution. Our system based on two identical digital cam- eras is a sufficiently accurate system for determin- ing the inclination, flexion and rotation of head and shoulders in neurological practice. An advantage of the system is that it is easy to determine the angles between the anatomical horizontal and axis and the physical coordinate systemdefined by the position of the cameras. Fig. 9: User interface of the software during accuracy tests on a dummy placed on an accurately slewing stand The two cameras are placed on both sides (lateral profiles) of the patient. This is a very important ad- vantage for medical doctors, because they can make various examinations which need an open space in front of the face. 36 Acta Polytechnica Vol. 51 No. 3/2011 Adisadvantageof the systemwith cameras is that there is increasing error of the detected angle with increasing abnormalities of the head position / mea- sured angles. The reason for this is the large devia- tion of head position from the optimum location in the middle distance between the two cameras, which causes large differences in the distances between the CCD sensors (cameras) and the measured head and shoulders. Our system is therefore designed for accu- rate identification of small abnormalities during the rehabilitation process and for cases when the abnor- mality is so slight that it cannot be determined by conventional goniometers. A second disadvantage of a system of cameras is the increasing error of the detected angle with in- creasingmotion of the measured subject. We cannot measure the position/angles of fast moving patients. However, there is an advantage when measuring the positions of small angles (head and shoulders) with very small error. This means that we can measure very small abnormalities of head and shoulder posi- tion. 4 Conclusion We have designed special calibration equipment and implemented procedures for evaluating measured data. The new analytical methods for the imple- mented procedures have been described in this pa- per. The new equipment and measurement method are designed for a very accurate evaluation of head and shoulder position in neurological practice. The system is cheaper than sophisticated systems using accelerometers and magnetometers. Nevertheless, the greatest advantage of the pro- posedmethod is itsnon-invasiveandnon-contactway of measurement, without using any sensors and ap- plying only cheap single-use markers. If the clinical investigation is performedby an experiencedmedical doctor, it is not necessary to apply colored marks to anatomical parts of the body. An advantage of our system over conventional systems such as Zebris or SonoSens is that it can measure a patient without the influence of mechan- ical elements on the patient’s body segments. The system also allows direct detection of the anatomi- cal axes of the patient’s head and shoulders, which cannot be done using current systems. These ways of measuring head and shoulder pos- ture could also be applied in other areas of engineer- ing, medicine and science. Our system can be used anywhere to study the posture of a person. Acknowledgement The work presented here has been carried out at the Department of Biomedical Technology, Faculty of Biomedical Engineering, Czech Technical Univer- sity in Prague in the framework of research program No. MSM 6840770012 “Transdisciplinary Biomedi- cal Engineering Research II” of the Czech Technical University, sponsored by the Ministry of Education, Youth and Sports of the Czech Republic. The study has been supported by Grant Agency of the Czech Republic grant GACR 102/08/H018. References [1] Ferrario,V., Sforza,C.,Germann,D.,Dalloca,L., Miani, A.: Head Posture and Cephalometric Analyses: An Integrated Photographic / Ra- diographic Technique. American Journal of Or- thodontics & Dentofacial Orthopedics, vol. 106, 1994, pp. 257–264. [2] Ferrario,V., Sforza,C.,Tartaglia,G.,Barbini,E., Michielon,G.: NewTelevisionTechnique forNat- ural Head and Body Posture Analysis. Cranio, vol. 13, 1995, pp. 247–255. [3] Cerny, R., Strohm, K., Hozman, J., Stoklasa, J., Sturm, D.: Head in Space – Noninvasive Mea- surement of Head Posture. The 11th Danube Symposium – International Otorhinolaryngolog- ical Congress, Bled, 2006, pp. 39–42. [4] Hozman, J., Zanchi, V., Cerny, R., Marsalek, P., Szabo, Z.: Precise Advanced Head Posture Mea- surement.The 3rdWSEAS InternationalConfer- ence onRemote Sensing (REMOTE’07),WSEAS Press, 2007, pp. 18–26. [5] Kutilek, P., Hozman, J.: Non-contact method for measurement of head posture by two cam- eras and calibrationmeans.The8thCzech-Slovak Conference onTrends inBiomedical Engineering, Bratislava, 2009, pp. 51–54. [6] Harrison, A., Wojtowicz, G.: Clinical Mea- surement of Head and Shoulder Posture Vari- ables. The Journal of Orthopaedic & Amp; Sports Physical Therapy (JOSPT), vol.23, 1996, pp. 353–361. [7] Young, J. D.: Head Posture Measurement. Jour- nal of Pediatric Ophthalmology and Strabismus, vol. 25, No. Mar–Apr (2), 1988, pp. 86–89. [8] Hozman, J., Sturm, D., Stoklasa, J., Cerny, R.: Measurement of Postural Head Alignment in Neurological Practice. The 3rd European Medi- cal andBiological EngineeringConference – EM- BEC’05 [CD-ROM], Society of Biomedical En- gineering and Medical Informatics of the Czech Medical Association JEP, vol. 11, Prague, 2005, pp. 4229–4232. 37 Acta Polytechnica Vol. 51 No. 3/2011 [9] Bouguet, J.: Camera Calibration Toolbox for Matlab, April 2002. Available: http://www.vision.caltech.edu/bouguetj/calib doc (May 1, 2009). Ing. Patrik Kutílek, Ph.D. doc. Ing. Jiří Hozman, Ph.D. Phone: +420 312 608 302, +420 224 358 490 E-mail: kutilek@fbmi.cvut.cz Faculty of Biomedical Engineering Czech Technical University in Prague Sitna Sq. 3105, Kladno, Czech Republic 38