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
1903d9fd
Commit
1903d9fd
authored
Sep 07, 2016
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #771 from sovrasov:aruco_board_create
parents
a4135ceb
b2e68454
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
1 deletion
+33
-1
aruco.hpp
modules/aruco/include/opencv2/aruco.hpp
+9
-0
aruco.cpp
modules/aruco/src/aruco.cpp
+24
-1
No files found.
modules/aruco/include/opencv2/aruco.hpp
View file @
1903d9fd
...
...
@@ -226,6 +226,15 @@ CV_EXPORTS_W void estimatePoseSingleMarkers(InputArrayOfArrays corners, float ma
class
CV_EXPORTS_W
Board
{
public
:
/**
* @brief Provide way to create Board by passing nessesary data. Specially needed in Python.
*
* @param objPoints array of object points of all the marker corners in the board
* @param dictionary the dictionary of markers employed for this board
* @param ids vector of the identifiers of the markers in the board
*
*/
CV_WRAP
static
Ptr
<
Board
>
create
(
InputArrayOfArrays
objPoints
,
Ptr
<
Dictionary
>
&
dictionary
,
InputArray
ids
);
// array of object points of all the marker corners in the board
// each marker include its 4 corners, i.e. for M markers, the size is Mx4
CV_PROP
std
::
vector
<
std
::
vector
<
Point3f
>
>
objPoints
;
...
...
modules/aruco/src/aruco.cpp
View file @
1903d9fd
...
...
@@ -41,7 +41,6 @@ the use of this software, even if advised of the possibility of such damage.
#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
namespace
cv
{
namespace
aruco
{
...
...
@@ -1334,6 +1333,30 @@ void GridBoard::draw(Size outSize, OutputArray _img, int marginSize, int borderB
}
/**
*/
Ptr
<
Board
>
Board
::
create
(
InputArrayOfArrays
objPoints
,
Ptr
<
Dictionary
>
&
dictionary
,
InputArray
ids
)
{
CV_Assert
(
objPoints
.
total
()
==
ids
.
total
());
CV_Assert
(
objPoints
.
type
()
==
CV_32FC3
);
std
::
vector
<
std
::
vector
<
Point3f
>
>
obj_points_vector
;
for
(
unsigned
int
i
=
0
;
i
<
objPoints
.
total
();
i
++
)
{
std
::
vector
<
Point3f
>
corners
;
Mat
corners_mat
=
objPoints
.
getMat
(
i
);
for
(
int
j
=
0
;
j
<
4
;
j
++
)
{
corners
.
push_back
(
corners_mat
.
at
<
Point3f
>
(
j
));
}
obj_points_vector
.
push_back
(
corners
);
}
Ptr
<
Board
>
res
=
makePtr
<
Board
>
();
ids
.
copyTo
(
res
->
ids
);
res
->
objPoints
=
obj_points_vector
;
res
->
dictionary
=
dictionary
;
return
res
;
}
/**
*/
Ptr
<
GridBoard
>
GridBoard
::
create
(
int
markersX
,
int
markersY
,
float
markerLength
,
float
markerSeparation
,
...
...
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