Transcript
Page 1: Background: Coordinate System Transformations

Background:Coordinate System Transformations

Page 2: Background: Coordinate System Transformations

i

j

Derivation of the 2D Rotation Matrix(basis vectors)

ฮธ

Page 3: Background: Coordinate System Transformations

๐‘–ฦธโ€ฒ

i

j

Coordinate Transformations (2D)

ฮธ

๐‘–ฦธโ€ฒ = cos๐œƒ๐‘–ฦธ+ sin๐œƒ๐‘—ฦธ Find in global space:

Page 4: Background: Coordinate System Transformations

i

j

Coordinate Transformations (2D)

ฮธ

๐‘–ฦธโ€ฒ = cos๐œƒ๐‘–ฦธ+ sin๐œƒ๐‘—ฦธ ๐‘—ฦธโ€ฒ = โˆ’sin๐œƒ๐‘–ฦธ+ cos๐œƒ๐‘—ฦธ ๐‘—ฦธโ€ฒ

Find in global space:

Page 5: Background: Coordinate System Transformations

Coordinate Transformations

๐‘–ฦธโ€ฒ = cos๐œƒ๐‘–ฦธ+ sin๐œƒ๐‘—ฦธ ๐‘—ฦธโ€ฒ = โˆ’sin ๐œƒ๐‘–ฦธ+ cos๐œƒ๐‘—ฦธ ๐‘–ฦธโ€ฒ๐‘—ฦธโ€ฒเตจ= แ‰šcos๐œƒ sin๐œƒโˆ’sin๐œƒ cos๐œƒแ‰š๐‘–ฦธ๐‘—ฦธเตจ

Note: The rows of the 2x2 rotation matrix from global to local space are composedof the unit vectors of the local coordinate system axis (in global space).

Page 6: Background: Coordinate System Transformations

i

j

Derivation of the 3D Rotation Matrix(basis vectors)

ฮธ

kKโ€™

Page 7: Background: Coordinate System Transformations

Z Rotation from Global to Local

๐‘–ฦธโ€ฒ๐‘—ฦธโ€ฒ๐‘˜โ€ฒเตฉ= เธญcos๐œƒ sin๐œƒ 0โˆ’sin๐œƒ cos๐œƒ 00 0 1เธญ๐‘–ฦธ๐‘—ฦธ๐‘˜เตฉ

๐‘–ฦธโ€ฒ = cos๐œƒ๐‘–ฦธ+ sin๐œƒ๐‘—ฦธ ๐‘—ฦธโ€ฒ = โˆ’sin๐œƒ๐‘–ฦธ+ cos๐œƒ๐‘—ฦธ ๐‘˜ โ€ฒ = ๐‘˜

Note: The rows of the 3x3 rotation matrix from global to local space are composedof the unit vectors of the local coordinate system axis (in global space).

Page 8: Background: Coordinate System Transformations

Translations of Bodies in 3D

Y

XZ

๐‘‚= ๐‘‚๐‘ฅ๐ขฦธ+ ๐‘‚๐‘ฆ๐‘—ฦธ+ ๐‘‚๐‘ง๐‘˜

๐‘‚

Page 9: Background: Coordinate System Transformations

Y

XZ

๐‘‚

๐‘ƒโ€ฒ = ๐‘…(๐‘ƒเดคโˆ’ ๐‘‚)

Xโ€™

zโ€™yโ€™

P

Pโ€™Pโ€™

Coordinate System Transformations(Global to Local example)

Page 10: Background: Coordinate System Transformations

Translations and Rotation(Example: Global to Local)

Y

XZ

X

Y

Z

For:

andOx=8, Oy=8, Oz=0

Find P in Local Space (Pโ€™)?

O

P ๐‘… = เธญ1 0 00 .707 .7070 โˆ’.707 .707เธญ

๐‘ƒเดค= 10๐ขฦธ + 9.41๐‘—ฦธ + 1.41๐‘˜ Pโ€™

Page 11: Background: Coordinate System Transformations

Coordinate System Transformations(Example: Global to Local)

Y

XZ

X

Y

Z

Transform global to local:

แ‰ฎ

๐‘ƒ๐‘ฅโ€ฒ๐‘ƒ๐‘ฆโ€ฒ๐‘ƒ๐‘งโ€ฒแ‰ฎ= เธญ1 0 00 .707 .7070 โˆ’.707 .707เธญ เธญ

109.411.41เธญโˆ’ เธญ880เธญ เตฉ

๐‘ƒเดคโ€ฒ = ๐‘…(๐‘ƒเดคเดคเดคโˆ’ ๐‘‚)

= เธญ220เธญ แ‰ฎ

