Cluster centroid and vector analysis

2 visualizaciones (últimos 30 días)
ChrisH
ChrisH el 15 de Sept. de 2017
Comentada: ChrisH el 21 de Sept. de 2017
Hello,
I am running an experiment where subjects are completing a 3d reach task with a tool while I am tracking the tool tip position. As a result, I have a matrix of (x,y,z) coordinates (@ 20Hz) captured from a tool tracking device of the reach between two stationary targets. While the distances between the targets is fixed (4.5cm), the reference frame of the tracking devise is not fixed (as it is a portable device). Subsequently, the tracked target positions are relative across all subjects.
I have applied the following code to generate a scatter of the centered and rotated data (XYZ):
xyz0=mean(XYZ);
A=bsxfun(@minus,XYZ,xyz0); %center the data
[U,S,V]=svd(A,0);
A_rot = A*V; %V(:,1) is the direction of most variance
A_final = bsxfun(@minus,A_rot,[min(A_rot(:,1)) 0 0]);
scatter3(A_final(:,1),A_final(:,2),A_final(:,3));
I would like to
  1. Locate the centroid of each target
  2. determine the vector distance between the target centroids
  3. determine the time taken to move fro target 1 to target 2
Is cluster analysis required to determine the cluster centroids? If so, may someone suggest a good reference? If I use the mean of each cluster, how can I determine the time taken to move from target 1 to target 2? I assume that I must find the data point that is closest to the target 1 centroid and count the number of frames between that point and the point nearest target 2's centroid?
Any advice and/or references would be greatly appreciated. Many thanks!
  1 comentario
ChrisH
ChrisH el 15 de Sept. de 2017
Alternatively, a simple way of finding the positions of the two targets may be to find the two positions where the tool tip lingers for a period of time. i.e if the tool tip is within a specific range for more than x-frames than that position is a target.
Any suggestions?

Iniciar sesión para comentar.

Respuesta aceptada

Image Analyst
Image Analyst el 15 de Sept. de 2017
Assuming they start and end at the target, why not just take the mean (x,y,z) of the first 20 points and the last 20 points?
  9 comentarios
ChrisH
ChrisH el 20 de Sept. de 2017
Thank you very much! Yeah, the position sensor does not calibrate the tool tip properly it seems, I am working on fixing this.
ChrisH
ChrisH el 21 de Sept. de 2017
I cant seem to fix the variability in the tool tip calibration using the software that comes with the position sensor. Are you able to assist me with figuring out how to extrapolate tool tip position from the rigid body marker coordinates? There are four markers fixed on the rigid body that are tracked simultaneously. The first frame of data looks like the following (in mm):
Tx Ty Tz
A 97.352 -120.289 -958.28
B 109.696 -144.125 -945.219
C 155.972 -118.524 -929.248
D 125.658 -101.497 -949.232
From this, I would like to track the tool tip which is 30cm from marker C (see image of tool with rigid body attached), along a vector between marker A and C. I know that I cannot simply extrapolate the vector A-C as the rotational relationship between markers A-D will not be preserved.

Iniciar sesión para comentar.

Más respuestas (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by