camera_homography.h 2.1 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/******************************************************************************
 * Copyright 2018 The Apollo Authors. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *****************************************************************************/
K
kechxu 已提交
16 17
#ifndef MODULES_PERCEPTION_COMMON_GEOMETRY_CAMERA_HOMOGRAPHY_H_
#define MODULES_PERCEPTION_COMMON_GEOMETRY_CAMERA_HOMOGRAPHY_H_
18

K
kechxu 已提交
19 20
#include "Eigen/Core"
#include "Eigen/Geometry"
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
#include "modules/perception/base/camera.h"

namespace apollo {
namespace perception {
namespace common {

// @brief: find the corresponding 2D point in camera2, given 2D point in
// camera1. assume the two cameras have the same optical center.
// notice camera1_intrinsic_inverse is inverse version
bool PointCamera1ToCamera2(const Eigen::Vector2d& point,
                           const Eigen::Matrix3d& camera1_intrinsic_inverse,
                           const Eigen::Matrix3d& camera2_intrinsic,
                           const Eigen::Matrix3d& trans_camera1_to_camera2,
                           Eigen::Vector2d* point_out);

// @brief: estimate whether two cameras have field overlap.
bool IsCamerasFieldOverlap(const base::PinholeCameraModel& from_camera,
                           const base::PinholeCameraModel& to_camera,
                           const Eigen::Matrix4d& extrinsic,
                           Eigen::Vector2d* up_left,
                           Eigen::Vector2d* low_right);

}  // namespace common
}  // namespace perception
}  // namespace apollo

K
kechxu 已提交
47
#endif  // MODULES_PERCEPTION_COMMON_GEOMETRY_CAMERA_HOMOGRAPHY_H_