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
eb2f8a29
Commit
eb2f8a29
authored
Oct 25, 2013
by
Ilya Lavrenov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ocl tests: show diff when cv::countNonZero(diff) > 0
parent
55ede740
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
9 deletions
+13
-9
utility.cpp
modules/ocl/test/utility.cpp
+12
-8
utility.hpp
modules/ocl/test/utility.hpp
+1
-1
No files found.
modules/ocl/test/utility.cpp
View file @
eb2f8a29
...
@@ -231,21 +231,25 @@ double checkRectSimilarity(Size sz, std::vector<Rect>& ob1, std::vector<Rect>& o
...
@@ -231,21 +231,25 @@ double checkRectSimilarity(Size sz, std::vector<Rect>& ob1, std::vector<Rect>& o
return
final_test_result
;
return
final_test_result
;
}
}
void
showDiff
(
const
Mat
&
gold
,
const
Mat
&
actual
,
double
eps
)
void
showDiff
(
const
Mat
&
gold
,
const
Mat
&
actual
,
double
eps
,
bool
alwaysShow
)
{
{
Mat
diff
;
Mat
diff
;
absdiff
(
gold
,
actual
,
diff
);
absdiff
(
gold
,
actual
,
diff
);
diff
.
convertTo
(
diff
,
CV_32F
);
threshold
(
diff
,
diff
,
eps
,
255.0
,
cv
::
THRESH_BINARY
);
threshold
(
diff
,
diff
,
eps
,
255.0
,
cv
::
THRESH_BINARY
);
namedWindow
(
"gold"
,
WINDOW_NORMAL
);
if
(
alwaysShow
||
cv
::
countNonZero
(
diff
.
reshape
(
1
))
>
0
)
namedWindow
(
"actual"
,
WINDOW_NORMAL
);
{
namedWindow
(
"diff"
,
WINDOW_NORMAL
);
namedWindow
(
"gold"
,
WINDOW_NORMAL
);
namedWindow
(
"actual"
,
WINDOW_NORMAL
);
namedWindow
(
"diff"
,
WINDOW_NORMAL
);
imshow
(
"gold"
,
gold
);
imshow
(
"gold"
,
gold
);
imshow
(
"actual"
,
actual
);
imshow
(
"actual"
,
actual
);
imshow
(
"diff"
,
diff
);
imshow
(
"diff"
,
diff
);
waitKey
();
waitKey
();
}
}
}
}
// namespace cvtest
}
// namespace cvtest
modules/ocl/test/utility.hpp
View file @
eb2f8a29
...
@@ -52,7 +52,7 @@ extern int LOOP_TIMES;
...
@@ -52,7 +52,7 @@ extern int LOOP_TIMES;
namespace
cvtest
{
namespace
cvtest
{
void
showDiff
(
const
Mat
&
gold
,
const
Mat
&
actual
,
double
eps
);
void
showDiff
(
const
Mat
&
gold
,
const
Mat
&
actual
,
double
eps
,
bool
alwaysShow
=
false
);
cv
::
ocl
::
oclMat
createMat_ocl
(
cv
::
RNG
&
rng
,
Size
size
,
int
type
,
bool
useRoi
);
cv
::
ocl
::
oclMat
createMat_ocl
(
cv
::
RNG
&
rng
,
Size
size
,
int
type
,
bool
useRoi
);
cv
::
ocl
::
oclMat
loadMat_ocl
(
cv
::
RNG
&
rng
,
const
Mat
&
m
,
bool
useRoi
);
cv
::
ocl
::
oclMat
loadMat_ocl
(
cv
::
RNG
&
rng
,
const
Mat
&
m
,
bool
useRoi
);
...
...
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