๐‘ƒ๐‘ฅโ€ฒ๐‘ƒ๐‘ฆโ€ฒ๐‘ƒ๐‘งโ€ฒแ‰ฎ= เธญ1 0 00 .707 .7070 โˆ’.707 .707เธญเธญ

21.411.41เธญ เตฉ

๐‘ƒเดค= 10๐ขฦธ + 9.41๐‘—ฦธ + 1.41๐‘˜ Pโ€™

Page 12: Background: Coordinate System Transformations

Rotation Matrices are orthonormal

โ€ข The rotation from Global to Local Spaceis the inverse of the rotation from Local to Global Space

โ€ข Rotation Matrices are orthonormal and thusthe inverse is equal to the transpose

๐‘…๐‘…โ€ฒ = ๐ผ

Page 13: Background: Coordinate System Transformations

Coordinate System Transformations(Local to Global)

Y

XZ

๐‘‚

๐‘ƒ= ๐‘…โ€ฒ๐‘ƒโ€ฒ + ๐‘‚

Xโ€™

zโ€™yโ€™

P

Pโ€™Pโ€™

Rโ€™ is the rotational transformation from local to global space

Page 14: Background: Coordinate System Transformations

Y

XZ

X

Y

Z

For:

andOx=8, Oy=8, Oz=0

Find P in Global Space

๐‘ƒเดคโ€ฒ = 2๐ขฦธโ€ฒ + 2๐‘—ฦธโ€ฒ + 0๐‘˜ โ€ฒ

O

P ๐‘… = เธญ1 0 00 .707 .7070 โˆ’.707 .707เธญ

Pโ€™

Coordinate System Transformations(Example: Local to Global)

Page 15: Background: Coordinate System Transformations

Y

XZ

X

Y

ZTransform local to global:

แ‰ฐ

๐‘ƒ๐‘ฅ๐‘ƒ๐‘ฆ๐‘ƒ๐‘งแ‰ฐ= เธญ

1 0 00 .707 โˆ’.7070 .707 .707 เธญเธญ220เธญ + เธญ

880เธญ

= เธญ109.411.41เธญ

๐‘ƒ= ๐‘…โ€ฒ๐‘ƒโ€ฒ + ๐‘‚

๐‘ƒเดคโ€ฒ = 2๐ขฦธโ€ฒ + 2๐‘—ฦธโ€ฒ + 0๐‘˜ โ€ฒ

แ‰ฐ

๐‘ƒ๐‘ฅ๐‘ƒ๐‘ฆ๐‘ƒ๐‘งแ‰ฐ= เธญ

21.411.41เธญ + เธญ880เธญ

Coordinate System Transformations(Example: Local to Global)

Page 16: Background: Coordinate System Transformations

Coordinate System Transformations

Global to Local:

Local to Global:

๐‘ƒเดคโ€ฒ = ๐‘…(๐‘ƒเดคโˆ’ ๐‘‚)

๐‘ƒ= ๐‘…โ€ฒ๐‘ƒโ€ฒ + ๐‘‚

Where the rows of the rotation matrix from global to local space (R) are composed of the unit vectors of the local coordinate system axis (in global space).

Page 17: Background: Coordinate System Transformations

Non-Optimal Pose Estimation

Page 18: Background: Coordinate System Transformations

Pelvis

Page 19: Background: Coordinate System Transformations

Anatomical Coordinate Systems (pelvis)How to calculate the anatomical coordinate systems

3) Create M/L Unit Vector i from step 2unit vector = (ix, iy, iz)

4) Find the vector from the Sacrum toOrigin

1) Find midpt between LASIS & RASIS = Origin

5) Create Unit Vector v from step 4unit vector = (vx, v, vz)

6) Use i X v to get Inferior/Superior Unit Vectorunit vector = (kx, ky, kz)

7) Use k X i to get Anterior/Posterior Unit Vectorunit vector = (jx, jy, jz)

๐‘…๐‘๐‘’๐‘™๐‘ฃ๐‘–๐‘  = แ‰ฎ

๐‘–๐‘ฅ ๐‘–๐‘ฆ ๐‘–๐‘ง๐‘—๐‘ฅ ๐‘—๐‘ฆ ๐‘—๐‘ง๐‘˜๐‘ฅ ๐‘˜๐‘ฆ ๐‘˜๐‘งแ‰ฎ

X

Z

Y2) Find the vector from Origin to right ASIS

Page 20: Background: Coordinate System Transformations

Finding the Hip Center(in Pelvic Coordinate System)

X

Z

Y

Right Hip (Bell, Brand and Pederson):

X = 0.36 * ASIS DistanceY = -0.19 * ASIS DistanceZ = -0.30 * ASIS Distance

Page 21: Background: Coordinate System Transformations

Pelvis Non-Optimal Calibration:

โ€ข Finding the local coordinates of the hip center (which are needed to calibrate the other segments)

