mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 23:33:05 +04:00
Merge branch 4.x
This commit is contained in:
@@ -593,4 +593,15 @@ void cv::fisheye::undistortImage(InputArray distorted, OutputArray undistorted,
|
||||
cv::remap(distorted, undistorted, map1, map2, INTER_LINEAR, BORDER_CONSTANT);
|
||||
}
|
||||
|
||||
bool cv::fisheye::solvePnP( InputArray opoints, InputArray ipoints,
|
||||
InputArray cameraMatrix, InputArray distCoeffs,
|
||||
OutputArray rvec, OutputArray tvec, bool useExtrinsicGuess,
|
||||
int flags, TermCriteria criteria)
|
||||
{
|
||||
|
||||
Mat imagePointsNormalized;
|
||||
cv::fisheye::undistortPoints(ipoints, imagePointsNormalized, cameraMatrix, distCoeffs, noArray(), cameraMatrix, criteria);
|
||||
return cv::solvePnP(opoints, imagePointsNormalized, cameraMatrix, noArray(), rvec, tvec, useExtrinsicGuess, flags);
|
||||
}
|
||||
|
||||
} // namespace cv
|
||||
|
||||
@@ -169,6 +169,9 @@ public:
|
||||
int getRealRoots (const std::vector<double> &coeffs, std::vector<double> &real_roots) override {
|
||||
if (coeffs.empty())
|
||||
return 0;
|
||||
for (auto c : coeffs)
|
||||
if (cvIsNaN(c) || cvIsInf(c))
|
||||
return 0;
|
||||
Poly input(coeffs);
|
||||
if (input.degree() < 1)
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user