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
295dce52
Commit
295dce52
authored
Feb 20, 2018
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1536 from caseymcc:randpattern_setfeatures
parents
1023c381
c433e60a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
6 deletions
+28
-6
randpattern.hpp
modules/ccalib/include/opencv2/ccalib/randpattern.hpp
+10
-3
randpattern.cpp
modules/ccalib/src/randpattern.cpp
+18
-3
No files found.
modules/ccalib/include/opencv2/ccalib/randpattern.hpp
View file @
295dce52
...
...
@@ -86,7 +86,14 @@ public:
/* @brief Load pattern image and compute features for pattern
@param patternImage image for "random" pattern generated by RandomPatternGenerator, run it first.
*/
void
loadPattern
(
cv
::
Mat
patternImage
);
void
loadPattern
(
const
cv
::
Mat
&
patternImage
);
/* @brief Load pattern and features
@param patternImage image for "random" pattern generated by RandomPatternGenerator, run it first.
@param patternKeyPoints keyPoints created from a FeatureDetector.
@param patternDescriptors descriptors created from a DescriptorExtractor.
*/
void
loadPattern
(
const
cv
::
Mat
&
patternImage
,
const
std
::
vector
<
cv
::
KeyPoint
>
&
patternKeyPoints
,
const
cv
::
Mat
&
patternDescriptors
);
/* @brief Compute matched object points and image points which are used for calibration
The objectPoints (3D) and imagePoints (2D) are stored inside the class. Run getObjectPoints()
...
...
@@ -108,11 +115,11 @@ public:
/* @brief Get object(3D) points
*/
std
::
vector
<
cv
::
Mat
>
getObjectPoints
();
const
std
::
vector
<
cv
::
Mat
>
&
getObjectPoints
();
/* @brief and image(2D) points
*/
std
::
vector
<
cv
::
Mat
>
getImagePoints
();
const
std
::
vector
<
cv
::
Mat
>
&
getImagePoints
();
private
:
...
...
modules/ccalib/src/randpattern.cpp
View file @
295dce52
...
...
@@ -228,17 +228,17 @@ void RandomPatternCornerFinder::drawCorrespondence(const Mat& image1, const std:
waitKey
(
0
);
}
std
::
vector
<
cv
::
Mat
>
RandomPatternCornerFinder
::
getObjectPoints
()
const
std
::
vector
<
cv
::
Mat
>
&
RandomPatternCornerFinder
::
getObjectPoints
()
{
return
_objectPonits
;
}
std
::
vector
<
cv
::
Mat
>
RandomPatternCornerFinder
::
getImagePoints
()
const
std
::
vector
<
cv
::
Mat
>
&
RandomPatternCornerFinder
::
getImagePoints
()
{
return
_imagePoints
;
}
void
RandomPatternCornerFinder
::
loadPattern
(
c
v
::
Mat
patternImage
)
void
RandomPatternCornerFinder
::
loadPattern
(
c
onst
cv
::
Mat
&
patternImage
)
{
_patternImage
=
patternImage
.
clone
();
if
(
_patternImage
.
type
()
!=
CV_8U
)
...
...
@@ -249,6 +249,21 @@ void RandomPatternCornerFinder::loadPattern(cv::Mat patternImage)
_descriptorPattern
.
convertTo
(
_descriptorPattern
,
CV_32F
);
}
void
RandomPatternCornerFinder
::
loadPattern
(
const
cv
::
Mat
&
patternImage
,
const
std
::
vector
<
cv
::
KeyPoint
>
&
patternKeyPoints
,
const
cv
::
Mat
&
patternDescriptors
)
{
CV_Assert
((
int
)
patternKeyPoints
.
size
()
==
patternDescriptors
.
rows
);
CV_Assert
(
patternDescriptors
.
cols
==
_descriptor
->
descriptorSize
());
CV_Assert
(
patternDescriptors
.
type
()
==
_descriptor
->
descriptorType
());
_patternImage
=
patternImage
.
clone
();
if
(
_patternImage
.
type
()
!=
CV_8U
)
_patternImage
.
convertTo
(
_patternImage
,
CV_8U
);
_patternImageSize
=
patternImage
.
size
();
_keypointsPattern
=
patternKeyPoints
;
_descriptorPattern
=
patternDescriptors
.
clone
();
_descriptorPattern
.
convertTo
(
_descriptorPattern
,
CV_32F
);
}
std
::
vector
<
cv
::
Mat
>
RandomPatternCornerFinder
::
computeObjectImagePointsForSingle
(
cv
::
Mat
inputImage
)
{
CV_Assert
(
!
_patternImage
.
empty
());
...
...
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