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
0bc13493
Commit
0bc13493
authored
Dec 21, 2010
by
Ilya Lysenkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed some warnings under Windows
parent
351f6eeb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
18 deletions
+17
-18
blobdetector.cpp
modules/calib3d/src/blobdetector.cpp
+4
-4
calibinit.cpp
modules/calib3d/src/calibinit.cpp
+4
-4
circlesgrid.cpp
modules/calib3d/src/circlesgrid.cpp
+7
-8
circlesgrid.hpp
modules/calib3d/src/circlesgrid.hpp
+2
-2
No files found.
modules/calib3d/src/blobdetector.cpp
View file @
0bc13493
...
@@ -64,14 +64,14 @@ BlobDetectorParameters::BlobDetectorParameters()
...
@@ -64,14 +64,14 @@ BlobDetectorParameters::BlobDetectorParameters()
filterByInertia
=
true
;
filterByInertia
=
true
;
//minInertiaRatio = 0.6;
//minInertiaRatio = 0.6;
minInertiaRatio
=
0.1
;
minInertiaRatio
=
0.1
f
;
filterByConvexity
=
true
;
filterByConvexity
=
true
;
//minConvexity = 0.8;
//minConvexity = 0.8;
minConvexity
=
0.95
;
minConvexity
=
0.95
f
;
filterByCircularity
=
false
;
filterByCircularity
=
false
;
minCircularity
=
0.8
;
minCircularity
=
0.8
f
;
}
}
BlobDetector
::
BlobDetector
(
const
BlobDetectorParameters
&
parameters
)
:
BlobDetector
::
BlobDetector
(
const
BlobDetectorParameters
&
parameters
)
:
...
@@ -195,7 +195,7 @@ void BlobDetector::findBlobs(const cv::Mat &image, const cv::Mat &binaryImage, v
...
@@ -195,7 +195,7 @@ void BlobDetector::findBlobs(const cv::Mat &image, const cv::Mat &binaryImage, v
if
(
params
.
filterByColor
)
if
(
params
.
filterByColor
)
{
{
if
(
binaryImage
.
at
<
uchar
>
(
c
enter
.
location
.
y
,
center
.
location
.
x
)
==
255
)
if
(
binaryImage
.
at
<
uchar
>
(
c
vRound
(
center
.
location
.
y
),
cvRound
(
center
.
location
.
x
)
)
==
255
)
continue
;
continue
;
}
}
...
...
modules/calib3d/src/calibinit.cpp
View file @
0bc13493
...
@@ -1936,7 +1936,7 @@ void drawChessboardCorners( Mat& image, Size patternSize,
...
@@ -1936,7 +1936,7 @@ void drawChessboardCorners( Mat& image, Size patternSize,
}
}
bool
findCirclesGrid
(
const
Mat
&
image
,
Size
patternSize
,
bool
findCirclesGrid
(
const
Mat
&
image
,
Size
patternSize
,
vector
<
Point2f
>&
centers
,
int
flags
)
vector
<
Point2f
>&
centers
,
int
)
{
{
Ptr
<
BlobDetector
>
detector
=
new
BlobDetector
();
Ptr
<
BlobDetector
>
detector
=
new
BlobDetector
();
//Ptr<FeatureDetector> detector = new MserFeatureDetector();
//Ptr<FeatureDetector> detector = new MserFeatureDetector();
...
@@ -1944,11 +1944,11 @@ bool findCirclesGrid( const Mat& image, Size patternSize,
...
@@ -1944,11 +1944,11 @@ bool findCirclesGrid( const Mat& image, Size patternSize,
detector
->
detect
(
image
,
keypoints
);
detector
->
detect
(
image
,
keypoints
);
CirclesGridFinderParameters
parameters
;
CirclesGridFinderParameters
parameters
;
parameters
.
vertexPenalty
=
-
0.6
;
parameters
.
vertexPenalty
=
-
0.6
f
;
parameters
.
vertexGain
=
1
;
parameters
.
vertexGain
=
1
;
parameters
.
existingVertexGain
=
10000
;
parameters
.
existingVertexGain
=
10000
;
parameters
.
edgeGain
=
1
;
parameters
.
edgeGain
=
1
;
parameters
.
edgePenalty
=
-
0.6
;
parameters
.
edgePenalty
=
-
0.6
f
;
const
int
attempts
=
2
;
const
int
attempts
=
2
;
const
int
minHomographyPoints
=
4
;
const
int
minHomographyPoints
=
4
;
...
@@ -1962,7 +1962,7 @@ bool findCirclesGrid( const Mat& image, Size patternSize,
...
@@ -1962,7 +1962,7 @@ bool findCirclesGrid( const Mat& image, Size patternSize,
{
{
isFound
=
boxFinder
.
findHoles
();
isFound
=
boxFinder
.
findHoles
();
}
}
catch
(
cv
::
Exception
&
e
)
catch
(
cv
::
Exception
)
{
{
}
}
...
...
modules/calib3d/src/circlesgrid.cpp
View file @
0bc13493
...
@@ -142,7 +142,7 @@ CirclesGridFinderParameters::CirclesGridFinderParameters()
...
@@ -142,7 +142,7 @@ CirclesGridFinderParameters::CirclesGridFinderParameters()
densityNeighborhoodSize
=
Size2f
(
16
,
16
);
densityNeighborhoodSize
=
Size2f
(
16
,
16
);
minDistanceToAddKeypoint
=
20
;
minDistanceToAddKeypoint
=
20
;
kmeansAttempts
=
100
;
kmeansAttempts
=
100
;
convexHullFactor
=
1.1
;
convexHullFactor
=
1.1
f
;
keypointScale
=
1
;
keypointScale
=
1
;
minGraphConfidence
=
9
;
minGraphConfidence
=
9
;
...
@@ -258,7 +258,6 @@ Mat CirclesGridFinder::rectifyGrid(Size detectedGridSize, const vector<Point2f>&
...
@@ -258,7 +258,6 @@ Mat CirclesGridFinder::rectifyGrid(Size detectedGridSize, const vector<Point2f>&
assert
(
!
centers
.
empty
()
);
assert
(
!
centers
.
empty
()
);
const
float
edgeLength
=
30
;
const
float
edgeLength
=
30
;
const
Point2f
offset
(
150
,
150
);
const
Point2f
offset
(
150
,
150
);
const
int
keypointScale
=
1
;
vector
<
Point2f
>
dstPoints
;
vector
<
Point2f
>
dstPoints
;
for
(
int
i
=
0
;
i
<
detectedGridSize
.
height
;
i
++
)
for
(
int
i
=
0
;
i
<
detectedGridSize
.
height
;
i
++
)
...
@@ -296,10 +295,10 @@ Mat CirclesGridFinder::rectifyGrid(Size detectedGridSize, const vector<Point2f>&
...
@@ -296,10 +295,10 @@ Mat CirclesGridFinder::rectifyGrid(Size detectedGridSize, const vector<Point2f>&
int
CirclesGridFinder
::
findNearestKeypoint
(
Point2f
pt
)
const
int
CirclesGridFinder
::
findNearestKeypoint
(
Point2f
pt
)
const
{
{
int
bestIdx
=
-
1
;
int
bestIdx
=
-
1
;
float
minDist
=
std
::
numeric_limits
<
float
>::
max
();
double
minDist
=
std
::
numeric_limits
<
double
>::
max
();
for
(
size_t
i
=
0
;
i
<
keypoints
.
size
();
i
++
)
for
(
size_t
i
=
0
;
i
<
keypoints
.
size
();
i
++
)
{
{
float
dist
=
norm
(
pt
-
keypoints
[
i
]);
double
dist
=
norm
(
pt
-
keypoints
[
i
]);
if
(
dist
<
minDist
)
if
(
dist
<
minDist
)
{
{
minDist
=
dist
;
minDist
=
dist
;
...
@@ -621,7 +620,7 @@ void CirclesGridFinder::computeEdgeVectorsOfRNG(vector<Point2f> &vectors, Mat *d
...
@@ -621,7 +620,7 @@ void CirclesGridFinder::computeEdgeVectorsOfRNG(vector<Point2f> &vectors, Mat *d
continue
;
continue
;
Point2f
vec
=
keypoints
[
i
]
-
keypoints
[
j
];
Point2f
vec
=
keypoints
[
i
]
-
keypoints
[
j
];
float
dist
=
norm
(
vec
);
double
dist
=
norm
(
vec
);
bool
isNeighbors
=
true
;
bool
isNeighbors
=
true
;
for
(
size_t
k
=
0
;
k
<
keypoints
.
size
();
k
++
)
for
(
size_t
k
=
0
;
k
<
keypoints
.
size
();
k
++
)
...
@@ -629,8 +628,8 @@ void CirclesGridFinder::computeEdgeVectorsOfRNG(vector<Point2f> &vectors, Mat *d
...
@@ -629,8 +628,8 @@ void CirclesGridFinder::computeEdgeVectorsOfRNG(vector<Point2f> &vectors, Mat *d
if
(
k
==
i
||
k
==
j
)
if
(
k
==
i
||
k
==
j
)
continue
;
continue
;
float
dist1
=
norm
(
keypoints
[
i
]
-
keypoints
[
k
]);
double
dist1
=
norm
(
keypoints
[
i
]
-
keypoints
[
k
]);
float
dist2
=
norm
(
keypoints
[
j
]
-
keypoints
[
k
]);
double
dist2
=
norm
(
keypoints
[
j
]
-
keypoints
[
k
]);
if
(
dist1
<
dist
&&
dist2
<
dist
)
if
(
dist1
<
dist
&&
dist2
<
dist
)
{
{
isNeighbors
=
false
;
isNeighbors
=
false
;
...
@@ -714,7 +713,7 @@ size_t CirclesGridFinder::findLongestPath(vector<Graph> &basisGraphs, Path &best
...
@@ -714,7 +713,7 @@ size_t CirclesGridFinder::findLongestPath(vector<Graph> &basisGraphs, Path &best
}
}
if
(
longestPaths
.
empty
()
||
(
maxVal
==
longestPaths
[
0
].
length
&&
graphIdx
==
bestGraphIdx
))
if
(
longestPaths
.
empty
()
||
(
maxVal
==
longestPaths
[
0
].
length
&&
graphIdx
==
bestGraphIdx
))
{
{
Path
path
=
Path
(
maxLoc
.
x
,
maxLoc
.
y
,
maxVal
);
Path
path
=
Path
(
maxLoc
.
x
,
maxLoc
.
y
,
cvRound
(
maxVal
)
);
computeShortestPath
(
predecessorMatrix
,
maxLoc
.
x
,
maxLoc
.
y
,
path
.
vertices
);
computeShortestPath
(
predecessorMatrix
,
maxLoc
.
x
,
maxLoc
.
y
,
path
.
vertices
);
longestPaths
.
push_back
(
path
);
longestPaths
.
push_back
(
path
);
...
...
modules/calib3d/src/circlesgrid.hpp
View file @
0bc13493
...
@@ -97,10 +97,10 @@ struct CirclesGridFinderParameters
...
@@ -97,10 +97,10 @@ struct CirclesGridFinderParameters
int
kmeansAttempts
;
int
kmeansAttempts
;
int
minDistanceToAddKeypoint
;
int
minDistanceToAddKeypoint
;
int
keypointScale
;
int
keypointScale
;
in
t
minGraphConfidence
;
floa
t
minGraphConfidence
;
float
vertexGain
;
float
vertexGain
;
float
vertexPenalty
;
float
vertexPenalty
;
in
t
existingVertexGain
;
floa
t
existingVertexGain
;
float
edgeGain
;
float
edgeGain
;
float
edgePenalty
;
float
edgePenalty
;
float
convexHullFactor
;
float
convexHullFactor
;
...
...
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