How to find the angle of the camera by given four coordinates?
The camera can be in positions with rotation of 0°, 45°, 90°, 135°, 180°, 225°, 270°, 315°.
The known values are the coordinates (that I get from deprojection) points of (x1,y1) (x2,y2) (x3,y3) (x4,y4)
So the camera is at the point (0,0)
How can I find in which of the above angles the camera is?
So an example:
How to find that the camera is at the position with angle 0°???
if someone explain I will be grateful :)
I need a C++ algorithm, to solve this for me. :)
A function that takes four points and return the angle.
-
Hi Zisoglou If you have a D435i camera with an IMU component then you can get the rotation of the camera using a C++ example program called rs-motion
https://github.com/IntelRealSense/librealsense/tree/master/examples/motion
The documentation states that "The angles in the z and x axis are computed from acclerometer data, using trigonometric calculations. Note that motion around Y axis cannot be estimated using accelerometer".
void process_accel(rs2_vector accel_data)
{
// Holds the angle as calculated from accelerometer data
float3 accel_angle;
// Calculate rotation angle from accelerometer data
accel_angle.z = atan2(accel_data.y, accel_data.z);
accel_angle.x = atan2(accel_data.x, sqrt(accel_data.y * accel_data.y + accel_data.z * accel_data.z));If you need to calculate device pose on a 400 Series camera model without an IMU, a RealSense team member states that the Depth Quality Tool works out the angle without an IMU by using a plane fit.
Please sign in to leave a comment.
Comments
1 comment