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
b8f08cca
Commit
b8f08cca
authored
Aug 22, 2016
by
Vladislav Sovrasov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add calibration error estimation into Aruco module
parent
3468ae57
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
81 additions
and
13 deletions
+81
-13
aruco.hpp
modules/aruco/include/opencv2/aruco.hpp
+22
-4
charuco.hpp
modules/aruco/include/opencv2/aruco/charuco.hpp
+20
-3
aruco.cpp
modules/aruco/src/aruco.cpp
+20
-3
charuco.cpp
modules/aruco/src/charuco.cpp
+19
-3
No files found.
modules/aruco/include/opencv2/aruco.hpp
View file @
b8f08cca
...
...
@@ -474,7 +474,7 @@ void _drawPlanarBoardImpl(Board *board, Size outSize, OutputArray img,
* @brief Calibrate a camera using aruco markers
*
* @param corners vector of detected marker corners in all frames.
* The corners should have the same format returned by detectMarkers (
@sa
detectMarkers).
* The corners should have the same format returned by detectMarkers (
see #
detectMarkers).
* @param ids list of identifiers for each marker in corners
* @param counter number of markers in each frame so that corners and ids can be split
* @param board Marker Board layout
...
...
@@ -491,20 +491,38 @@ void _drawPlanarBoardImpl(Board *board, Size outSize, OutputArray img,
* from the model coordinate space (in which object points are specified) to the world coordinate
* space, that is, a real position of the board pattern in the k-th pattern view (k=0.. *M* -1).
* @param tvecs Output vector of translation vectors estimated for each pattern view.
* @param flags flags Different flags for the calibration process (@sa calibrateCamera)
* @param stdDeviationsIntrinsics Output vector of standard deviations estimated for intrinsic parameters.
* Order of deviations values:
* \f$(f_x, f_y, c_x, c_y, k_1, k_2, p_1, p_2, k_3, k_4, k_5, k_6 , s_1, s_2, s_3,
* s_4, \tau_x, \tau_y)\f$ If one of parameters is not estimated, it's deviation is equals to zero.
* @param stdDeviationsExtrinsics Output vector of standard deviations estimated for extrinsic parameters.
* Order of deviations values: \f$(R_1, T_1, \dotsc , R_M, T_M)\f$ where M is number of pattern views,
* \f$R_i, T_i\f$ are concatenated 1x3 vectors.
* @param perViewErrors Output vector of average re-projection errors estimated for each pattern view.
* @param flags flags Different flags for the calibration process (see #calibrateCamera for details).
* @param criteria Termination criteria for the iterative optimization algorithm.
*
* This function calibrates a camera using an Aruco Board. The function receives a list of
* detected markers from several views of the Board. The process is similar to the chessboard
* calibration in calibrateCamera(). The function returns the final re-projection error.
*/
CV_EXPORTS_
W
double
calibrateCameraAruco
(
CV_EXPORTS_
AS
(
calibrateCameraArucoExtended
)
double
calibrateCameraAruco
(
InputArrayOfArrays
corners
,
InputArray
ids
,
InputArray
counter
,
Ptr
<
Board
>
&
board
,
Size
imageSize
,
InputOutputArray
cameraMatrix
,
InputOutputArray
distCoeffs
,
OutputArrayOfArrays
rvecs
=
noArray
(),
OutputArrayOfArrays
tvecs
=
noArray
(),
int
flags
=
0
,
OutputArrayOfArrays
rvecs
,
OutputArrayOfArrays
tvecs
,
OutputArray
stdDeviationsIntrinsics
=
noArray
(),
OutputArray
stdDeviationsExtrinsics
=
noArray
(),
OutputArray
perViewErrors
=
noArray
(),
int
flags
=
0
,
TermCriteria
criteria
=
TermCriteria
(
TermCriteria
::
COUNT
+
TermCriteria
::
EPS
,
30
,
DBL_EPSILON
));
/** @brief It's the same function as #calibrateCameraAruco but without calibration error estimation.
*/
CV_EXPORTS_W
double
calibrateCameraAruco
(
InputArrayOfArrays
corners
,
InputArray
ids
,
InputArray
counter
,
Ptr
<
Board
>
&
board
,
Size
imageSize
,
InputOutputArray
cameraMatrix
,
InputOutputArray
distCoeffs
,
OutputArrayOfArrays
rvecs
=
noArray
(),
OutputArrayOfArrays
tvecs
=
noArray
(),
int
flags
=
0
,
TermCriteria
criteria
=
TermCriteria
(
TermCriteria
::
COUNT
+
TermCriteria
::
EPS
,
30
,
DBL_EPSILON
));
//! @}
}
...
...
modules/aruco/include/opencv2/aruco/charuco.hpp
View file @
b8f08cca
...
...
@@ -223,19 +223,36 @@ CV_EXPORTS_W void drawDetectedCornersCharuco(InputOutputArray image, InputArray
* from the model coordinate space (in which object points are specified) to the world coordinate
* space, that is, a real position of the board pattern in the k-th pattern view (k=0.. *M* -1).
* @param tvecs Output vector of translation vectors estimated for each pattern view.
* @param flags flags Different flags for the calibration process (@sa calibrateCamera)
* @param stdDeviationsIntrinsics Output vector of standard deviations estimated for intrinsic parameters.
* Order of deviations values:
* \f$(f_x, f_y, c_x, c_y, k_1, k_2, p_1, p_2, k_3, k_4, k_5, k_6 , s_1, s_2, s_3,
* s_4, \tau_x, \tau_y)\f$ If one of parameters is not estimated, it's deviation is equals to zero.
* @param stdDeviationsExtrinsics Output vector of standard deviations estimated for extrinsic parameters.
* Order of deviations values: \f$(R_1, T_1, \dotsc , R_M, T_M)\f$ where M is number of pattern views,
* \f$R_i, T_i\f$ are concatenated 1x3 vectors.
* @param perViewErrors Output vector of average re-projection errors estimated for each pattern view.
* @param flags flags Different flags for the calibration process (see #calibrateCamera for details).
* @param criteria Termination criteria for the iterative optimization algorithm.
*
* This function calibrates a camera using a set of corners of a Charuco Board. The function
* receives a list of detected corners and its identifiers from several views of the Board.
* The function returns the final re-projection error.
*/
CV_EXPORTS_
W
double
calibrateCameraCharuco
(
CV_EXPORTS_
AS
(
calibrateCameraCharucoExtended
)
double
calibrateCameraCharuco
(
InputArrayOfArrays
charucoCorners
,
InputArrayOfArrays
charucoIds
,
Ptr
<
CharucoBoard
>
&
board
,
Size
imageSize
,
InputOutputArray
cameraMatrix
,
InputOutputArray
distCoeffs
,
OutputArrayOfArrays
rvecs
=
noArray
(),
OutputArrayOfArrays
tvecs
=
noArray
(),
int
flags
=
0
,
OutputArrayOfArrays
rvecs
=
noArray
(),
OutputArrayOfArrays
tvecs
=
noArray
(),
OutputArray
stdDeviationsIntrinsics
=
noArray
(),
OutputArray
stdDeviationsExtrinsics
=
noArray
(),
OutputArray
perViewErrors
=
noArray
(),
int
flags
=
0
,
TermCriteria
criteria
=
TermCriteria
(
TermCriteria
::
COUNT
+
TermCriteria
::
EPS
,
30
,
DBL_EPSILON
));
/** @brief It's the same function as #calibrateCameraCharuco but without calibration error estimation.
*/
CV_EXPORTS_W
double
calibrateCameraCharuco
(
InputArrayOfArrays
charucoCorners
,
InputArrayOfArrays
charucoIds
,
Ptr
<
CharucoBoard
>
&
board
,
Size
imageSize
,
InputOutputArray
cameraMatrix
,
InputOutputArray
distCoeffs
,
OutputArrayOfArrays
rvecs
=
noArray
(),
OutputArrayOfArrays
tvecs
=
noArray
(),
int
flags
=
0
,
TermCriteria
criteria
=
TermCriteria
(
TermCriteria
::
COUNT
+
TermCriteria
::
EPS
,
30
,
DBL_EPSILON
));
...
...
modules/aruco/src/aruco.cpp
View file @
b8f08cca
...
...
@@ -1560,11 +1560,15 @@ void drawPlanarBoard(Ptr<Board> &_board, Size outSize, OutputArray _img, int mar
/**
*/
*/
double
calibrateCameraAruco
(
InputArrayOfArrays
_corners
,
InputArray
_ids
,
InputArray
_counter
,
Ptr
<
Board
>
&
board
,
Size
imageSize
,
InputOutputArray
_cameraMatrix
,
InputOutputArray
_distCoeffs
,
OutputArrayOfArrays
_rvecs
,
OutputArrayOfArrays
_tvecs
,
int
flags
,
TermCriteria
criteria
)
{
OutputArrayOfArrays
_tvecs
,
OutputArray
_stdDeviationsIntrinsics
,
OutputArray
_stdDeviationsExtrinsics
,
OutputArray
_perViewErrors
,
int
flags
,
TermCriteria
criteria
)
{
// for each frame, get properly processed imagePoints and objectPoints for the calibrateCamera
// function
...
...
@@ -1595,7 +1599,20 @@ double calibrateCameraAruco(InputArrayOfArrays _corners, InputArray _ids, InputA
}
return
calibrateCamera
(
processedObjectPoints
,
processedImagePoints
,
imageSize
,
_cameraMatrix
,
_distCoeffs
,
_rvecs
,
_tvecs
,
flags
,
criteria
);
_distCoeffs
,
_rvecs
,
_tvecs
,
_stdDeviationsIntrinsics
,
_stdDeviationsExtrinsics
,
_perViewErrors
,
flags
,
criteria
);
}
/**
*/
double
calibrateCameraAruco
(
InputArrayOfArrays
_corners
,
InputArray
_ids
,
InputArray
_counter
,
Ptr
<
Board
>
&
board
,
Size
imageSize
,
InputOutputArray
_cameraMatrix
,
InputOutputArray
_distCoeffs
,
OutputArrayOfArrays
_rvecs
,
OutputArrayOfArrays
_tvecs
,
int
flags
,
TermCriteria
criteria
)
{
return
calibrateCameraAruco
(
_corners
,
_ids
,
_counter
,
board
,
imageSize
,
_cameraMatrix
,
_distCoeffs
,
_rvecs
,
_tvecs
,
noArray
(),
noArray
(),
noArray
(),
flags
,
criteria
);
}
...
...
modules/aruco/src/charuco.cpp
View file @
b8f08cca
...
...
@@ -713,8 +713,11 @@ bool estimatePoseCharucoBoard(InputArray _charucoCorners, InputArray _charucoIds
double
calibrateCameraCharuco
(
InputArrayOfArrays
_charucoCorners
,
InputArrayOfArrays
_charucoIds
,
Ptr
<
CharucoBoard
>
&
_board
,
Size
imageSize
,
InputOutputArray
_cameraMatrix
,
InputOutputArray
_distCoeffs
,
OutputArrayOfArrays
_rvecs
,
OutputArrayOfArrays
_tvecs
,
int
flags
,
TermCriteria
criteria
)
{
OutputArrayOfArrays
_rvecs
,
OutputArrayOfArrays
_tvecs
,
OutputArray
_stdDeviationsIntrinsics
,
OutputArray
_stdDeviationsExtrinsics
,
OutputArray
_perViewErrors
,
int
flags
,
TermCriteria
criteria
)
{
CV_Assert
(
_charucoIds
.
total
()
>
0
&&
(
_charucoIds
.
total
()
==
_charucoCorners
.
total
()));
...
...
@@ -734,11 +737,24 @@ double calibrateCameraCharuco(InputArrayOfArrays _charucoCorners, InputArrayOfAr
}
return
calibrateCamera
(
allObjPoints
,
_charucoCorners
,
imageSize
,
_cameraMatrix
,
_distCoeffs
,
_rvecs
,
_tvecs
,
flags
,
criteria
);
_rvecs
,
_tvecs
,
_stdDeviationsIntrinsics
,
_stdDeviationsExtrinsics
,
_perViewErrors
,
flags
,
criteria
);
}
/**
*/
double
calibrateCameraCharuco
(
InputArrayOfArrays
_charucoCorners
,
InputArrayOfArrays
_charucoIds
,
Ptr
<
CharucoBoard
>
&
_board
,
Size
imageSize
,
InputOutputArray
_cameraMatrix
,
InputOutputArray
_distCoeffs
,
OutputArrayOfArrays
_rvecs
,
OutputArrayOfArrays
_tvecs
,
int
flags
,
TermCriteria
criteria
)
{
return
calibrateCameraCharuco
(
_charucoCorners
,
_charucoIds
,
_board
,
imageSize
,
_cameraMatrix
,
_distCoeffs
,
_rvecs
,
_tvecs
,
noArray
(),
noArray
(),
noArray
(),
flags
,
criteria
);
}
/**
*/
void
detectCharucoDiamond
(
InputArray
_image
,
InputArrayOfArrays
_markerCorners
,
...
...
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