Select to view content in your preferred language

How to correct z-values for tilted surface

3110
2
11-01-2013 06:51 PM
by Anonymous User
Not applicable
Original User: kam678

I am a physical anthropologist trying to use ArcGIS to run some analyses on a bone surface to suss out the age at death of an individual. I took several scans using a NextEngine 3D laser scanner, which I edited in ScanStudio and exported as VRML and XYZ files. Because there is no georeferencing for a bone, I am encountering some difficulties when I import the data into ArcScene. Basically, whatever angles the samples were at during scanning seems to be how they're oriented in ArcScene. Their positions on the scanning platform were dictated by getting them to stay in place for the duration of the scan. But now I'd like them to sort of lay flat so I do things like get meaningful slopes and such. I've attached a picture of a "wonky" sample that is nearly upside-down and what orientation I'd like it to be fixed at.

Unfortunately, this isn't just a matter of adjusting the z-coordinate values by a uniform amount; I need to rotate the entire sample around some imaginary axis. Is there any tool to do that in ArcGIS (or if anyone knows of a different software with this ability)? And yeah, I know this is kind of a long shot.

Thanks!

-Kate
Tags (1)
0 Kudos
2 Replies
XanderBakker
Esri Esteemed Contributor
Hi Kate,

If it's possible to do this when exporting your data to XYZ, it might be the easiest way. If not you could write some Python code to apply "Euler�??Rodrigues formula". There is a nice example on Stack Overflow based on numpy (which come with the ArcGIS Python installation), see post on Stack Overflow: "Python - Rotation of 3D vector"

import numpy as np

def rotation_matrix(axis,theta):
    axis = axis/np.sqrt(np.dot(axis,axis))
    a = np.cos(theta/2)
    b,c,d = -axis*np.sin(theta/2)
    return np.array([[a*a+b*b-c*c-d*d, 2*(b*c-a*d), 2*(b*d+a*c)],
                     [2*(b*c+a*d), a*a+c*c-b*b-d*d, 2*(c*d-a*b)],
                     [2*(b*d-a*c), 2*(c*d+a*b), a*a+d*d-b*b-c*c]])

v = np.array([3,5,0])
axis = np.array([4,4,1])
theta = 1.2 

print(np.dot(rotation_matrix(axis,theta),v))             
# [ 2.74911638  4.77180932  1.91629719]


The hardest part will probably be defining the axis and theta of the rotation... Once you have those it's a matter of looping through the data and write the rotated data to a new dataset.

Another option may be using MATLAB...

Kind regards,

Xander
0 Kudos
by Anonymous User
Not applicable
Original User: hisagar123

Hi did you figure out how to rotate the dataset along a particular axis by a particular angle? I have the same problem, because of the angle of view of the scanner.

Thank you
0 Kudos