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
dccfd79d
Commit
dccfd79d
authored
Apr 10, 2012
by
Andrey Pavlenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#1783: test and fix for the bug
parent
b253665f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
mathfuncs.cpp
modules/core/src/mathfuncs.cpp
+1
-1
test_math.cpp
modules/core/test/test_math.cpp
+11
-1
No files found.
modules/core/src/mathfuncs.cpp
View file @
dccfd79d
...
...
@@ -2051,7 +2051,7 @@ bool chackIntegerRang(cv::Mat src, Point& bad_pt, int minVal, int maxVal, double
for
(
int
j
=
0
;
j
<
as_one_channel
.
rows
;
++
j
)
for
(
int
i
=
0
;
i
<
as_one_channel
.
cols
;
++
i
)
{
if
(
as_one_channel
.
at
<
typename
type_ass
::
type
>
(
j
,
i
)
<
=
minVal
||
as_one_channel
.
at
<
typename
type_ass
::
type
>
(
j
,
i
)
>=
maxVal
)
if
(
as_one_channel
.
at
<
typename
type_ass
::
type
>
(
j
,
i
)
<
minVal
||
as_one_channel
.
at
<
typename
type_ass
::
type
>
(
j
,
i
)
>=
maxVal
)
{
bad_pt
.
y
=
j
;
bad_pt
.
x
=
i
%
src
.
channels
();
...
...
modules/core/test/test_math.cpp
View file @
dccfd79d
...
...
@@ -2402,7 +2402,17 @@ TYPED_TEST_P(Core_CheckRange, Bounds)
delete
bad_pt
;
}
REGISTER_TYPED_TEST_CASE_P
(
Core_CheckRange
,
Negative
,
Positive
,
Bounds
);
TYPED_TEST_P
(
Core_CheckRange
,
Zero
)
{
double
min_bound
=
0.0
;
double
max_bound
=
0.1
;
cv
::
Mat
src
=
cv
::
Mat
::
zeros
(
3
,
3
,
cv
::
DataDepth
<
TypeParam
>::
value
);
ASSERT_TRUE
(
checkRange
(
src
,
true
,
NULL
,
min_bound
,
max_bound
)
);
}
REGISTER_TYPED_TEST_CASE_P
(
Core_CheckRange
,
Negative
,
Positive
,
Bounds
,
Zero
);
typedef
::
testing
::
Types
<
signed
char
,
unsigned
char
,
signed
short
,
unsigned
short
,
signed
int
>
mat_data_types
;
INSTANTIATE_TYPED_TEST_CASE_P
(
Negative_Test
,
Core_CheckRange
,
mat_data_types
);
...
...
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