โ€ข Anthropometrics, Graphics Scaling and Graphing the Calibration Trial

Page 22: Background: Coordinate System Transformations

Pelvis: code is already partof GaitProject

Page 23: Background: Coordinate System Transformations

Thigh

Page 24: Background: Coordinate System Transformations

Anatomical Coordinate Systems (thigh)How to calculate the anatomical coordinate systems

2) Find the Knee center (Midpt of knee targets)

3) Find the vector from Knee to Hip

7) Find the the A/P axis, j, from k X v unit vector = (jx, jy, jz)

8) Find the M/L axis, i, via j X k unit vector = (ix, iy, iz)

๐‘…๐‘กโ„Ž๐‘–๐‘”โ„Ž = แ‰ฎ

๐‘–๐‘ฅ ๐‘–๐‘ฆ ๐‘–๐‘ง๐‘—๐‘ฅ ๐‘—๐‘ฆ ๐‘—๐‘ง๐‘˜๐‘ฅ ๐‘˜๐‘ฆ ๐‘˜๐‘งแ‰ฎ

1) Find the Hip center in Lab from Pelvis (tricky)

4) Find the Inferior/Superior Axis, k, from Unit vector of step 3

unit vector = (kx, ky, kz)

5) Find the vector from medial to lateral Knee

6) Find the vector v which is unit vector of step 5unit vector = (vx, vy, vz)

v

Z

X

Y

Page 25: Background: Coordinate System Transformations

Problem: Calculating the anatomical coordinate system requires a target (medial knee) not used during the

walking trial

Page 26: Background: Coordinate System Transformations

Solution: Create a virtual medial knee target which can be located during

the motion trials

Page 27: Background: Coordinate System Transformations

Step 1: Creating the temporary local coordinate system

1) Select one Point (Lateral Knee) as Origin

2) Find the unit vector from origin to the Hip unit vector = (kt

x, kty, kt

z)

3) Use the lateral knee and 3rd target to find a second vector v

6) Find the third axis via j X k unit vector = (it

x, ity, it

z) ๐‘…๐‘ก๐‘’๐‘š๐‘ = แ‰ฐ

๐‘–๐‘ก๐‘ฅ ๐‘–๐‘ก๐‘ฆ ๐‘–๐‘ก๐‘ง๐‘—๐‘ก๐‘ฅ ๐‘—๐‘ก๐‘ฆ ๐‘—๐‘ก๐‘ง๐‘˜๐‘ก๐‘ฅ ๐‘˜๐‘ก๐‘ฆ ๐‘˜๐‘ก๐‘งแ‰ฐ

5) Use the results of step 4 to find โ€œA/Pโ€ unit vector j unit vector = (jt

x, jty, jt

z)

4) Find the the โ€œA/Pโ€ axis from k X v

Page 28: Background: Coordinate System Transformations

Step 2: Storing the virtual lateral knee target

1) Start with the tracking based local coordinate system (Rtemp)

P

2) Transform P into the tracking coordinatesystem (Pโ€™) using

โ€˜

๐‘ƒโ€ฒ = ๐‘น๐’•๐’†๐’Ž๐’‘ (๐‘ƒเดคโˆ’ ๐‘‚เดค)

Where P are the global coordinates of lat knee and O are the global coordinates of the medial knee

Page 29: Background: Coordinate System Transformations

Thigh Non-Optimal Calibration:

โ€ข Finding the local coordinates of the medial knee target in the calibration trial

โ€ข Anthropometrics, Graphics Scaling and Graphing the Calibration Trial

Page 30: Background: Coordinate System Transformations

1) Create the tracking based local coordinate system (Rtemp)

2) Recall the stored vector (Pโ€™) fromorigin to the calibration target (in tracking coordinate system)

P

3) Transform Pโ€™ into the global coordinatesystem (P) using:

โ€˜๐‘ƒ= ๐‘น๐’•๐’†๐’Ž๐’‘โ€ฒ๐‘ƒโ€ฒ + ๐‘ถ

4) Use the tracking targets (including virtual) to find anatomically basedcoordinate system

Step 3: Find the anatomical system during movement

Page 31: Background: Coordinate System Transformations

Thigh: code is already partof GaitProject

Page 32: Background: Coordinate System Transformations

Shank

Page 33: Background: Coordinate System Transformations

Anatomical Coordinate Systems (shank)How to calculate the anatomical coordinate systems

2) Find the Ankle center

3) Find the vector from Ankle to Knee

6) Find the the โ€œA/P axis from k X v

8) Find the M/L axis via j X k unit vector = (ix, iy, iz)

๐‘…๐‘ โ„Ž๐‘Ž๐‘›๐‘˜ = แ‰ฎ

