COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### Center of Rotation in 3D motion

• Email
• Follow

```I have a set of 3D marker data attached on a body that rotates around a semi-constrained joint. I would like to find the center of rotation in three-dimensional coordinate system (x,y,z). Do you know any matlab codes for this calculation?
Thanks a bunch!

```
 0

See related articles to this posting

```"Serkan" wrote in message <j9vf76\$e5v\$1@newscl01ah.mathworks.com>...
> I have a set of 3D marker data attached on a body that rotates around a semi-constrained joint. I would like to find the center of rotation in three-dimensional coordinate system (x,y,z). Do you know any matlab codes for this calculation?
> Thanks a bunch!
- - - - - - - - -
Perhaps we can rephrase the statement of your problem.  You have a set of 3D cartesian coordinates of your "marker data", P, and at a later moment another set, Q, of coordinates of these corresponding points after a period of rotation about some line.  You would like to know what that line of rotation is.  Do I state things correctly?

It can be shown that any displacement of a rigid 3D body can be accomplished by a rotation about some axis combined with a translation along that axis - a "screw" type displacement.  Presumably in your case there is known to be no such translational component along the axis, only a pure rotation about the axis through some angle.

It can also be shown that the best fit between the two corresponding point sets in a least squares sense can be achieved by translating each of their centroids to the origin and then rotating one of them via a rotation matrix about the origin to best fit the other.  This latter can be accomplished using matlab's 'svd' (singular value decomposition) function utilizing the Kabsch algorithm.  See for example:

http://en.wikipedia.org/wiki/Kabsch_algorithm

The equivalent can also be done using the Statistics Toolbox function 'procrustes' appropriately.  See its documentation.

Your next task is to determine from this rotation matrix the corresponding axis of rotation and the angle of rotation.  For this you can use the technique shown in:

http://en.wikipedia.org/wiki/Rotation_matrix

using matlab's 'eig' function.

Finally, from the axis of rotation relative to the centroid of one of the sets, the rotation angle, and the translation between the two centroids, it is a problem in solid geometry to determine where the parallel axis of "pure" rotation is located that requires no translation, and which is presumably what you are seeking.  I'll let you solve that part on your own.  You can probably make good use of matlab's cross product function, 'cross', for this purpose.

Roger Stafford
```
 0
Reply ellieandrogerxyzzy (4806) 11/16/2011 7:52:13 PM

```Thank very much Roger for your kind response. I will take a look at the techniques and resources you referred. I hope that you would be available to answer my questions if I had further along the road.
Kind Regards...
```
 0

```"Roger Stafford" wrote in message <ja149d\$2k4\$1@newscl01ah.mathworks.com>...
>
>   It can also be shown that the best fit between the two corresponding point sets in a least squares sense can be achieved by translating each of their centroids to the origin and then rotating one of them via a rotation matrix about the origin to best fit the other.  This latter can be accomplished using matlab's 'svd' (singular value decomposition) function utilizing the Kabsch algorithm.  See for example:
>
>  http://en.wikipedia.org/wiki/Kabsch_algorithm
>
> The equivalent can also be done using the Statistics Toolbox function 'procrustes' appropriately.  See its documentation.
>
>   Your next task is to determine from this rotation matrix the corresponding axis of rotation and the angle of rotation.  For this you can use the technique shown in:
=========

@Serkan, all of the tasks that Roger has described here, including the extraction of the rotation axis, can be done virtually simultaneously using this tool from the File Exchange

http://www.mathworks.com/matlabcentral/fileexchange/26186-absolute-orientation-horns-method

To illustrate this, consider the following data, in which I rotate the columns of A about the axis that is parallel to [1 2 5] and translated by [10,20,30] to produce data set B.

>> A=rand(3,5);
>> B=AxelRot(A,20,[1 2 5],[ 10,20,30]);
>>
>> reg=absor(A,B);
>> axisOfrotation=reg.q(2:end)/reg.q(2)

axisOfrotation =

1.0000
2.0000
5.0000

>> axisShift=pinv(eye(3)-reg.R)*reg.t

axisShift =

3.3333
6.6667
-3.3333

A few notes:

1. The AxelRot function is my own utility function, but is available here

2. The axisShift is not uniquely defined. Both it and [10;20;30] however will satisfy the equation

x-reg.R*x=reg.t

The following verifies this:

>> (eye(3)-reg.R)*axisShift - reg.t

ans =

1.0e-014 *

-0.0888
-0.1443
-0.5634

>> (eye(3)-reg.R)*[10;20;30] - reg.t

ans =

1.0e-013 *

-0.1377
0.3242
-0.1349
```
 0
