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
06939f16
Commit
06939f16
authored
Oct 19, 2016
by
Pavel Rojtberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aruco: interpolateCornersCharuco - make minMarkers property configurable
allows trading corner precision for corner quantity
parent
25575af6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
22 deletions
+13
-22
charuco.hpp
modules/aruco/include/opencv2/aruco/charuco.hpp
+2
-1
charuco.cpp
modules/aruco/src/charuco.cpp
+11
-21
No files found.
modules/aruco/include/opencv2/aruco/charuco.hpp
View file @
06939f16
...
...
@@ -146,6 +146,7 @@ class CV_EXPORTS_W CharucoBoard : public Board {
* \f$A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\f$
* @param distCoeffs optional vector of distortion coefficients
* \f$(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6],[s_1, s_2, s_3, s_4]])\f$ of 4, 5, 8 or 12 elements
* @param minMarkers number of adjacent markers that must be detected to return a charuco corner
*
* This function receives the detected markers and returns the 2D position of the chessboard corners
* from a ChArUco board using the detected Aruco markers. If camera parameters are provided,
...
...
@@ -158,7 +159,7 @@ CV_EXPORTS_W int interpolateCornersCharuco(InputArrayOfArrays markerCorners, Inp
InputArray
image
,
const
Ptr
<
CharucoBoard
>
&
board
,
OutputArray
charucoCorners
,
OutputArray
charucoIds
,
InputArray
cameraMatrix
=
noArray
(),
InputArray
distCoeffs
=
noArray
());
InputArray
distCoeffs
=
noArray
()
,
int
minMarkers
=
2
);
...
...
modules/aruco/src/charuco.cpp
View file @
06939f16
...
...
@@ -486,15 +486,8 @@ static int _interpolateCornersCharucoApproxCalib(InputArrayOfArrays _markerCorne
subPixWinSizes
);
// filter corners outside the image and subpixel-refine charuco corners
unsigned
int
nRefinedCorners
;
nRefinedCorners
=
_selectAndRefineChessboardCorners
(
allChessboardImgPoints
,
_image
,
_charucoCorners
,
_charucoIds
,
subPixWinSizes
);
// to return a charuco corner, its two closes aruco markers should have been detected
nRefinedCorners
=
_filterCornersWithoutMinMarkers
(
_board
,
_charucoCorners
,
_charucoIds
,
_markerIds
,
2
,
_charucoCorners
,
_charucoIds
);
return
nRefinedCorners
;
return
_selectAndRefineChessboardCorners
(
allChessboardImgPoints
,
_image
,
_charucoCorners
,
_charucoIds
,
subPixWinSizes
);
}
...
...
@@ -576,15 +569,8 @@ static int _interpolateCornersCharucoLocalHom(InputArrayOfArrays _markerCorners,
// filter corners outside the image and subpixel-refine charuco corners
unsigned
int
nRefinedCorners
;
nRefinedCorners
=
_selectAndRefineChessboardCorners
(
allChessboardImgPoints
,
_image
,
_charucoCorners
,
_charucoIds
,
subPixWinSizes
);
// to return a charuco corner, its two closes aruco markers should have been detected
nRefinedCorners
=
_filterCornersWithoutMinMarkers
(
_board
,
_charucoCorners
,
_charucoIds
,
_markerIds
,
2
,
_charucoCorners
,
_charucoIds
);
return
nRefinedCorners
;
return
_selectAndRefineChessboardCorners
(
allChessboardImgPoints
,
_image
,
_charucoCorners
,
_charucoIds
,
subPixWinSizes
);
}
...
...
@@ -594,19 +580,23 @@ static int _interpolateCornersCharucoLocalHom(InputArrayOfArrays _markerCorners,
int
interpolateCornersCharuco
(
InputArrayOfArrays
_markerCorners
,
InputArray
_markerIds
,
InputArray
_image
,
const
Ptr
<
CharucoBoard
>
&
_board
,
OutputArray
_charucoCorners
,
OutputArray
_charucoIds
,
InputArray
_cameraMatrix
,
InputArray
_distCoeffs
)
{
InputArray
_cameraMatrix
,
InputArray
_distCoeffs
,
int
minMarkers
)
{
// if camera parameters are avaible, use approximated calibration
if
(
_cameraMatrix
.
total
()
!=
0
)
{
return
_interpolateCornersCharucoApproxCalib
(
_markerCorners
,
_markerIds
,
_image
,
_board
,
_interpolateCornersCharucoApproxCalib
(
_markerCorners
,
_markerIds
,
_image
,
_board
,
_cameraMatrix
,
_distCoeffs
,
_charucoCorners
,
_charucoIds
);
}
// else use local homography
else
{
return
_interpolateCornersCharucoLocalHom
(
_markerCorners
,
_markerIds
,
_image
,
_board
,
_interpolateCornersCharucoLocalHom
(
_markerCorners
,
_markerIds
,
_image
,
_board
,
_charucoCorners
,
_charucoIds
);
}
// to return a charuco corner, its closest aruco markers should have been detected
return
_filterCornersWithoutMinMarkers
(
_board
,
_charucoCorners
,
_charucoIds
,
_markerIds
,
minMarkers
,
_charucoCorners
,
_charucoIds
);
}
...
...
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