[136] | 1 | #ifndef LIB3DV_POSE_UTILS_H
|
---|
| 2 | #define LIB3DV_POSE_UTILS_H
|
---|
| 3 |
|
---|
| 4 | /* pose_utils.h
|
---|
| 5 | *
|
---|
| 6 | * Copyright (C) 2013 VisLab
|
---|
| 7 | *
|
---|
| 8 | * This file is part of lib3dv; you can redistribute it and/or modify
|
---|
| 9 | * it under the terms of the GNU Lesser General Public License as published by
|
---|
| 10 | * the Free Software Foundation; either version 3 of the License, or (at
|
---|
| 11 | * your option) any later version.
|
---|
| 12 | *
|
---|
| 13 | * This program is distributed in the hope that it will be useful, but
|
---|
| 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
| 16 | * General Public License for more details.
|
---|
| 17 | *
|
---|
| 18 | * You should have received a copy of the GNU Lesser General Public License
|
---|
| 19 | * along with this program; if not, see <http://www.gnu.org/licenses/>.
|
---|
| 20 | */
|
---|
| 21 |
|
---|
| 22 | #include <lib3dv/calibration.h>
|
---|
| 23 | #include <lib3dv/pose.h>
|
---|
| 24 |
|
---|
| 25 | #include <lib3dv/3dv_export.h>
|
---|
| 26 |
|
---|
| 27 | #include <boost/shared_ptr.hpp>
|
---|
| 28 |
|
---|
| 29 | namespace lib3dv
|
---|
| 30 | {
|
---|
| 31 | class pose;
|
---|
| 32 |
|
---|
| 33 | /**
|
---|
| 34 | * @brief Inverse perspective mapping
|
---|
| 35 | *
|
---|
| 36 | * This class turns raw depth measurements into 3D points. Both sensor and world coordinate systems are supported.
|
---|
| 37 | *
|
---|
| 38 | * @note Intrinsic camera params must match the DSI resolution, so if the calibration information refers to the full-resolution image and a 2x downsampling has been applied to the depth map,
|
---|
| 39 | * all the fields of calibration::camera_intrinsics will have to be divided by 2 before invoking the constructor.
|
---|
| 40 | **/
|
---|
| 41 | class LIB3DV_EXPORT pose_utils
|
---|
| 42 | {
|
---|
| 43 | public :
|
---|
| 44 |
|
---|
| 45 | /**
|
---|
| 46 | * @brief Setup the conversion from a a pose matrix to orientation data in world coordinates [yaw, pitch, roll].
|
---|
| 47 | *
|
---|
| 48 | * @param [in] position Right camera position.
|
---|
| 49 | * @param [in] orientation Right camera orientation.
|
---|
| 50 | **/
|
---|
| 51 | pose_utils(const calibration::position& position, const calibration::orientation& orientation);
|
---|
| 52 |
|
---|
| 53 | /**
|
---|
| 54 | * @brief Convert a pose matrix to orientation data in world coordinates [yaw, pitch, roll].
|
---|
| 55 | *
|
---|
| 56 | * @param [in] pose Pose data. Must be a lib3dv::pose.
|
---|
| 57 | * @param [out] double yaw.
|
---|
| 58 | * @param [out] double pitch.
|
---|
| 59 | * @param [out] double roll.
|
---|
| 60 | **/
|
---|
| 61 | void extract_orientation(const lib3dv::pose& pose, float &yaw, float & pitch, float & roll);
|
---|
| 62 |
|
---|
| 63 | private :
|
---|
| 64 |
|
---|
| 65 | calibration::position m_position;
|
---|
| 66 | calibration::orientation m_orientation;
|
---|
| 67 | };
|
---|
| 68 | }
|
---|
| 69 |
|
---|
| 70 | #endif
|
---|