Reply mattjacREMOVE (3193) 11/16/2011 8:23:29 PM

```"Roger Stafford" wrote in message <ja149d\$2k4\$1@newscl01ah.mathworks.com>...
>
>   It can be shown that any displacement of a rigid 3D body can be accomplished by a rotation about some axis combined with a translation along that axis - a "screw" type displacement.
================

I don't see how that can be true, Roger.
If I start with an arbitrary roto-translation

y=R*x+t

then your comment here seems to say that there is a 2nd equivalent decomposition

y=Ra*x+ta

where Ra and ta are a rotation/translation about/along some axis. But the representation of a rototranslation is unique, so that would imply R=Ra, t=ta implying in turn that all rotations are rotations about an axis and all translations are translations along an axis. Obviously, there's something I'm missing here...

```
 0
Reply mattjacREMOVE (3193) 11/16/2011 9:34:26 PM

```"Matt J" wrote in message <ja1a92\$n0j\$1@newscl01ah.mathworks.com>...
> "Roger Stafford" wrote in message <ja149d\$2k4\$1@newscl01ah.mathworks.com>...
> >   It can be shown that any displacement of a rigid 3D body can be accomplished by a rotation about some axis combined with a translation along that axis - a "screw" type displacement.
>
> I don't see how that can be true, Roger.
> If I start with an arbitrary roto-translation
>
> y=R*x+t
>
> then your comment here seems to say that there is a 2nd equivalent decomposition
>
> y=Ra*x+ta
>
> where Ra and ta are a rotation/translation about/along some axis. But the representation of a rototranslation is unique, so that would imply R=Ra, t=ta implying in turn that all rotations are rotations about an axis and all translations are translations along an axis. Obviously, there's something I'm missing here...
- - - - - - - - - -
Yes, the statement I made is quite true, Matt.  It is a fundamental theorem in kinematics due to Chasles.  See the site:

http://en.wikipedia.org/wiki/Chasles'_theorem

It is also stated in the book "Analytical Dynamics" by E. T. Whittaker where it says, "the most general displacement of a rigid body can be obtained by first translating the body, and then rotating it about a line."  Also it says, "This combination of a translation and a rotation round a line parallel to the direction of translation is called a screw."

Remember that writing the homogeneous expression R*x with R a "rotation matrix" involves only a rotation about a line passing through the coordinate origin.  Chasles' theorem speaks of a rotation about a line that doesn't necessarily pass through the origin, together with a translation parallel to that same line.

Roger Stafford

```
 0
Reply ellieandrogerxyzzy (4806) 11/16/2011 10:57:11 PM

```"Roger Stafford" wrote in message <ja1f47\$96s\$1@newscl01ah.mathworks.com>...
> "Matt J" wrote in message <ja1a92\$n0j\$1@newscl01ah.mathworks.com>...
> > I don't see how that can be true, Roger.
>   Yes, the statement I made is quite true, Matt.  It is a fundamental theorem in
- - - - - - - -
Afterword:  A "screw" type transformation of the Chasles type could be written as:

y = R*(x-a)+b

where the axis of (homogeneous) rotation matrix R is parallel to the vector b-a, and a and b are points along the (offset) axis of rotation.

Roger Stafford
```
 0