๐‘–๐‘ฅ ๐‘–๐‘ฆ ๐‘–๐‘ง๐‘—๐‘ฅ ๐‘—๐‘ฆ ๐‘—๐‘ง๐‘˜๐‘ฅ ๐‘˜๐‘ฆ ๐‘˜๐‘งแ‰ฎ

1) Find the Knee center in Lab from Thigh (tricky)

4) Find the Inferior/Superior Axis from Unit vector of step 3

unit vector = (kx, ky, kz)

5) Find the vector v from medial to lateral Ankle

7) Find the Unit A/P vector junit vector = (jx, jy, jz)

v

Page 34: Background: Coordinate System Transformations

Problem: Calculating the anatomical coordinate system requires a target (medial ankle) not used during the

walking trial

Page 35: Background: Coordinate System Transformations

Solution: Create a virtual medial ankle target which can be located

during the motion trials

Page 36: Background: Coordinate System Transformations

Step 1: Creating the temporary local coordinate system

1) Select one Point (Lateral Ankle) as Origin

2) Find the unit vector from origin to the Knee unit vector = (kt

x, kty, kt

z)

3) Use the lateral ankle and 3rd target to find a second vector v

6) Find the third axis, i, via j X k unit vector = (it

x, ity, it

z) ๐‘…๐‘ก๐‘’๐‘š๐‘ = แ‰ฐ

๐‘–๐‘ก๐‘ฅ ๐‘–๐‘ก๐‘ฆ ๐‘–๐‘ก๐‘ง๐‘—๐‘ก๐‘ฅ ๐‘—๐‘ก๐‘ฆ ๐‘—๐‘ก๐‘ง๐‘˜๐‘ก๐‘ฅ ๐‘˜๐‘ก๐‘ฆ ๐‘˜๐‘ก๐‘งแ‰ฐ

4) Use the results of step 3 to find a second unit vector unit vector = (vx, vy, vz)

5) Find the the โ€œA/Pโ€ axis from k X v unit vector = (jt

x, jty, jt

z)

Page 37: Background: Coordinate System Transformations

Step 2: Storing the virtual lateral ankle target

1) Start with the tracking based local coordinate system (Rtemp)

P

2) Transform P into the tracking coordinatesystem (Pโ€™) using

โ€˜

๐‘ƒโ€ฒ = ๐‘น๐’•๐’†๐’Ž๐’‘ (๐‘ƒเดคโˆ’ ๐‘‚เดค)

Where P are the global coordinates of lat ankle and O are the global coordinates of the medial ankle

Page 38: Background: Coordinate System Transformations

Shank Non-Optimal Calibration:

โ€ข Finding the local coordinates of the medial ankle target in the calibration trial

โ€ข Anthropometrics, Graphics Scaling and Graphing the Calibration Trial

Page 39: Background: Coordinate System Transformations

1) Create the tracking based local coordinate system (Rtemp)

2) Recall the stored vector (Pโ€™) fromorigin to the calibration target (in tracking coordinate system)

P

3) Transform Pโ€™ into the global coordinatesystem (P) using:

โ€˜๐‘ƒ= ๐‘น๐’•๐’†๐’Ž๐’‘โ€ฒ๐‘ƒโ€ฒ + ๐‘ถ

4) Use the tracking targets (including virtual) to find anatomically basedcoordinate system

Step 3: Find the anatomical system during movement

Page 40: Background: Coordinate System Transformations

Foot

Page 41: Background: Coordinate System Transformations

Anatomical Coordinate Systems (foot)How to calculate the anatomical coordinate systems

3) Find Z Axis from Unit vector of step 1unit vector = (kx, ky, kz)

4) Find the vector from Origin to Heel v

7) Find the the Y axis, j, from k X i unit vector = (kx, ky, kz)

6) Find the unit vector from step 2 unit vector = (ix, iy, iz)

๐‘…๐‘“๐‘œ๐‘œ๐‘ก = แ‰ฎ

๐‘–๐‘ฅ ๐‘–๐‘ฆ ๐‘–๐‘ง๐‘—๐‘ฅ ๐‘—๐‘ฆ ๐‘—๐‘ง๐‘˜๐‘ฅ ๐‘˜๐‘ฆ ๐‘˜๐‘งแ‰ฎ

2) Find the Vector from Toe to Origin

5) Find the M/L axis via k X v

Y

Z

X

1) Find midpoint of ankle targets = Origin (from Shank - tricky)

Page 42: Background: Coordinate System Transformations

Foot Non-Optimal Calibration:

Anthropometrics, Graphics Scaling and Graphing the Calibration Trial

Page 43: Background: Coordinate System Transformations

Assignment #5 โ€“ Build Non Optimal Model in Gait Project for the right thigh, right shank and

right foot

Letโ€™s Look at the Pelvis and Thigh Code right now


Recommended