NASA Astrobee Robot Software  0.19.1
Flight software for the Astrobee robots operating inside the International Space Station.
identity_distorter.h
Go to the documentation of this file.
1 /* Copyright (c) 2017, United States Government, as represented by the
2  * Administrator of the National Aeronautics and Space Administration.
3  *
4  * All rights reserved.
5  *
6  * The Astrobee platform is licensed under the Apache License, Version 2.0
7  * (the "License"); you may not use this file except in compliance with the
8  * License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15  * License for the specific language governing permissions and limitations
16  * under the License.
17  */
18 #ifndef VISION_COMMON_IDENTITY_DISTORTER_H_
19 #define VISION_COMMON_IDENTITY_DISTORTER_H_
20 
22 
23 namespace vision_common {
24 // TODO(rsoussan): This actually takes 0 params but ceres needs at least 1 to form
25 // valid parameter blocks. Change to 0 when this is avoided.
26 class IdentityDistorter : public Distorter<1, IdentityDistorter> {
27  public:
30 
31  template <typename T>
32  Eigen::Matrix<T, 2, 1> Distort(const T* distortion, const Eigen::Matrix<T, 3, 3>& intrinsics,
33  const Eigen::Matrix<T, 2, 1>& undistorted_point) const {
34  return undistorted_point;
35  }
36 
37  cv::Mat Undistort(const cv::Mat& distorted_image, const Eigen::Matrix3d& intrinsics,
38  const Eigen::VectorXd& distortion) const final {
39  return distorted_image;
40  }
41 
42  Eigen::Vector2d Undistort(const Eigen::Vector2d& distorted_point, const Eigen::Matrix3d& intrinsics,
43  const Eigen::VectorXd& distortion) const final {
44  return distorted_point;
45  }
46 };
47 } // namespace vision_common
48 
49 #endif // VISION_COMMON_IDENTITY_DISTORTER_H_
vision_common
Definition: brisk_feature_detector_and_matcher.h:25
vision_common::IdentityDistorter::Undistort
cv::Mat Undistort(const cv::Mat &distorted_image, const Eigen::Matrix3d &intrinsics, const Eigen::VectorXd &distortion) const final
Definition: identity_distorter.h:37
vision_common::Distorter
Definition: distorter.h:29
vision_common::IdentityDistorter::Distort
Eigen::Matrix< T, 2, 1 > Distort(const T *distortion, const Eigen::Matrix< T, 3, 3 > &intrinsics, const Eigen::Matrix< T, 2, 1 > &undistorted_point) const
Definition: identity_distorter.h:32
vision_common::IdentityDistorter::Undistort
Eigen::Vector2d Undistort(const Eigen::Vector2d &distorted_point, const Eigen::Matrix3d &intrinsics, const Eigen::VectorXd &distortion) const final
Definition: identity_distorter.h:42
distorter.h
vision_common::IdentityDistorter
Definition: identity_distorter.h:26