Reply ellieandrogerxyzzy (4806) 11/16/2011 11:20:28 PM

```Thank you guys!
```
 0

```"Serkan" wrote in message <ja3dld\$hrd\$1@newscl01ah.mathworks.com>...
> Thank you guys!

Hi Serkan,

could you find a suitable solution for finding the rotation center?

It would be kind if you could post any hints about the algo to develop

Thanks
```
 0
Reply mkamil (1) 11/22/2011 8:39:08 PM

8 Replies
45 Views

Similar Articles

12/5/2013 9:11:36 AM
[PageSpeed]

Similar Artilces:

Motion
Hi, irgendwelche Erfahrungen mit "Motion" in dieser Gruppe vorhanden? Eine Demo/Evaluationsversion gibt es nicht, oder? -- Gru�, Martin. In article <1gg8lg3.uisiph9unnz6N%martin.spam.wech.sassenberg@t-online.de>, martin.spam.wech.sassenberg@t-online.de (M. Sassenberg) wrote: > Hi, > > irgendwelche Erfahrungen mit "Motion" in dieser Gruppe > vorhanden? <http://discussions.info.apple.com/webx?14@108.xFhyaa4CqsC.4@.6891ed53> > Eine Demo/Evaluationsversion gibt es nicht, oder? Nein, aber dort ist dieses: <http://www.apple.com/motion/video/> <http://www.apple.com/motion/quicktour/>

Motion JPEG?
by some commonly available video player. > odd, you make the file or it came from somewhere else?... > I'm hoping I can just give it the appropriate extension, and slap some > sort of header on it. > doubtful. most video formats are a little more "involved" than this, eg, each encoded frame is wrapped in some manner of container, and the whole mass is prefixed by any requisite headers (telling what codecs are used for the audio and video frames, ...). afaik, one could encode each image as a seperate frame in, say, an avi file, and use a motion-jpeg codec, along with having the correct fourcc and similar in the avi headers. then again, I don't know, somehow I suspect that many motion jpeg codecs would tweak out the encoded jpegs somehow to try to save space (only encoding huffman and quantizer tables or such in some frames, ...). maybe giving the basic idea: http://en.wikipedia.org/wiki/AVI http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directshow/htm/avirifffilereference.asp then again, someone who knows more about this could probably offer better answers. > Thanks > "cr88192" <

motion compensation
various methods of motin compensation used in video compression <ruchikalalit@gmail.com> wrote in message news:1171959866.732896.261660@m58g2000cwm.googlegroups.com... > various methods of motin compensation used in video compression > yes. now, do you have a question or comment to go along with this statement?...

Hallway and stair motion sensors
I'd like to place an X-10 motion sensor to control the lights in a hallway. Likewise, another sensor would activate the lights on a stairway. The lights should come on only after dusk and turn off a few minutes after the motion is detected. I'm using ActiveHome with a CM11a. I have a few concerns: 1) Which X-10 sensor to use, the Active Eye (MS16a) or the Eagle Eye (MS14a)? The Active Eye cost a bit more, is there an advantage to using it? 2) The X-10 sensors "sample" for motion every few seconds. This seems to make them impractical since I could be half way down... believe that two sensors will generate exactly at the same time a command. For me, you can place two of it covering the same area. Hope it helps Thierry "Steven Kinkead" <sck_newsgroups@spamex.com> a �crit dans le message news: %3nDb.40139\$Hw6.20719@newssvr29.news.prodigy.com... > I'd like to place an X-10 motion sensor to control the lights in a hallway. > Likewise, another sensor would activate the lights on a stairway. The > lights should come on only after dusk and turn off a few minutes after the > motion is detected. I'm using ActiveHome

