mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 15:53:03 +04:00
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
This commit is contained in:
@@ -2692,7 +2692,7 @@ CV_EXPORTS_W int recoverPose( InputArray points1, InputArray points2,
|
||||
InputOutputArray mask = noArray());
|
||||
|
||||
/** @brief Recovers the relative camera rotation and the translation from an estimated essential
|
||||
matrix and the corresponding points in two images, using cheirality check. Returns the number of
|
||||
matrix and the corresponding points in two images, using chirality check. Returns the number of
|
||||
inliers that pass the check.
|
||||
|
||||
@param E The input essential matrix.
|
||||
@@ -2710,11 +2710,11 @@ described below.
|
||||
therefore is only known up to scale, i.e. t is the direction of the translation vector and has unit
|
||||
length.
|
||||
@param mask Input/output mask for inliers in points1 and points2. If it is not empty, then it marks
|
||||
inliers in points1 and points2 for then given essential matrix E. Only these inliers will be used to
|
||||
recover pose. In the output mask only inliers which pass the cheirality check.
|
||||
inliers in points1 and points2 for the given essential matrix E. Only these inliers will be used to
|
||||
recover pose. In the output mask only inliers which pass the chirality check.
|
||||
|
||||
This function decomposes an essential matrix using @ref decomposeEssentialMat and then verifies
|
||||
possible pose hypotheses by doing cheirality check. The cheirality check means that the
|
||||
possible pose hypotheses by doing chirality check. The chirality check means that the
|
||||
triangulated 3D points should have positive depth. Some details can be found in @cite Nister03.
|
||||
|
||||
This function can be used to process the output E and mask from @ref findEssentialMat. In this
|
||||
@@ -2761,8 +2761,8 @@ length.
|
||||
are feature points from cameras with same focal length and principal point.
|
||||
@param pp principal point of the camera.
|
||||
@param mask Input/output mask for inliers in points1 and points2. If it is not empty, then it marks
|
||||
inliers in points1 and points2 for then given essential matrix E. Only these inliers will be used to
|
||||
recover pose. In the output mask only inliers which pass the cheirality check.
|
||||
inliers in points1 and points2 for the given essential matrix E. Only these inliers will be used to
|
||||
recover pose. In the output mask only inliers which pass the chirality check.
|
||||
|
||||
This function differs from the one above that it computes camera intrinsic matrix from focal length and
|
||||
principal point:
|
||||
@@ -2797,12 +2797,12 @@ length.
|
||||
@param distanceThresh threshold distance which is used to filter out far away points (i.e. infinite
|
||||
points).
|
||||
@param mask Input/output mask for inliers in points1 and points2. If it is not empty, then it marks
|
||||
inliers in points1 and points2 for then given essential matrix E. Only these inliers will be used to
|
||||
recover pose. In the output mask only inliers which pass the cheirality check.
|
||||
inliers in points1 and points2 for the given essential matrix E. Only these inliers will be used to
|
||||
recover pose. In the output mask only inliers which pass the chirality check.
|
||||
@param triangulatedPoints 3D points which were reconstructed by triangulation.
|
||||
|
||||
This function differs from the one above that it outputs the triangulated 3D point that are used for
|
||||
the cheirality check.
|
||||
the chirality check.
|
||||
*/
|
||||
CV_EXPORTS_W int recoverPose( InputArray E, InputArray points1, InputArray points2,
|
||||
InputArray cameraMatrix, OutputArray R, OutputArray t, double distanceThresh, InputOutputArray mask = noArray(),
|
||||
|
||||
@@ -1232,7 +1232,7 @@ int ChessBoardDetector::cleanFoundConnectedQuads(std::vector<ChessBoardQuad*>& q
|
||||
centers[i] = ci;
|
||||
center += ci;
|
||||
}
|
||||
center.x *= (1.0f / quad_count);
|
||||
center *= (1.0f / quad_count);
|
||||
|
||||
// If we still have more quadrangles than we should,
|
||||
// we try to eliminate bad ones based on minimizing the bounding box.
|
||||
@@ -1256,7 +1256,7 @@ int ChessBoardDetector::cleanFoundConnectedQuads(std::vector<ChessBoardQuad*>& q
|
||||
Mat points(1, quad_count, CV_32FC2, ¢ers[0]);
|
||||
cv::convexHull(points, hull, true);
|
||||
centers[skip] = temp;
|
||||
double hull_area = contourArea(hull, true);
|
||||
double hull_area = contourArea(hull, false);
|
||||
|
||||
// remember smallest box area
|
||||
if (hull_area < min_box_area)
|
||||
@@ -1298,6 +1298,7 @@ int ChessBoardDetector::cleanFoundConnectedQuads(std::vector<ChessBoardQuad*>& q
|
||||
quad_group[min_box_area_index] = quad_group[quad_count];
|
||||
centers[min_box_area_index] = centers[quad_count];
|
||||
}
|
||||
quad_group.resize(quad_count);
|
||||
|
||||
return quad_count;
|
||||
}
|
||||
|
||||
@@ -601,7 +601,7 @@ int cv::recoverPose( InputArray E, InputArray _points1, InputArray _points2,
|
||||
P3(Range::all(), Range(0, 3)) = R1 * 1.0; P3.col(3) = -t * 1.0;
|
||||
P4(Range::all(), Range(0, 3)) = R2 * 1.0; P4.col(3) = -t * 1.0;
|
||||
|
||||
// Do the cheirality check.
|
||||
// Do the chirality check.
|
||||
// Notice here a threshold dist is used to filter
|
||||
// out far away points (i.e. infinite points) since
|
||||
// their depth may vary between positive and negative.
|
||||
|
||||
Reference in New Issue
Block a user