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
0a30f64f
Commit
0a30f64f
authored
Sep 01, 2016
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7206 from alalek:issue_7204
parents
e5175dbc
a6e5ebaf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
0 deletions
+25
-0
test_cornerssubpix.cpp
modules/calib3d/test/test_cornerssubpix.cpp
+14
-0
cornersubpix.cpp
modules/imgproc/src/cornersubpix.cpp
+9
-0
samplers.cpp
modules/imgproc/src/samplers.cpp
+2
-0
No files found.
modules/calib3d/test/test_cornerssubpix.cpp
View file @
0a30f64f
...
@@ -239,4 +239,18 @@ void CV_ChessboardSubpixelTest::generateIntrinsicParams()
...
@@ -239,4 +239,18 @@ void CV_ChessboardSubpixelTest::generateIntrinsicParams()
TEST
(
Calib3d_ChessboardSubPixDetector
,
accuracy
)
{
CV_ChessboardSubpixelTest
test
;
test
.
safe_run
();
}
TEST
(
Calib3d_ChessboardSubPixDetector
,
accuracy
)
{
CV_ChessboardSubpixelTest
test
;
test
.
safe_run
();
}
TEST
(
Calib3d_CornerSubPix
,
regression_7204
)
{
cv
::
Mat
image
(
cv
::
Size
(
70
,
38
),
CV_8UC1
,
cv
::
Scalar
::
all
(
0
));
image
(
cv
::
Rect
(
65
,
26
,
5
,
5
)).
setTo
(
cv
::
Scalar
::
all
(
255
));
image
(
cv
::
Rect
(
55
,
31
,
8
,
1
)).
setTo
(
cv
::
Scalar
::
all
(
255
));
image
(
cv
::
Rect
(
56
,
35
,
14
,
2
)).
setTo
(
cv
::
Scalar
::
all
(
255
));
image
(
cv
::
Rect
(
66
,
24
,
4
,
2
)).
setTo
(
cv
::
Scalar
::
all
(
255
));
image
.
at
<
uchar
>
(
24
,
69
)
=
0
;
std
::
vector
<
cv
::
Point2f
>
corners
;
corners
.
push_back
(
cv
::
Point2f
(
65
,
30
));
cv
::
cornerSubPix
(
image
,
corners
,
cv
::
Size
(
3
,
3
),
cv
::
Size
(
-
1
,
-
1
),
cv
::
TermCriteria
(
CV_TERMCRIT_EPS
+
CV_TERMCRIT_ITER
,
30
,
0.1
));
}
/* End of file. */
/* End of file. */
modules/imgproc/src/cornersubpix.cpp
View file @
0a30f64f
...
@@ -234,6 +234,15 @@ cvFindCornerSubPix( const void* srcarr, CvPoint2D32f* corners,
...
@@ -234,6 +234,15 @@ cvFindCornerSubPix( const void* srcarr, CvPoint2D32f* corners,
err
=
(
cI2
.
x
-
cI
.
x
)
*
(
cI2
.
x
-
cI
.
x
)
+
(
cI2
.
y
-
cI
.
y
)
*
(
cI2
.
y
-
cI
.
y
);
err
=
(
cI2
.
x
-
cI
.
x
)
*
(
cI2
.
x
-
cI
.
x
)
+
(
cI2
.
y
-
cI
.
y
)
*
(
cI2
.
y
-
cI
.
y
);
cI
=
cI2
;
cI
=
cI2
;
/* if new point is too far from initial, it means poor convergence. */
if
(
fabs
(
cI
.
x
-
cT
.
x
)
>
win
.
width
||
fabs
(
cI
.
y
-
cT
.
y
)
>
win
.
height
)
{
cI
=
cT
;
break
;
}
cI
.
x
=
std
::
max
(
0.0
f
,
std
::
min
((
float
)
size
.
width
,
cI
.
x
));
cI
.
y
=
std
::
max
(
0.0
f
,
std
::
min
((
float
)
size
.
height
,
cI
.
y
));
}
}
while
(
++
iter
<
max_iters
&&
err
>
eps
);
while
(
++
iter
<
max_iters
&&
err
>
eps
);
...
...
modules/imgproc/src/samplers.cpp
View file @
0a30f64f
...
@@ -392,6 +392,8 @@ CvStatus CV_STDCALL icvGetRectSubPix_8u32f_C1R
...
@@ -392,6 +392,8 @@ CvStatus CV_STDCALL icvGetRectSubPix_8u32f_C1R
ip
.
x
=
cvFloor
(
center
.
x
);
ip
.
x
=
cvFloor
(
center
.
x
);
ip
.
y
=
cvFloor
(
center
.
y
);
ip
.
y
=
cvFloor
(
center
.
y
);
CV_DbgAssert
(
fabs
(
center
.
x
-
ip
.
x
)
<=
1.0
f
&&
fabs
(
center
.
y
-
ip
.
y
)
<=
1.0
f
);
if
(
win_size
.
width
<=
0
||
win_size
.
height
<=
0
)
if
(
win_size
.
width
<=
0
||
win_size
.
height
<=
0
)
return
CV_BADRANGE_ERR
;
return
CV_BADRANGE_ERR
;
...
...
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