SMOOTH Zooming Motion Blur?
Hi, When using the Motion Blur filter, a series of 'steps' appear in the image: as if a smaller version of the original is superimposed upon the original image (so I assume that's the way motion bluring works). It creates a rather 'fake' and clumsy effect, is there any way at all around it? Blurring afterwards works in small images, but a big one (like a 1280x960 wallpaper I'm currently working on) requires too much of it. The effect is most visible on the corners of the image. -- Greets, Bart Van Hove http://www.bartendavid.be (Dutch)

help for motion compensation
hi every body, my problem is to programm with VHDL a module that will be a part of a video codec which is the motion compensation , i want know what are the inputs and the outputs of my module because i m a beginner with VHDL and i want know how to think ( way ) to get the inputs and outputs for my module all my respect for u and thanks On 24 fev, 12:30, "VHDL_HELP" <abai...@gmail.com> wrote: > hi every body, > my problem is to programm with VHDL a module that will be a part of a > video codec which is the motion compensation , i want know what are > the inputs and the outputs of my module because i m a beginner with > VHDL and i want know how to think ( way ) to get the inputs and > outputs for my module > all my respect for u and thanks The inputs and outputs are the very specification of the problem and it's solution... so we can't tell you.

Best X10 motion detector?
; I have the Stanley ones installed, but what I have done is buy some standard PIR motion detectors and wire them up to a powerflash module via a transformer, and this gives greater sensitivity. Details on www.redoak.co.uk and www.hometoys.com though my article is here: http://www.hometoys.com/htinews/apr04/articles/perry/motion.htm -- JohnPerry@redoak.co.ukNOSPAM (delete NOSPAM) www.redoak.co.uk www.eze-buy.co.uk Thanks, but what is a PIR? John Perry <JohnPerry@redoak.co.ukNOSPAM> writes: > Adam Megacz <adam@megacz.com> wrote: > >> >>I currently have a PR511 (the AC-powered model with floodlights). >>It's okay -- better than the tiny ones with two AAA batteries (forget >>the model), but I'd still like something with better sensitivity, and >>I'm willing to pay more for it. >> >>Any recommendations? AC-powered (no batteries) is a major plus; I >>hate changing batteries and my install location has easy access to >>electrical lines. >> > I have the Stanley ones installed, but what I have done is buy some > standard PIR motion detectors and wire them up to a powerflash module

motion detection (ROI)
How to detect the motion and mark the region of interest in a sequence???? I have converted a video in to a sequence of images, i want to know, how can the moving vehicles be detected in that sequence and mark a rectangular box for those or consider them as the regions of interest???? PLEASE HELP ME!!!!!!!!!!!

Wavelet-Based Motion Estimation
I hope help how can use wavelet-based motion estimation technique for dense flow tracking in order to include information of the entire range of facial motion. Flow-based principal component analysis is presented to compress the high-dimensional dense flows to a low-dimensional weight vector for each frame in a video sequence, which is encoded for recognition processes and expression intensity estimation

3D motion SW ?
Hi, I would like to know if there is any software that is able to convert SW 3D diagrams into animate ones? Thanks! I haven't yet installed SW2005, and maybe it has some new magic stuff (Mike Wilson makes it sound good, and he's no pushover), but I use Bulents Screen Recorder to make AVI files. Basically you get to designate an area of the screen (a frame)to capture. In one mode you can allow it just to run while you move your SolidWorks part or assembly and it records automatically. In another mode you take a shot, then move your SW part or assembly however you like, take another shot, etc.. Either way it will combine all your shots into an AVI file. Lets you discard shots and duplicate shots (to slow the motion), specify the frames per second, etc.. Version 1.5a was free, but the newest version (2.4b) is shareware. Latest and greatest is at http://www.thesilver.net/. The earlier version is still available at http://www.myzips.com/software/Bulent's-Screen-Recorder.phtml. 'Sporky' silencencounter wrote: > > Hi, > > I would like to know if there is any software that is able to convert SW > 3D diagrams into animate ones