coordinate-transformation

Is it possible to anchor a matplotlib annotation to a data coordinate in the x-axis, but to a relative location in the y-axis?

谁都会走 提交于 2019-12-29 01:35:14
问题 I have a plot where I'd like to annotate a specific location on the x-axis with an arrow and a label: The location of the tip of the arrow needs to be specified exactly in data coordinates. The arrow should be vertical, therefore the x-coordinate of the blunt end of the arrow (and the text label) should also be specified exactly in data coordinates. However, I would ideally like to be able to specify the y-position of the blunt end of the arrow relative to the axis bounding box, rather than

ROS Rviz visualization of Tango Pose data

杀马特。学长 韩版系。学妹 提交于 2019-12-25 17:07:39
问题 We have modified sample code for the C API so Tango pose data (position (x,y,z) and quaternion (x,y,z,w) ) is published as PoseStamped ROS messages. We are attempting to visualize the pose using Rviz. The pose data appears to need some transformation as the rotation of the Rviz arrow does not match the behavior of the Tango when we move it around. We realize that in the sample code, before visualization on the Tango screen, the pose data is transformed into a 4x4 Pose matrix (function

Coordinates scale not correct when drawing a polyline on an View

▼魔方 西西 提交于 2019-12-25 09:44:43
问题 I want to draw a polyline on a view . I don't want to draw it on a MapView because I only want the polyline without any background. I have the polyline coordinates and I also have its bounds (northeast and southwest coordinates). The idea was to create a custom view and draw the path there. The problem I believe I'm having is with the scale. I can convert the LatLng coordinates to x and y coordinates but the polyline that is shown on the view is too small. The view is set with a 64dp width

Coordinates transformation

ぐ巨炮叔叔 提交于 2019-12-24 20:33:08
问题 I have two 3D objects in space and i want to copy the points from one object to another. The problem is that these objects don't share a common coordinate system and i have to do coordinate transformations. I have the local transformation matrix for both objects and i have also access to the world transformation matrix. I know there's some calculations to be done using these transformation matrices but i don't know how. How can i transform one point in the first object so that it has the same

glm returning nan on simple translate

时光怂恿深爱的人放手 提交于 2019-12-24 00:36:12
问题 I'm tinkering with OpenGL using glfw, glad, and glm. In one of the tutorials I'm using, they demonstrate some simple usage of glm as so: glm::vec4 vec(1.0f, 0.0f, 0.0f, 1.0f); glm::mat4 trans; trans = glm::translate(trans, glm::vec3(1.0f, 1.0f, 0.0f)); vec = trans * vec; std::cout << vec.x << vec.y << vec.z << std::endl; When I compile and run this code, I get trash values (usually NAN). The tutorial specifically noted that instantiating glm::mat4 trans; would by default create an identity

How to project a new point to PCA new basis?

こ雲淡風輕ζ 提交于 2019-12-23 18:13:38
问题 For example, I have 9 variables and 362 cases. I've made PCA calculation, and found out that first 3 PCA coordinates are enough for me. Now, I have new point in my 9-dimensional structure, and I want to project it to principal component system coordinate. How to get its new coordinates? %# here is data (362x9) load SomeData [W, Y] = pca(data, 'VariableWeights', 'variance', 'Centered', true); %# orthonormal coefficient matrix W = diag(std(data))\W; % Getting mean and weights of data (for

SVG viewBox reversing Y-coordinates

三世轮回 提交于 2019-12-23 12:55:24
问题 I'm using SVG to draw in a HTML page different shapes. These different shapes are retrieved from geometry objects of a spatial database in Microsoft Sql Server. The problem I'm facing is that the system of coords (Svg and Microsoft Sql Server) is different. 0,0 begins in Svg on the top left corner, whereas in Microsoft Sql Server it starts at the bottom left corner. I need to reverse just the Y coords. I'm also using viewBox to display the data properly (for different transformations). Is

Transforming screen coordinates from security camera to real world coordinates

隐身守侯 提交于 2019-12-23 06:47:19
问题 I have the frames from a surveillance camera observing a big public hall from an angle close to 45° relative to the ceiling. Every person is annotated for each frame they appear in with screen coordinates (1920 X 1080 px). Which means I have (X,Y) coordinates for each person for each frame. Now what I need to do is transform these coordinates into real world coordinates, since naturally there is a distortion between sections close to the camera and sections further away from it. In the end I

Not able to translate device co-ordinate system to world co-ordinate system on android

我怕爱的太早我们不能终老 提交于 2019-12-22 17:59:02
问题 I have written a small code to convert the device co-ordinates into world co-ordinates by multiplying the Rotation matrix(using getRotationMatrix) and the vector (Ax,Ay,Az) which are the accelerometer values. When I run this, and the phone is static, I get a very fluctuating value for the Z axis(from 9.3 to 10.3) and the other two are 0. However when I give the phone some acceleration in any direction , it still doesn't show any change to those values and they remain zero. This is the part of

How to rotate 2 objects independently in pygame and pyopengl

不想你离开。 提交于 2019-12-22 13:11:30
问题 I'm trying to rotate 2 objects independently but when I run the code both objects rotate in the same direction enter code here here i save the matrix and rotate a square under the cube def rotate_square(): glColor3f(1,1,1) glMatrixMode(GL_MODELVIEW) glPushMatrix() glRotatef(45,0,1,0) glBegin(GL_LINES) glVertex3fv(v1); glVertex3fv(v2); glVertex3fv(v1); glVertex3fv(v3); glVertex3fv(v3); glVertex3fv(v4); glVertex3fv(v2); glVertex3fv(v4); glEnd() glPopMatrix() main function def main(): pygame