Does OpenVR pre-process orientation data from Vive Trackers? - orientation

According to its specifications (page "11"|14), the Vive Tracker's coordinate system is right-handed Y-Up, X-Lateral, and the reference orientation is somehow determined from the area spanned by the HTC Vive base stations.
I am trying to align this coordinate system and reference orientation with an IMU (which uses a Z-Up, X-Lateral, RH-system and the magnetic north pole as reference), but when rotating the quaternion data I obtain from the Vive Tracker through the OpenVR C++ API in a way that it should match the IMU's coordinate system and reference, there is still some yaw component in the Tracker data when I perform a roll motion on both the IMU and the Tracker simultaneously.
Hence, does the OpenVR API do some orientation data pre-processing, so that quaternions received from OpenVR don't necessarily correspond to the device's coordinate system any more? Or may I be doing something else wrong?

Related

GPS to Pixel coordinate

I want to display Radar information on the vessel identified in the Camera image.
At this point, the work is complete.
Camera Image: The ship was identified by object recognition.
Radar information: Identified the latitude, longitude, distance, and azimuth of the vessel (A, B, C).
Three sea-going vessels and a radar plot
The camera and radar are located at the same position and know the latitude, longitude, roll, and pitch values.
How can we match GPS information by converting pixel coordinates?
Same three vessels annotated with distances
You want to project the 3D coordinates to the image plane. A more detailed information about the theory behind can be found in the OpenCV documentation.
This is a brief description of how it could be done:
Compute your vessel's 3D coordinates relative to your camera position.
You need a calibrated camera. You need the interior camera parameters to compute the projection from 3D coordinates to 2D image coordinates.
Use e.g. OpenCV and projectPoints (see doc here) to compute the 2D image coordinates based on the relative 3D coordinates and your camera parameters. Because you use the relative position of the vessel you don't need the exterior orientation of your camera. So translation and rotation become zero.

How to calculate translation matrix?

I have 2D image data with respective camera location in latitude and longitude. I want to translate pixel co-ordinates to 3D world co-ordinates. I have access to intrinsic calibration parameters and Yaw, pitch and roll. Using Yaw, pitch and roll I can derive rotation matrix but I am not getting how to calculate translation matrix. As I am working on data set, I don't have access to camera physically. Please help me to derive translation matrix.
Cannot be done at all if you don't have the elevation of the camera with respect to the ground (AGL or ASL) or another way to resolve the scale from the image (e.g. by identifying in the image an object of known size, for example a soccer stadium in an aerial image).
Assuming you can resolve the scale, the next question is how precisely you can (or want to) model the terrain. For a first approximation you can use a standard geodetical ellipsoid (e.g. WGS-84). For higher precision - especially for images shot from lower altitudes - you will need use a DTM and register it to the images. Either way, it is a standard back-projection problem: you compute the ray from the camera centre to the pixel, transform it into world coordinates, then intersect with the ellipsoid or DTM.
There are plenty of open source libraries to help you do that in various languages (e.g GeographicLib)
Edited to add suggestions:
Express your camera location in ECEF.
Transform the ray from the camera in ECEF as well taking into account the camera rotation. You can both transformations using a library, e.g. nVector.
Then proceeed to intersect the ray with the ellipsoid, as explained in this answer.

Find distance between iOS Device Camera and user's face

I am trying to find distance between iOS device's front-facing camera and user's face in the real world.
So far, I have tried ARKit/SceneKit, and using ARFaceAnchor I am able to detect user's face distance from camera; but it works only in close proximity (up to about 88 cm). My application requires face distance detection up to 200 cms.
I am assuming this could be achieved without the use of trueDepth data (which is being used in ARFaceAnchor).
Can you put me in the right direction?
In order to get the distance between the device and the user's face you should convert position of the detected user's face into camera's coordinate system. To do this, you will have to use the convertPosition method from SceneKit to switch coordinate space, from face coordinate space to camera coordinate space.
let positionInCameraSpace = theFaceNode.convertPosition(pointInFaceCoordinateSpace, to: yourARSceneView.pointOfView)
theFaceNode is the SCNNode created by ARKit representing the user's face. The pointOfView property of your ARSCNView returns the node from which the scene is viewed, basically the camera.
pointInFaceCoordinateSpace could be any vertices of the face mesh or just the position of theFaceNode (which is the origin of the face coordinate system). Here, positionInCameraSpace is a SCNVector3, representing the position of the point you gave, in camera coordinate space. Then you can get the distance between the point and the camera using the x,y and z value of this SCNVector3 (expressed in meters).
these are some links that may help you :
-Distance between face and camera using ARKit
-https://github.com/evermeer/EVFaceTracker
-https://developer.apple.com/documentation/arkit/arfacetrackingconfiguration
-How to measure device distance from face with help of ARKit in iOS?

the difference between the definition of the back camera, and IMU coordinate system of IPhone 6

I'm using some computer vision algorithm to aid the motion sensor (inertial measurements unit [IMU]) that are built on iPhone 6.
Its important to know the difference between the camera and IMU coordinate systems definition.
I'm sure that apple defines the IMU coordinate system as follow:
But I do not know how they define the x,y,z axis of the camera.
my ultimate goal is to transfer the IMU measurement to the camera coordinate system
The trick here is to view the axis from the top and reference it to the Right rotation and notice the rotational movement of the axis. If it doesn't rotate it's positive. If it rotates check the direction of the rotation; if it rotates to the CW then it's negative CCW is positive.

How to calculate coordinates of center of image from an aerial camera whose FOV, attitude and position are given

I have a problem that involves a UAV flying with a camera mounted below it. Following information is provided:
GPS Location of the UAV in Lat/Long
GPS Height of the UAV in meters
Attitude of the UAV i.e. roll, pitch, and yaw in degrees
Field of View (FOV) of the camera in degrees
Elevation of the camera w.r.t UAV in degrees
Azimuth of camera w.r.t UAV in degrees
I have some some images taken from that camera during a flight and my task is to compute the locations (in Lat/Long) of 4 corners points and the center points of the image so that the image can be placed on the map at proper location.
I found a document while searching the internet that can be downloaded at the following link:
http://www.siaa.asn.au/get/2411853249.pdf
My maths background is very weak so I am not able to translate the document into a working solution.
Can somebody provide me a solution to my problem in the form of a simple algorithm or preferable in the form of code of some programming language?
Thanks.
As I see, it does not related to image-processing, because you need to determine coordinates of center of image (you even do not need FOV). You have to find intersection of camera principal ray and earth surface (if I've understood your task well). This is nothing more then basic matrix math.
See wiki:Transformation.

Resources