c++ - 3D Coordinate System Transformation (X,Y,Z) to (X',Y',Z') -


I am working with reference to the new Kinect v2, and a task coordination system for the given frame I'm trying to do with coordinates (X, Y, Z) in mm line up, transform or Kinect is related to camera coordination systems and about that object which he is looking at.

This object has its own coordinate frame, its X, Y, and Z axis tracks the connecting object, returns the world, coordinates with kinact in X, Y, Z root. However, keeping in mind X, Y, and Z Offset, I can also specify a new root within the same coordinate frame.

I was thinking that if I started in the position of the object, the same origin, I could understand who used the instructions given to their X ', Y', and 'Z' movements. Can translate

You can see what I'm saying about here) Drawing.

bad drawing

Is there a way IX ', y Set a coordinate frame when given a new set of values ​​'and z'? Suppose I have 3 sets of coordinates in both the frame frame and the connect frame. I 3 pairs (x, y, x, x, y, x, x, x, x, x, x, x, x, Z) and know the initial values ​​of (x ', y', z ').

I actually used a simple change in the base method using its The problem has been solved because the two coordinate frames are both orthonormal and similar origin , it was as easy to create a change-based base matrix, and its use To move from one system to another, sync the system.

This is my code, if anyone is looking at how to do it with C ++ / OpenCV, I use cv :: Mat to manipulate the matrix I do

The coordinate frame with the object ordinorimal base vector, // the elements in each base vector are x, y, z float u [3] = {ux, uy, uz}; Float v [3] = {vx, vy, vz}; Float w [3] = {wx, wy, wz}; To make the vector normal, create a vertical float euland = sqrt (ux * ux + uy * uy + uz * uz); Flap vlength = sqrt (vx * vx + vy * vy + vz * vz); Flap wlength = sqrt (wx * wx + wy * wy + wz * wz); // Establishment of change of base matrix Float data [3] [3] = {{ux / ulength, uy / ulength, uz / ulength}, {vx / vlength, vy / vlength, vz / vlength}, {wx / wlength, wy / wlength, wz / wlength }}; // cv :: Mat cv :: Mat M = cv :: Mat (3, 3, CV_32FC1, and data) Store array; // Create a coordinate of vector mate in the connect frame. Float kenectcold [3] = {x, y, z}; Cv :: Mat D = cv :: Mat (3, 1, CV_32FC1, & amp; kinectcoords); // Find the coordinates in the object frame // If there is a coordinate vector in the D-connect frame, the coordinate vector in the P object frame is //, and M is the change of the base matrix, then the method // p = minove * d. CV :: Mate Objectcoords is my 'P' vector Cv :: Mat Minve = M.inv (); CV :: Mate Objects = MinW * D; Float objx = objectcoords.at & lt; Float & gt; (0); Float objy = objectcoords.at & lt; Float & gt; (1); Float objz = objectcoords.at & lt; Float & gt; (2);

Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -