Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv_contrib
Commits
e5b99bd9
Commit
e5b99bd9
authored
Mar 22, 2020
by
akashsharma02
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor fix for solvePnPRansac params mismatch #2064
Use checkVector over "2-point trick" Fix warnings on MSVC compiler
parent
4d57438c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
ccalib.cpp
modules/ccalib/src/ccalib.cpp
+11
-2
No files found.
modules/ccalib/src/ccalib.cpp
View file @
e5b99bd9
...
...
@@ -445,8 +445,13 @@ bool CustomPattern::findRtRANSAC(InputArray objectPoints, InputArray imagePoints
OutputArray
rvec
,
OutputArray
tvec
,
bool
useExtrinsicGuess
,
int
iterationsCount
,
float
reprojectionError
,
int
minInliersCount
,
OutputArray
inliers
,
int
flags
)
{
int
npoints
=
imagePoints
.
getMat
().
checkVector
(
2
);
CV_Assert
(
npoints
>
0
);
double
confidence_factor
=
(
double
)
minInliersCount
/
(
double
)
npoints
;
double
confidence
=
confidence_factor
<
0.001
?
0.001
:
confidence_factor
>
0.999
?
0.999
:
confidence_factor
;
solvePnPRansac
(
objectPoints
,
imagePoints
,
cameraMatrix
,
distCoeffs
,
rvec
,
tvec
,
useExtrinsicGuess
,
iterationsCount
,
reprojectionError
,
minInliersCount
,
inliers
,
flags
);
iterationsCount
,
reprojectionError
,
confidence
,
inliers
,
flags
);
return
true
;
// for consistency with the other methods
}
...
...
@@ -459,8 +464,12 @@ bool CustomPattern::findRtRANSAC(InputArray image, InputArray cameraMatrix, Inpu
if
(
!
findPattern
(
image
,
imagePoints
,
objectPoints
))
return
false
;
double
confidence_factor
=
(
double
)
minInliersCount
/
(
double
)
imagePoints
.
size
();
double
confidence
=
confidence_factor
<
0.001
?
0.001
:
confidence_factor
>
0.999
?
0.999
:
confidence_factor
;
solvePnPRansac
(
objectPoints
,
imagePoints
,
cameraMatrix
,
distCoeffs
,
rvec
,
tvec
,
useExtrinsicGuess
,
iterationsCount
,
reprojectionError
,
minInliersCount
,
inliers
,
flags
);
iterationsCount
,
reprojectionError
,
confidence
,
inliers
,
flags
);
return
true
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment