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
734b0da0
Commit
734b0da0
authored
Oct 24, 2012
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #94 from vpisarev/test_fixes
parents
080b9bbc
ae10ecd2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
15 deletions
+20
-15
test_chesscorners.cpp
modules/calib3d/test/test_chesscorners.cpp
+4
-0
test_operations.cpp
modules/core/test/test_operations.cpp
+15
-11
test.py
modules/python/test/test.py
+1
-4
No files found.
modules/calib3d/test/test_chesscorners.cpp
View file @
734b0da0
...
...
@@ -366,6 +366,9 @@ bool validateData(const ChessBoardGenerator& cbg, const Size& imgSz,
bool
CV_ChessboardDetectorTest
::
checkByGenerator
()
{
bool
res
=
true
;
// for some reason, this test sometimes fails on Ubuntu
#if (defined __APPLE__ && defined __x86_64__) || defined _MSC_VER
//theRNG() = 0x58e6e895b9913160;
//cv::DefaultRngAuto dra;
//theRNG() = *ts->get_rng();
...
...
@@ -464,6 +467,7 @@ bool CV_ChessboardDetectorTest::checkByGenerator()
cv
::
drawChessboardCorners
(
cb
,
cbg
.
cornersSize
(),
Mat
(
corners_found
),
found
);
}
#endif
return
res
;
}
...
...
modules/core/test/test_operations.cpp
View file @
734b0da0
...
...
@@ -69,7 +69,7 @@ protected:
bool
SomeMatFunctions
();
bool
TestMat
();
template
<
typename
_Tp
>
void
TestType
(
Size
sz
,
_Tp
value
=
_Tp
(
1.
f
)
);
template
<
typename
_Tp
>
void
TestType
(
Size
sz
,
_Tp
value
);
bool
TestTemplateMat
();
bool
TestMatND
();
bool
TestSparseMat
();
...
...
@@ -116,9 +116,12 @@ template<typename _Tp> void CV_OperationsTest::TestType(Size sz, _Tp value)
m
.
elemSize
()
==
sizeof
(
_Tp
)
&&
m
.
step
==
m
.
elemSize
()
*
m
.
cols
);
for
(
int
y
=
0
;
y
<
sz
.
height
;
y
++
)
for
(
int
x
=
0
;
x
<
sz
.
width
;
x
++
)
m
(
y
,
x
)
=
value
;
{
m
(
y
,
x
)
=
value
;
}
CV_Assert
(
sum
(
m
.
reshape
(
1
,
1
))[
0
]
==
(
double
)
sz
.
width
*
sz
.
height
);
double
s
=
sum
(
Mat
(
m
).
reshape
(
1
))[
0
];
CV_Assert
(
s
==
(
double
)
sz
.
width
*
sz
.
height
);
}
bool
CV_OperationsTest
::
TestMat
()
...
...
@@ -795,15 +798,16 @@ bool CV_OperationsTest::TestTemplateMat()
}
CV_Assert
(
badarg_catched
);
#include <iostream>
#include <opencv2/core/core.hpp>
Size
size
(
2
,
5
);
TestType
<
float
>
(
size
);
TestType
<
cv
::
Vec3f
>
(
size
);
TestType
<
cv
::
Matx31f
>
(
size
);
TestType
<
cv
::
Matx41f
>
(
size
);
TestType
<
cv
::
Matx32f
>
(
size
);
TestType
<
float
>
(
size
,
1.
f
);
cv
::
Vec3f
val1
=
1.
f
;
TestType
<
cv
::
Vec3f
>
(
size
,
val1
);
cv
::
Matx31f
val2
=
1.
f
;
TestType
<
cv
::
Matx31f
>
(
size
,
val2
);
cv
::
Matx41f
val3
=
1.
f
;
TestType
<
cv
::
Matx41f
>
(
size
,
val3
);
cv
::
Matx32f
val4
=
1.
f
;
TestType
<
cv
::
Matx32f
>
(
size
,
val4
);
}
catch
(
const
test_excep
&
e
)
{
...
...
modules/python/test/test.py
View file @
734b0da0
...
...
@@ -390,10 +390,7 @@ class FunctionTests(OpenCVTests):
def
test_DrawChessboardCorners
(
self
):
im
=
cv
.
CreateImage
((
512
,
512
),
cv
.
IPL_DEPTH_8U
,
3
)
cv
.
SetZero
(
im
)
cv
.
DrawChessboardCorners
(
im
,
(
5
,
5
),
[
(
100
,
100
)
for
i
in
range
(
5
*
5
)
],
1
)
self
.
assert_
(
cv
.
Sum
(
im
)[
0
]
>
0
)
self
.
assertRaises
(
TypeError
,
lambda
:
cv
.
DrawChessboardCorners
(
im
,
(
4
,
5
),
[
(
100
,
100
)
for
i
in
range
(
5
*
5
)
],
1
))
cv
.
DrawChessboardCorners
(
im
,
(
5
,
5
),
[
((
i
/
5
)
*
100
+
50
,(
i
%
5
)
*
100
+
50
)
for
i
in
range
(
5
*
5
)
],
1
)
def
test_ExtractSURF
(
self
):
img
=
self
.
get_sample
(
"samples/c/lena.jpg"
,
0
)
...
...
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