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
11b24eb4
Commit
11b24eb4
authored
Mar 01, 2017
by
Hans Gaiser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose CirclesGridFinderParameters in findCirclesGrid.
parent
f46fa6e0
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
62 additions
and
39 deletions
+62
-39
calib3d.hpp
modules/calib3d/include/opencv2/calib3d.hpp
+31
-0
calibinit.cpp
modules/calib3d/src/calibinit.cpp
+8
-8
circlesgrid.cpp
modules/calib3d/src/circlesgrid.cpp
+4
-4
circlesgrid.hpp
modules/calib3d/src/circlesgrid.hpp
+2
-26
gen_java.py
modules/java/generator/gen_java.py
+2
-1
cv2.cpp
modules/python/src2/cv2.cpp
+15
-0
No files found.
modules/calib3d/include/opencv2/calib3d.hpp
View file @
11b24eb4
...
...
@@ -714,6 +714,30 @@ found, or as colored corners connected with lines if the board was found.
CV_EXPORTS_W
void
drawChessboardCorners
(
InputOutputArray
image
,
Size
patternSize
,
InputArray
corners
,
bool
patternWasFound
);
struct
CV_EXPORTS_W_SIMPLE
CirclesGridFinderParameters
{
CV_WRAP
CirclesGridFinderParameters
();
CV_PROP_RW
cv
::
Size2f
densityNeighborhoodSize
;
CV_PROP_RW
float
minDensity
;
CV_PROP_RW
int
kmeansAttempts
;
CV_PROP_RW
int
minDistanceToAddKeypoint
;
CV_PROP_RW
int
keypointScale
;
CV_PROP_RW
float
minGraphConfidence
;
CV_PROP_RW
float
vertexGain
;
CV_PROP_RW
float
vertexPenalty
;
CV_PROP_RW
float
existingVertexGain
;
CV_PROP_RW
float
edgeGain
;
CV_PROP_RW
float
edgePenalty
;
CV_PROP_RW
float
convexHullFactor
;
CV_PROP_RW
float
minRNGEdgeSwitchDist
;
enum
GridType
{
SYMMETRIC_GRID
,
ASYMMETRIC_GRID
};
GridType
gridType
;
};
/** @brief Finds centers in the grid of circles.
@param image grid view of input circles; it must be an 8-bit grayscale or color image.
...
...
@@ -726,6 +750,7 @@ CV_EXPORTS_W void drawChessboardCorners( InputOutputArray image, Size patternSiz
- **CALIB_CB_CLUSTERING** uses a special algorithm for grid detection. It is more robust to
perspective distortions but much more sensitive to background clutter.
@param blobDetector feature detector that finds blobs like dark circles on light background.
@param parameters struct for finding circles in a grid pattern.
The function attempts to determine whether the input image contains a grid of circles. If it is, the
function locates centers of the circles. The function returns a non-zero value if all of the centers
...
...
@@ -745,6 +770,12 @@ Sample usage of detecting and drawing the centers of circles: :
@note The function requires white space (like a square-thick border, the wider the better) around
the board to make the detection more robust in various environments.
*/
CV_EXPORTS_W
bool
findCirclesGrid
(
InputArray
image
,
Size
patternSize
,
OutputArray
centers
,
int
flags
,
const
Ptr
<
FeatureDetector
>
&
blobDetector
,
CirclesGridFinderParameters
parameters
);
/** @overload */
CV_EXPORTS_W
bool
findCirclesGrid
(
InputArray
image
,
Size
patternSize
,
OutputArray
centers
,
int
flags
=
CALIB_CB_SYMMETRIC_GRID
,
const
Ptr
<
FeatureDetector
>
&
blobDetector
=
SimpleBlobDetector
::
create
());
...
...
modules/calib3d/src/calibinit.cpp
View file @
11b24eb4
...
...
@@ -2093,7 +2093,8 @@ void cv::drawChessboardCorners( InputOutputArray _image, Size patternSize,
}
bool
cv
::
findCirclesGrid
(
InputArray
_image
,
Size
patternSize
,
OutputArray
_centers
,
int
flags
,
const
Ptr
<
FeatureDetector
>
&
blobDetector
)
OutputArray
_centers
,
int
flags
,
const
Ptr
<
FeatureDetector
>
&
blobDetector
,
CirclesGridFinderParameters
parameters
)
{
CV_INSTRUMENT_REGION
()
...
...
@@ -2120,13 +2121,6 @@ bool cv::findCirclesGrid( InputArray _image, Size patternSize,
return
!
centers
.
empty
();
}
CirclesGridFinderParameters
parameters
;
parameters
.
vertexPenalty
=
-
0.6
f
;
parameters
.
vertexGain
=
1
;
parameters
.
existingVertexGain
=
10000
;
parameters
.
edgeGain
=
1
;
parameters
.
edgePenalty
=
-
0.6
f
;
if
(
flags
&
CALIB_CB_ASYMMETRIC_GRID
)
parameters
.
gridType
=
CirclesGridFinderParameters
::
ASYMMETRIC_GRID
;
if
(
flags
&
CALIB_CB_SYMMETRIC_GRID
)
...
...
@@ -2192,4 +2186,10 @@ bool cv::findCirclesGrid( InputArray _image, Size patternSize,
return
false
;
}
bool
cv
::
findCirclesGrid
(
InputArray
_image
,
Size
patternSize
,
OutputArray
_centers
,
int
flags
,
const
Ptr
<
FeatureDetector
>
&
blobDetector
)
{
return
cv
::
findCirclesGrid
(
_image
,
patternSize
,
_centers
,
flags
,
blobDetector
,
CirclesGridFinderParameters
());
}
/* End of file. */
modules/calib3d/src/circlesgrid.cpp
View file @
11b24eb4
...
...
@@ -551,11 +551,11 @@ CirclesGridFinderParameters::CirclesGridFinderParameters()
keypointScale
=
1
;
minGraphConfidence
=
9
;
vertexGain
=
2
;
vertexPenalty
=
-
5
;
vertexGain
=
1
;
vertexPenalty
=
-
0.6
f
;
edgeGain
=
1
;
edgePenalty
=
-
5
;
existingVertexGain
=
0
;
edgePenalty
=
-
0.6
f
;
existingVertexGain
=
1000
0
;
minRNGEdgeSwitchDist
=
5.
f
;
gridType
=
SYMMETRIC_GRID
;
...
...
modules/calib3d/src/circlesgrid.hpp
View file @
11b24eb4
...
...
@@ -119,35 +119,11 @@ struct Path
}
};
struct
CirclesGridFinderParameters
{
CirclesGridFinderParameters
();
cv
::
Size2f
densityNeighborhoodSize
;
float
minDensity
;
int
kmeansAttempts
;
int
minDistanceToAddKeypoint
;
int
keypointScale
;
float
minGraphConfidence
;
float
vertexGain
;
float
vertexPenalty
;
float
existingVertexGain
;
float
edgeGain
;
float
edgePenalty
;
float
convexHullFactor
;
float
minRNGEdgeSwitchDist
;
enum
GridType
{
SYMMETRIC_GRID
,
ASYMMETRIC_GRID
};
GridType
gridType
;
};
class
CirclesGridFinder
{
public
:
CirclesGridFinder
(
cv
::
Size
patternSize
,
const
std
::
vector
<
cv
::
Point2f
>
&
testKeypoints
,
const
CirclesGridFinderParameters
&
parameters
=
CirclesGridFinderParameters
());
const
cv
::
CirclesGridFinderParameters
&
parameters
=
cv
::
CirclesGridFinderParameters
());
bool
findHoles
();
static
cv
::
Mat
rectifyGrid
(
cv
::
Size
detectedGridSize
,
const
std
::
vector
<
cv
::
Point2f
>&
centers
,
const
std
::
vector
<
cv
::
Point2f
>
&
keypoint
,
std
::
vector
<
cv
::
Point2f
>
&
warpedKeypoints
);
...
...
@@ -211,7 +187,7 @@ private:
std
::
vector
<
std
::
vector
<
size_t
>
>
*
smallHoles
;
const
cv
::
Size_
<
size_t
>
patternSize
;
CirclesGridFinderParameters
parameters
;
cv
::
CirclesGridFinderParameters
parameters
;
CirclesGridFinder
&
operator
=
(
const
CirclesGridFinder
&
);
CirclesGridFinder
(
const
CirclesGridFinder
&
);
...
...
modules/java/generator/gen_java.py
View file @
11b24eb4
...
...
@@ -14,7 +14,8 @@ class_ignore_list = (
#core
"FileNode"
,
"FileStorage"
,
"KDTree"
,
"KeyPoint"
,
"DMatch"
,
#features2d
"SimpleBlobDetector"
"SimpleBlobDetector"
,
"CirclesGridFinderParameters"
)
const_ignore_list
=
(
...
...
modules/python/src2/cv2.cpp
View file @
11b24eb4
...
...
@@ -798,6 +798,21 @@ PyObject* pyopencv_from(const Size& sz)
return
Py_BuildValue
(
"(ii)"
,
sz
.
width
,
sz
.
height
);
}
template
<>
bool
pyopencv_to
(
PyObject
*
obj
,
Size_
<
float
>&
sz
,
const
char
*
name
)
{
(
void
)
name
;
if
(
!
obj
||
obj
==
Py_None
)
return
true
;
return
PyArg_ParseTuple
(
obj
,
"ff"
,
&
sz
.
width
,
&
sz
.
height
)
>
0
;
}
template
<>
PyObject
*
pyopencv_from
(
const
Size_
<
float
>&
sz
)
{
return
Py_BuildValue
(
"(ff)"
,
sz
.
width
,
sz
.
height
);
}
template
<>
bool
pyopencv_to
(
PyObject
*
obj
,
Rect
&
r
,
const
char
*
name
)
{
...
...
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