Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
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
Commits
887a9502
Commit
887a9502
authored
Aug 22, 2014
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3116 from shubhra:master
parents
0eb1c7ed
7b2a1d15
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
9 deletions
+27
-9
camera_calibration_and_3d_reconstruction.rst
.../calib3d/doc/camera_calibration_and_3d_reconstruction.rst
+6
-2
calib3d.hpp
modules/calib3d/include/opencv2/calib3d.hpp
+2
-1
calib3d_c.h
modules/calib3d/include/opencv2/calib3d/calib3d_c.h
+3
-1
compat_ptsetreg.cpp
modules/calib3d/src/compat_ptsetreg.cpp
+14
-2
fundam.cpp
modules/calib3d/src/fundam.cpp
+2
-3
No files found.
modules/calib3d/doc/camera_calibration_and_3d_reconstruction.rst
View file @
887a9502
...
...
@@ -843,11 +843,11 @@ findHomography
------------------
Finds a perspective transformation between two planes.
.. ocv:function:: Mat findHomography( InputArray srcPoints, InputArray dstPoints, int method=0, double ransacReprojThreshold=3, OutputArray mask=noArray()
)
.. ocv:function:: Mat findHomography( InputArray srcPoints, InputArray dstPoints, int method=0, double ransacReprojThreshold=3, OutputArray mask=noArray()
, const int maxIters = 2000, const double confidence = 0.995
)
.. ocv:pyfunction:: cv2.findHomography(srcPoints, dstPoints[, method[, ransacReprojThreshold[, mask]]]) -> retval, mask
.. ocv:cfunction:: int cvFindHomography( const CvMat* src_points, const CvMat* dst_points, CvMat* homography, int method=0, double ransacReprojThreshold=3, CvMat* mask=0
)
.. ocv:cfunction:: int cvFindHomography( const CvMat* src_points, const CvMat* dst_points, CvMat* homography, int method=0, double ransacReprojThreshold=3, CvMat* mask=0
, int maxIters = 2000, double confidence = 0.995
)
:param srcPoints: Coordinates of the points in the original plane, a matrix of the type ``CV_32FC2`` or ``vector<Point2f>`` .
...
...
@@ -871,6 +871,10 @@ Finds a perspective transformation between two planes.
:param mask: Optional output mask set by a robust method ( ``RANSAC`` or ``LMEDS`` ). Note that the input mask values are ignored.
:param maxIters: The maximum number of RANSAC iterations, 2000 is the maximum it can be.
:param confidence: Confidence level, between 0 and 1.
The functions find and return the perspective transformation :math:`H` between the source and the destination planes:
.. math::
...
...
modules/calib3d/include/opencv2/calib3d.hpp
View file @
887a9502
...
...
@@ -109,7 +109,8 @@ CV_EXPORTS_W void Rodrigues( InputArray src, OutputArray dst, OutputArray jacobi
//! computes the best-fit perspective transformation mapping srcPoints to dstPoints.
CV_EXPORTS_W
Mat
findHomography
(
InputArray
srcPoints
,
InputArray
dstPoints
,
int
method
=
0
,
double
ransacReprojThreshold
=
3
,
OutputArray
mask
=
noArray
());
OutputArray
mask
=
noArray
(),
const
int
maxIters
=
2000
,
const
double
confidence
=
0.995
);
//! variant of findHomography for backward compatibility
CV_EXPORTS
Mat
findHomography
(
InputArray
srcPoints
,
InputArray
dstPoints
,
...
...
modules/calib3d/include/opencv2/calib3d/calib3d_c.h
View file @
887a9502
...
...
@@ -141,7 +141,9 @@ CVAPI(int) cvFindHomography( const CvMat* src_points,
CvMat
*
homography
,
int
method
CV_DEFAULT
(
0
),
double
ransacReprojThreshold
CV_DEFAULT
(
3
),
CvMat
*
mask
CV_DEFAULT
(
0
));
CvMat
*
mask
CV_DEFAULT
(
0
),
int
maxIters
CV_DEFAULT
(
2000
),
double
confidence
CV_DEFAULT
(
0
.
995
));
/* Computes RQ decomposition for 3x3 matrices */
CVAPI
(
void
)
cvRQDecomp3x3
(
const
CvMat
*
matrixM
,
CvMat
*
matrixR
,
CvMat
*
matrixQ
,
...
...
modules/calib3d/src/compat_ptsetreg.cpp
View file @
887a9502
...
...
@@ -299,7 +299,8 @@ CV_IMPL int cvRANSACUpdateNumIters( double p, double ep, int modelPoints, int ma
CV_IMPL
int
cvFindHomography
(
const
CvMat
*
_src
,
const
CvMat
*
_dst
,
CvMat
*
__H
,
int
method
,
double
ransacReprojThreshold
,
CvMat
*
_mask
)
double
ransacReprojThreshold
,
CvMat
*
_mask
,
int
maxIters
,
double
confidence
)
{
cv
::
Mat
src
=
cv
::
cvarrToMat
(
_src
),
dst
=
cv
::
cvarrToMat
(
_dst
);
...
...
@@ -308,9 +309,20 @@ CV_IMPL int cvFindHomography( const CvMat* _src, const CvMat* _dst, CvMat* __H,
if
(
dst
.
channels
()
==
1
&&
(
dst
.
rows
==
2
||
dst
.
rows
==
3
)
&&
dst
.
cols
>
3
)
cv
::
transpose
(
dst
,
dst
);
if
(
maxIters
<
0
)
maxIters
=
0
;
if
(
maxIters
>
2000
)
maxIters
=
2000
;
if
(
confidence
<
0
)
confidence
=
0
;
if
(
confidence
>
1
)
confidence
=
1
;
const
cv
::
Mat
H
=
cv
::
cvarrToMat
(
__H
),
mask
=
cv
::
cvarrToMat
(
_mask
);
cv
::
Mat
H0
=
cv
::
findHomography
(
src
,
dst
,
method
,
ransacReprojThreshold
,
_mask
?
cv
::
_OutputArray
(
mask
)
:
cv
::
_OutputArray
());
_mask
?
cv
::
_OutputArray
(
mask
)
:
cv
::
_OutputArray
(),
maxIters
,
confidence
);
if
(
H0
.
empty
()
)
{
...
...
modules/calib3d/src/fundam.cpp
View file @
887a9502
...
...
@@ -274,10 +274,9 @@ public:
cv
::
Mat
cv
::
findHomography
(
InputArray
_points1
,
InputArray
_points2
,
int
method
,
double
ransacReprojThreshold
,
OutputArray
_mask
)
int
method
,
double
ransacReprojThreshold
,
OutputArray
_mask
,
const
int
maxIters
,
const
double
confidence
)
{
const
double
confidence
=
0.995
;
const
int
maxIters
=
2000
;
const
double
defaultRANSACReprojThreshold
=
3
;
bool
result
=
false
;
...
...
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