本文整理汇总了C++中CameraParameters::principalPoint方法的典型用法代码示例。如果您正苦于以下问题:C++ CameraParameters::principalPoint方法的具体用法?C++ CameraParameters::principalPoint怎么用?C++ CameraParameters::principalPoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CameraParameters
的用法示例。
在下文中一共展示了CameraParameters::principalPoint方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
StereoFrame::StereoFrame(
const size_t id,
const CameraPose& cameraPose, const CameraParameters& calibrationLeft,
const double stereo_baseline, const CameraParameters& calibrationRight,
const ImageFeatures& imageFeaturesLeft, const ImageFeatures& imageFeaturesRight,
bool bFixed
)
: frameLeft_(Camera(cameraPose, calibrationLeft), imageFeaturesLeft)
, frameRight_(Camera(ComputeRightCameraPose(cameraPose, stereo_baseline), calibrationRight), imageFeaturesRight)
, rectified_camera_parameters_({stereo_baseline, calibrationLeft.focalLengths(), calibrationLeft.principalPoint()})
, bFixed_( bFixed ), id_( id )
{}
示例2: cvToVector
/// Perform the undistortion of LED measurements.
inline std::vector<LedMeasurement>
undistortLeds(std::vector<LedMeasurement> const &distortedMeasurements,
CameraParameters const &camParams) {
std::vector<LedMeasurement> ret;
ret.resize(distortedMeasurements.size());
auto distortionModel = CameraDistortionModel{
Eigen::Vector2d{camParams.focalLengthX(), camParams.focalLengthY()},
cvToVector(camParams.principalPoint()),
Eigen::Vector3d{camParams.k1(), camParams.k2(), camParams.k3()}};
auto ledUndistort = [&distortionModel](LedMeasurement const &meas) {
LedMeasurement ret{meas};
Eigen::Vector2d undistorted = distortionModel.undistortPoint(
cvToVector(meas.loc).cast<double>());
ret.loc = vecToPoint(undistorted.cast<float>());
return ret;
};
std::transform(begin(distortedMeasurements), end(distortedMeasurements),
begin(ret), ledUndistort);
return ret;
}