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
91b5c97d
Commit
91b5c97d
authored
Sep 25, 2010
by
Anatoly Baksheev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gpu test refactoring
parent
02ced7b4
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
206 additions
and
249 deletions
+206
-249
arithm.cpp
tests/gpu/src/arithm.cpp
+14
-12
imgproc_gpu.cpp
tests/gpu/src/imgproc_gpu.cpp
+62
-122
meanshift.cpp
tests/gpu/src/meanshift.cpp
+11
-12
morf_filters.cpp
tests/gpu/src/morf_filters.cpp
+10
-4
operator_async_call.cpp
tests/gpu/src/operator_async_call.cpp
+15
-17
operator_convert_to.cpp
tests/gpu/src/operator_convert_to.cpp
+6
-5
operator_copy_to.cpp
tests/gpu/src/operator_copy_to.cpp
+12
-16
operator_set_to.cpp
tests/gpu/src/operator_set_to.cpp
+6
-2
split_merge.cpp
tests/gpu/src/split_merge.cpp
+26
-9
stereo_bm.cpp
tests/gpu/src/stereo_bm.cpp
+11
-12
stereo_bm_async.cpp
tests/gpu/src/stereo_bm_async.cpp
+11
-15
stereo_bp.cpp
tests/gpu/src/stereo_bp.cpp
+11
-11
stereo_csbp.cpp
tests/gpu/src/stereo_csbp.cpp
+11
-12
No files found.
tests/gpu/src/arithm.cpp
View file @
91b5c97d
...
...
@@ -240,7 +240,7 @@ struct CV_GpuNppImageMultiplyTest : public CV_GpuArithmTest
{
CV_GpuNppImageMultiplyTest
()
:
CV_GpuArithmTest
(
"GPU-NppImageMultiply"
,
"multiply"
)
{}
int
CV_GpuNppImageMultiplyTest
::
test
(
const
Mat
&
mat1
,
const
Mat
&
mat2
)
int
test
(
const
Mat
&
mat1
,
const
Mat
&
mat2
)
{
if
(
mat1
.
type
()
!=
CV_8UC1
&&
mat1
.
type
()
!=
CV_8UC4
&&
mat1
.
type
()
!=
CV_32FC1
)
{
...
...
@@ -266,7 +266,7 @@ struct CV_GpuNppImageDivideTest : public CV_GpuArithmTest
{
CV_GpuNppImageDivideTest
()
:
CV_GpuArithmTest
(
"GPU-NppImageDivide"
,
"divide"
)
{}
int
CV_GpuNppImageDivideTest
::
test
(
const
Mat
&
mat1
,
const
Mat
&
mat2
)
int
test
(
const
Mat
&
mat1
,
const
Mat
&
mat2
)
{
if
(
mat1
.
type
()
!=
CV_8UC1
&&
mat1
.
type
()
!=
CV_8UC4
&&
mat1
.
type
()
!=
CV_32FC1
)
{
...
...
@@ -292,7 +292,7 @@ struct CV_GpuNppImageTransposeTest : public CV_GpuArithmTest
{
CV_GpuNppImageTransposeTest
()
:
CV_GpuArithmTest
(
"GPU-NppImageTranspose"
,
"transpose"
)
{}
int
CV_GpuNppImageTransposeTest
::
test
(
const
Mat
&
mat1
,
const
Mat
&
)
int
test
(
const
Mat
&
mat1
,
const
Mat
&
)
{
if
(
mat1
.
type
()
!=
CV_8UC1
)
{
...
...
@@ -317,7 +317,7 @@ struct CV_GpuNppImageAbsdiffTest : public CV_GpuArithmTest
{
CV_GpuNppImageAbsdiffTest
()
:
CV_GpuArithmTest
(
"GPU-NppImageAbsdiff"
,
"absdiff"
)
{}
int
CV_GpuNppImageAbsdiffTest
::
test
(
const
Mat
&
mat1
,
const
Mat
&
mat2
)
int
test
(
const
Mat
&
mat1
,
const
Mat
&
mat2
)
{
if
(
mat1
.
type
()
!=
CV_8UC1
&&
mat1
.
type
()
!=
CV_32FC1
)
{
...
...
@@ -343,7 +343,7 @@ struct CV_GpuNppImageCompareTest : public CV_GpuArithmTest
{
CV_GpuNppImageCompareTest
()
:
CV_GpuArithmTest
(
"GPU-NppImageCompare"
,
"compare"
)
{}
int
CV_GpuNppImageCompareTest
::
test
(
const
Mat
&
mat1
,
const
Mat
&
mat2
)
int
test
(
const
Mat
&
mat1
,
const
Mat
&
mat2
)
{
if
(
mat1
.
type
()
!=
CV_32FC1
)
{
...
...
@@ -383,7 +383,7 @@ struct CV_GpuNppImageMeanStdDevTest : public CV_GpuArithmTest
{
CV_GpuNppImageMeanStdDevTest
()
:
CV_GpuArithmTest
(
"GPU-NppImageMeanStdDev"
,
"meanStdDev"
)
{}
int
CV_GpuNppImageMeanStdDevTest
::
test
(
const
Mat
&
mat1
,
const
Mat
&
)
int
test
(
const
Mat
&
mat1
,
const
Mat
&
)
{
if
(
mat1
.
type
()
!=
CV_8UC1
)
{
...
...
@@ -424,7 +424,7 @@ struct CV_GpuNppImageNormTest : public CV_GpuArithmTest
{
CV_GpuNppImageNormTest
()
:
CV_GpuArithmTest
(
"GPU-NppImageNorm"
,
"norm"
)
{}
int
CV_GpuNppImageNormTest
::
test
(
const
Mat
&
mat1
,
const
Mat
&
mat2
)
int
test
(
const
Mat
&
mat1
,
const
Mat
&
mat2
)
{
if
(
mat1
.
type
()
!=
CV_8UC1
)
{
...
...
@@ -462,7 +462,7 @@ struct CV_GpuNppImageFlipTest : public CV_GpuArithmTest
{
CV_GpuNppImageFlipTest
()
:
CV_GpuArithmTest
(
"GPU-NppImageFlip"
,
"flip"
)
{}
int
CV_GpuNppImageFlipTest
::
test
(
const
Mat
&
mat1
,
const
Mat
&
)
int
test
(
const
Mat
&
mat1
,
const
Mat
&
)
{
if
(
mat1
.
type
()
!=
CV_8UC1
&&
mat1
.
type
()
!=
CV_8UC4
)
{
...
...
@@ -501,7 +501,7 @@ struct CV_GpuNppImageSumTest : public CV_GpuArithmTest
{
CV_GpuNppImageSumTest
()
:
CV_GpuArithmTest
(
"GPU-NppImageSum"
,
"sum"
)
{}
int
CV_GpuNppImageSumTest
::
test
(
const
Mat
&
mat1
,
const
Mat
&
)
int
test
(
const
Mat
&
mat1
,
const
Mat
&
)
{
if
(
mat1
.
type
()
!=
CV_8UC1
&&
mat1
.
type
()
!=
CV_8UC4
)
{
...
...
@@ -524,7 +524,7 @@ struct CV_GpuNppImageMinNaxTest : public CV_GpuArithmTest
{
CV_GpuNppImageMinNaxTest
()
:
CV_GpuArithmTest
(
"GPU-NppImageMinNax"
,
"minNax"
)
{}
int
CV_GpuNppImageMinNaxTest
::
test
(
const
Mat
&
mat1
,
const
Mat
&
)
int
test
(
const
Mat
&
mat1
,
const
Mat
&
)
{
if
(
mat1
.
type
()
!=
CV_8UC1
)
{
...
...
@@ -549,7 +549,7 @@ struct CV_GpuNppImageLUTTest : public CV_GpuArithmTest
{
CV_GpuNppImageLUTTest
()
:
CV_GpuArithmTest
(
"GPU-NppImageLUT"
,
"LUT"
)
{}
int
CV_GpuNppImageLUTTest
::
test
(
const
Mat
&
mat1
,
const
Mat
&
)
int
test
(
const
Mat
&
mat1
,
const
Mat
&
)
{
if
(
mat1
.
type
()
!=
CV_8UC1
)
{
...
...
@@ -572,7 +572,9 @@ struct CV_GpuNppImageLUTTest : public CV_GpuArithmTest
}
};
/////////////////////////////////////////////////////////////////////////////
/////////////////// tests registration /////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// If we comment some tests, we may foget/miss to uncomment it after.
// Placing all test definitions in one place
...
...
tests/gpu/src/imgproc_gpu.cpp
View file @
91b5c97d
...
...
@@ -54,8 +54,8 @@ using namespace gpu;
class
CV_GpuImageProcTest
:
public
CvTest
{
public
:
CV_GpuImageProcTest
(
const
char
*
test_name
,
const
char
*
test_funcs
)
;
virtual
~
CV_GpuImageProcTest
()
;
CV_GpuImageProcTest
(
const
char
*
test_name
,
const
char
*
test_funcs
)
:
CvTest
(
test_name
,
test_funcs
)
{}
virtual
~
CV_GpuImageProcTest
()
{}
protected
:
void
run
(
int
);
...
...
@@ -70,11 +70,6 @@ protected:
int
CheckNorm
(
const
Mat
&
m1
,
const
Mat
&
m2
);
};
CV_GpuImageProcTest
::
CV_GpuImageProcTest
(
const
char
*
test_name
,
const
char
*
test_funcs
)
:
CvTest
(
test_name
,
test_funcs
)
{
}
CV_GpuImageProcTest
::~
CV_GpuImageProcTest
()
{}
int
CV_GpuImageProcTest
::
test8UC1
(
const
Mat
&
img
)
{
...
...
@@ -188,21 +183,13 @@ void CV_GpuImageProcTest::run( int )
////////////////////////////////////////////////////////////////////////////////
// threshold
class
CV_GpuNppImageThresholdTest
:
public
CV_GpuImageProcTest
struct
CV_GpuNppImageThresholdTest
:
public
CV_GpuImageProcTest
{
public
:
CV_GpuNppImageThresholdTest
()
;
CV_GpuNppImageThresholdTest
()
:
CV_GpuImageProcTest
(
"GPU-NppImageThreshold"
,
"threshold"
)
{}
protected
:
virtual
int
test
(
const
Mat
&
img
);
};
CV_GpuNppImageThresholdTest
::
CV_GpuNppImageThresholdTest
()
:
CV_GpuImageProcTest
(
"GPU-NppImageThreshold"
,
"threshold"
)
{
}
int
CV_GpuNppImageThresholdTest
::
test
(
const
Mat
&
img
)
{
int
test
(
const
Mat
&
img
)
{
if
(
img
.
type
()
!=
CV_32FC1
)
{
ts
->
printf
(
CvTS
::
LOG
,
"
\n
Unsupported type
\n
"
);
...
...
@@ -220,27 +207,16 @@ int CV_GpuNppImageThresholdTest::test(const Mat& img)
cv
::
gpu
::
threshold
(
gpu1
,
gpuRes
,
thresh
);
return
CheckNorm
(
cpuRes
,
gpuRes
);
}
CV_GpuNppImageThresholdTest
CV_GpuNppImageThreshold_test
;
}
};
////////////////////////////////////////////////////////////////////////////////
// resize
class
CV_GpuNppImageResizeTest
:
public
CV_GpuImageProcTest
{
public
:
CV_GpuNppImageResizeTest
();
protected
:
virtual
int
test
(
const
Mat
&
img
);
};
CV_GpuNppImageResizeTest
::
CV_GpuNppImageResizeTest
()
:
CV_GpuImageProcTest
(
"GPU-NppImageResize"
,
"resize"
)
{
}
int
CV_GpuNppImageResizeTest
::
test
(
const
Mat
&
img
)
struct
CV_GpuNppImageResizeTest
:
public
CV_GpuImageProcTest
{
CV_GpuNppImageResizeTest
()
:
CV_GpuImageProcTest
(
"GPU-NppImageResize"
,
"resize"
)
{}
int
test
(
const
Mat
&
img
)
{
if
(
img
.
type
()
!=
CV_8UC1
&&
img
.
type
()
!=
CV_8UC4
)
{
ts
->
printf
(
CvTS
::
LOG
,
"
\n
Unsupported type
\n
"
);
...
...
@@ -268,27 +244,17 @@ int CV_GpuNppImageResizeTest::test(const Mat& img)
}
return
test_res
;
}
//CV_GpuNppImageResizeTest CV_GpuNppImageResize_test;
}
};
////////////////////////////////////////////////////////////////////////////////
// copyMakeBorder
class
CV_GpuNppImageCopyMakeBorderTest
:
public
CV_GpuImageProcTest
struct
CV_GpuNppImageCopyMakeBorderTest
:
public
CV_GpuImageProcTest
{
public
:
CV_GpuNppImageCopyMakeBorderTest
();
CV_GpuNppImageCopyMakeBorderTest
()
:
CV_GpuImageProcTest
(
"GPU-NppImageCopyMakeBorder"
,
"copyMakeBorder"
)
{}
protected
:
virtual
int
test
(
const
Mat
&
img
);
};
CV_GpuNppImageCopyMakeBorderTest
::
CV_GpuNppImageCopyMakeBorderTest
()
:
CV_GpuImageProcTest
(
"GPU-NppImageCopyMakeBorder"
,
"copyMakeBorder"
)
{
}
int
CV_GpuNppImageCopyMakeBorderTest
::
test
(
const
Mat
&
img
)
{
int
test
(
const
Mat
&
img
)
{
if
(
img
.
type
()
!=
CV_8UC1
&&
img
.
type
()
!=
CV_8UC4
&&
img
.
type
()
!=
CV_32SC1
)
{
ts
->
printf
(
CvTS
::
LOG
,
"
\n
Unsupported type
\n
"
);
...
...
@@ -310,27 +276,17 @@ int CV_GpuNppImageCopyMakeBorderTest::test(const Mat& img)
cv
::
gpu
::
copyMakeBorder
(
gpu1
,
gpudst
,
top
,
botton
,
left
,
right
,
val
);
return
CheckNorm
(
cpudst
,
gpudst
);
}
CV_GpuNppImageCopyMakeBorderTest
CV_GpuNppImageCopyMakeBorder_test
;
}
};
////////////////////////////////////////////////////////////////////////////////
// warpAffine
class
CV_GpuNppImageWarpAffineTest
:
public
CV_GpuImageProcTest
struct
CV_GpuNppImageWarpAffineTest
:
public
CV_GpuImageProcTest
{
public
:
CV_GpuNppImageWarpAffineTest
();
CV_GpuNppImageWarpAffineTest
()
:
CV_GpuImageProcTest
(
"GPU-NppImageWarpAffine"
,
"warpAffine"
)
{}
protected
:
virtual
int
test
(
const
Mat
&
img
);
};
CV_GpuNppImageWarpAffineTest
::
CV_GpuNppImageWarpAffineTest
()
:
CV_GpuImageProcTest
(
"GPU-NppImageWarpAffine"
,
"warpAffine"
)
{
}
int
CV_GpuNppImageWarpAffineTest
::
test
(
const
Mat
&
img
)
{
int
test
(
const
Mat
&
img
)
{
if
(
img
.
type
()
==
CV_32SC1
)
{
ts
->
printf
(
CvTS
::
LOG
,
"
\n
Unsupported type
\n
"
);
...
...
@@ -366,27 +322,18 @@ int CV_GpuNppImageWarpAffineTest::test(const Mat& img)
}
return
test_res
;
}
//CV_GpuNppImageWarpAffineTest CV_GpuNppImageWarpAffine_test;
}
};
////////////////////////////////////////////////////////////////////////////////
// warpPerspective
class
CV_GpuNppImageWarpPerspectiveTest
:
public
CV_GpuImageProcTest
struct
CV_GpuNppImageWarpPerspectiveTest
:
public
CV_GpuImageProcTest
{
public
:
CV_GpuNppImageWarpPerspectiveTest
();
CV_GpuNppImageWarpPerspectiveTest
()
:
CV_GpuImageProcTest
(
"GPU-NppImageWarpPerspective"
,
"warpPerspective"
)
{}
protected
:
virtual
int
test
(
const
Mat
&
img
);
};
CV_GpuNppImageWarpPerspectiveTest
::
CV_GpuNppImageWarpPerspectiveTest
()
:
CV_GpuImageProcTest
(
"GPU-NppImageWarpPerspective"
,
"warpPerspective"
)
{
}
int
CV_GpuNppImageWarpPerspectiveTest
::
test
(
const
Mat
&
img
)
{
int
test
(
const
Mat
&
img
)
{
if
(
img
.
type
()
==
CV_32SC1
)
{
ts
->
printf
(
CvTS
::
LOG
,
"
\n
Unsupported type
\n
"
);
...
...
@@ -423,27 +370,17 @@ int CV_GpuNppImageWarpPerspectiveTest::test(const Mat& img)
}
return
test_res
;
}
//CV_GpuNppImageWarpPerspectiveTest CV_GpuNppImageWarpPerspective_test;
}
};
////////////////////////////////////////////////////////////////////////////////
// integral
class
CV_GpuNppImageIntegralTest
:
public
CV_GpuImageProcTest
struct
CV_GpuNppImageIntegralTest
:
public
CV_GpuImageProcTest
{
public
:
CV_GpuNppImageIntegralTest
();
CV_GpuNppImageIntegralTest
()
:
CV_GpuImageProcTest
(
"GPU-NppImageIntegral"
,
"integral"
)
{}
protected
:
virtual
int
test
(
const
Mat
&
img
);
};
CV_GpuNppImageIntegralTest
::
CV_GpuNppImageIntegralTest
()
:
CV_GpuImageProcTest
(
"GPU-NppImageIntegral"
,
"integral"
)
{
}
int
CV_GpuNppImageIntegralTest
::
test
(
const
Mat
&
img
)
{
int
CV_GpuNppImageIntegralTest
::
test
(
const
Mat
&
img
)
{
if
(
img
.
type
()
!=
CV_8UC1
)
{
ts
->
printf
(
CvTS
::
LOG
,
"
\n
Unsupported type
\n
"
);
...
...
@@ -473,27 +410,17 @@ int CV_GpuNppImageIntegralTest::test(const Mat& img)
}
return
test_res
;
}
CV_GpuNppImageIntegralTest
CV_GpuNppImageIntegral_test
;
}
};
////////////////////////////////////////////////////////////////////////////////
// blur
class
CV_GpuNppImageBlurTest
:
public
CV_GpuImageProcTest
struct
CV_GpuNppImageBlurTest
:
public
CV_GpuImageProcTest
{
public
:
CV_GpuNppImageBlurTest
();
CV_GpuNppImageBlurTest
()
:
CV_GpuImageProcTest
(
"GPU-NppImageBlur"
,
"blur"
)
{}
protected
:
virtual
int
test
(
const
Mat
&
img
);
};
CV_GpuNppImageBlurTest
::
CV_GpuNppImageBlurTest
()
:
CV_GpuImageProcTest
(
"GPU-NppImageBlur"
,
"blur"
)
{
}
int
CV_GpuNppImageBlurTest
::
test
(
const
Mat
&
img
)
{
int
test
(
const
Mat
&
img
)
{
if
(
img
.
type
()
!=
CV_8UC1
&&
img
.
type
()
!=
CV_8UC4
)
{
ts
->
printf
(
CvTS
::
LOG
,
"
\n
Unsupported type
\n
"
);
...
...
@@ -524,16 +451,16 @@ int CV_GpuNppImageBlurTest::test(const Mat& img)
}
return
test_res
;
}
//CV_GpuNppImageBlurTest CV_GpuNppImageBlur_test;
}
};
////////////////////////////////////////////////////////////////////////////////
// cvtColor
class
CV_GpuCvtColorTest
:
public
CvTest
{
public
:
CV_GpuCvtColorTest
();
CV_GpuCvtColorTest
()
:
CvTest
(
"GPU-NppCvtColor"
,
"cvtColor"
)
{}
~
CV_GpuCvtColorTest
()
{};
protected
:
void
run
(
int
);
...
...
@@ -541,9 +468,6 @@ protected:
int
CheckNorm
(
const
Mat
&
m1
,
const
Mat
&
m2
);
};
CV_GpuCvtColorTest
::
CV_GpuCvtColorTest
()
:
CvTest
(
"GPU-NppCvtColor"
,
"cvtColor"
)
{
}
int
CV_GpuCvtColorTest
::
CheckNorm
(
const
Mat
&
m1
,
const
Mat
&
m2
)
{
...
...
@@ -610,4 +534,19 @@ void CV_GpuCvtColorTest::run( int )
ts
->
set_failed_test_info
(
testResult
);
}
/////////////////////////////////////////////////////////////////////////////
/////////////////// tests registration /////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// If we comment some tests, we may foget/miss to uncomment it after.
// Placing all test definitions in one place
// makes us know about what tests are commented.
CV_GpuNppImageThresholdTest
CV_GpuNppImageThreshold_test
;
CV_GpuNppImageResizeTest
CV_GpuNppImageResize_test
;
CV_GpuNppImageCopyMakeBorderTest
CV_GpuNppImageCopyMakeBorder_test
;
CV_GpuNppImageWarpAffineTest
CV_GpuNppImageWarpAffine_test
;
CV_GpuNppImageWarpPerspectiveTest
CV_GpuNppImageWarpPerspective_test
;
CV_GpuNppImageIntegralTest
CV_GpuNppImageIntegral_test
;
CV_GpuNppImageBlurTest
CV_GpuNppImageBlur_test
;
CV_GpuCvtColorTest
CV_GpuCvtColor_test
;
\ No newline at end of file
tests/gpu/src/meanshift.cpp
View file @
91b5c97d
...
...
@@ -47,19 +47,12 @@
#include <string>
class
CV_GpuMeanShiftTest
:
public
CvTest
struct
CV_GpuMeanShiftTest
:
public
CvTest
{
public
:
CV_GpuMeanShiftTest
();
CV_GpuMeanShiftTest
()
:
CvTest
(
"GPU-MeanShift"
,
"MeanShift"
){}
protected
:
void
run
(
int
);
};
CV_GpuMeanShiftTest
::
CV_GpuMeanShiftTest
()
:
CvTest
(
"GPU-MeanShift"
,
"MeanShift"
){}
void
CV_GpuMeanShiftTest
::
run
(
int
)
{
void
run
(
int
)
{
int
spatialRad
=
30
;
int
colorRad
=
30
;
...
...
@@ -121,6 +114,12 @@ void CV_GpuMeanShiftTest::run(int)
}
ts
->
set_failed_test_info
(
CvTS
::
OK
);
}
}
};
/////////////////////////////////////////////////////////////////////////////
/////////////////// tests registration /////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
CV_GpuMeanShiftTest
CV_GpuMeanShift_test
;
tests/gpu/src/morf_filters.cpp
View file @
91b5c97d
...
...
@@ -147,8 +147,6 @@ protected:
}
};
CV_GpuErodeTest
CV_GpuErode_test
;
////////////////////////////////////////////////////////////////////////////////
// Dilate
class
CV_GpuDilateTest
:
public
CV_GpuNppMorphogyTest
...
...
@@ -173,8 +171,6 @@ protected:
}
};
CV_GpuDilateTest
CV_GpuDilate_test
;
////////////////////////////////////////////////////////////////////////////////
// Dilate
class
CV_GpuMorphExTest
:
public
CV_GpuNppMorphogyTest
...
...
@@ -211,4 +207,13 @@ protected:
}
};
/////////////////////////////////////////////////////////////////////////////
/////////////////// tests registration /////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
CV_GpuErodeTest
CV_GpuErode_test
;
CV_GpuDilateTest
CV_GpuDilate_test
;
CV_GpuMorphExTest
CV_GpuMorphEx_test
;
\ No newline at end of file
tests/gpu/src/operator_async_call.cpp
View file @
91b5c97d
...
...
@@ -58,8 +58,13 @@ using namespace gpu;
class
CV_GpuMatAsyncCallTest
:
public
CvTest
{
public
:
CV_GpuMatAsyncCallTest
();
~
CV_GpuMatAsyncCallTest
();
CV_GpuMatAsyncCallTest
()
:
CvTest
(
"GPU-MatOperatorAsyncCall"
,
"async"
)
{
rows
=
234
;
cols
=
123
;
}
~
CV_GpuMatAsyncCallTest
()
{}
protected
:
void
run
(
int
);
...
...
@@ -72,21 +77,8 @@ class CV_GpuMatAsyncCallTest : public CvTest
int
cols
;
};
CV_GpuMatAsyncCallTest
::
CV_GpuMatAsyncCallTest
()
:
CvTest
(
"GPU-MatOperatorAsyncCall"
,
"async"
)
{
rows
=
234
;
cols
=
123
;
//#define PRINT_MATRIX
}
CV_GpuMatAsyncCallTest
::~
CV_GpuMatAsyncCallTest
()
{}
template
<
typename
T
>
void
CV_GpuMatAsyncCallTest
::
print_mat
(
const
T
&
mat
,
const
std
::
string
&
name
)
const
{
cv
::
imshow
(
name
,
mat
);
}
void
CV_GpuMatAsyncCallTest
::
print_mat
(
const
T
&
mat
,
const
std
::
string
&
name
)
const
{
cv
::
imshow
(
name
,
mat
);
}
bool
CV_GpuMatAsyncCallTest
::
compare_matrix
(
cv
::
Mat
&
cpumat
)
{
...
...
@@ -160,4 +152,10 @@ void CV_GpuMatAsyncCallTest::run( int /* start_from */)
ts
->
set_failed_test_info
(
CvTS
::
FAIL_GENERIC
);
}
//CV_GpuMatAsyncCallTest CV_GpuMatAsyncCall_test;
/////////////////////////////////////////////////////////////////////////////
/////////////////// tests registration /////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
CV_GpuMatAsyncCallTest
CV_GpuMatAsyncCall_test
;
tests/gpu/src/operator_convert_to.cpp
View file @
91b5c97d
...
...
@@ -55,16 +55,13 @@ using namespace gpu;
class
CV_GpuMatOpConvertToTest
:
public
CvTest
{
public
:
CV_GpuMatOpConvertToTest
()
;
~
CV_GpuMatOpConvertToTest
()
;
CV_GpuMatOpConvertToTest
()
:
CvTest
(
"GPU-MatOperatorConvertTo"
,
"convertTo"
)
{}
~
CV_GpuMatOpConvertToTest
()
{}
protected
:
void
run
(
int
);
};
CV_GpuMatOpConvertToTest
::
CV_GpuMatOpConvertToTest
()
:
CvTest
(
"GPU-MatOperatorConvertTo"
,
"convertTo"
)
{}
CV_GpuMatOpConvertToTest
::~
CV_GpuMatOpConvertToTest
()
{}
void
CV_GpuMatOpConvertToTest
::
run
(
int
/* start_from */
)
{
const
Size
img_size
(
67
,
35
);
...
...
@@ -123,4 +120,8 @@ void CV_GpuMatOpConvertToTest::run(int /* start_from */)
ts
->
set_failed_test_info
(
passed
?
CvTS
::
OK
:
CvTS
::
FAIL_GENERIC
);
}
/////////////////////////////////////////////////////////////////////////////
/////////////////// tests registration /////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
CV_GpuMatOpConvertToTest
CV_GpuMatOpConvertToTest_test
;
tests/gpu/src/operator_copy_to.cpp
View file @
91b5c97d
...
...
@@ -58,8 +58,12 @@ using namespace gpu;
class
CV_GpuMatOpCopyToTest
:
public
CvTest
{
public
:
CV_GpuMatOpCopyToTest
();
~
CV_GpuMatOpCopyToTest
();
CV_GpuMatOpCopyToTest
()
:
CvTest
(
"GPU-MatOperatorCopyTo"
,
"copyTo"
)
{
rows
=
234
;
cols
=
123
;
}
~
CV_GpuMatOpCopyToTest
()
{}
protected
:
void
run
(
int
);
...
...
@@ -72,21 +76,8 @@ class CV_GpuMatOpCopyToTest : public CvTest
int
cols
;
};
CV_GpuMatOpCopyToTest
::
CV_GpuMatOpCopyToTest
()
:
CvTest
(
"GPU-MatOperatorCopyTo"
,
"copyTo"
)
{
rows
=
234
;
cols
=
123
;
//#define PRINT_MATRIX
}
CV_GpuMatOpCopyToTest
::~
CV_GpuMatOpCopyToTest
()
{}
template
<
typename
T
>
void
CV_GpuMatOpCopyToTest
::
print_mat
(
const
T
&
mat
,
const
std
::
string
&
name
)
const
{
cv
::
imshow
(
name
,
mat
);
}
void
CV_GpuMatOpCopyToTest
::
print_mat
(
const
T
&
mat
,
const
std
::
string
&
name
)
const
{
cv
::
imshow
(
name
,
mat
);
}
bool
CV_GpuMatOpCopyToTest
::
compare_matrix
(
cv
::
Mat
&
cpumat
,
gpu
::
GpuMat
&
gpumat
)
{
...
...
@@ -161,4 +152,9 @@ void CV_GpuMatOpCopyToTest::run( int /* start_from */)
ts
->
set_failed_test_info
(
CvTS
::
FAIL_GENERIC
);
}
/////////////////////////////////////////////////////////////////////////////
/////////////////// tests registration /////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
CV_GpuMatOpCopyToTest
CV_GpuMatOpCopyTo_test
;
tests/gpu/src/operator_set_to.cpp
View file @
91b5c97d
...
...
@@ -58,7 +58,7 @@ class CV_GpuMatOpSetToTest : public CvTest
{
public
:
CV_GpuMatOpSetToTest
();
~
CV_GpuMatOpSetToTest
()
;
~
CV_GpuMatOpSetToTest
()
{}
protected
:
void
run
(
int
);
...
...
@@ -85,7 +85,6 @@ CV_GpuMatOpSetToTest::CV_GpuMatOpSetToTest(): CvTest( "GPU-MatOperatorSetTo", "s
//#define PRINT_MATRIX
}
CV_GpuMatOpSetToTest
::~
CV_GpuMatOpSetToTest
()
{}
void
CV_GpuMatOpSetToTest
::
print_mat
(
cv
::
Mat
&
mat
,
std
::
string
name
)
{
...
...
@@ -154,4 +153,9 @@ void CV_GpuMatOpSetToTest::run( int /* start_from */)
ts
->
set_failed_test_info
(
CvTS
::
FAIL_GENERIC
);
}
/////////////////////////////////////////////////////////////////////////////
/////////////////// tests registration /////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
CV_GpuMatOpSetToTest
CV_GpuMatOpSetTo_test
;
tests/gpu/src/split_merge.cpp
View file @
91b5c97d
...
...
@@ -9,13 +9,16 @@
using
namespace
std
;
using
namespace
cv
;
////////////////////////////////////////////////////////////////////////////////
// Merge
struct
CV_MergeTest
:
public
CvTest
{
CV_MergeTest
()
:
CvTest
(
"GPU-Merge"
,
"merge"
)
{}
void
can_merge
(
size_t
rows
,
size_t
cols
);
void
can_merge_submatrixes
(
size_t
rows
,
size_t
cols
);
void
run
(
int
);
}
merge_test
;
};
void
CV_MergeTest
::
can_merge
(
size_t
rows
,
size_t
cols
)
...
...
@@ -96,7 +99,6 @@ void CV_MergeTest::can_merge_submatrixes(size_t rows, size_t cols)
}
}
void
CV_MergeTest
::
run
(
int
)
{
try
...
...
@@ -116,14 +118,16 @@ void CV_MergeTest::run(int)
}
////////////////////////////////////////////////////////////////////////////////
// Split
struct
CV_SplitTest
:
public
CvTest
{
CV_SplitTest
()
:
CvTest
(
"GPU-Split"
,
"split"
)
{}
void
can_split
(
size_t
rows
,
size_t
cols
);
void
can_split_submatrix
(
size_t
rows
,
size_t
cols
);
void
run
(
int
);
}
split_test
;
};
void
CV_SplitTest
::
can_split
(
size_t
rows
,
size_t
cols
)
{
...
...
@@ -163,8 +167,6 @@ void CV_SplitTest::can_split(size_t rows, size_t cols)
}
}
void
CV_SplitTest
::
can_split_submatrix
(
size_t
rows
,
size_t
cols
)
{
for
(
size_t
num_channels
=
1
;
num_channels
<=
4
;
++
num_channels
)
...
...
@@ -204,7 +206,6 @@ void CV_SplitTest::can_split_submatrix(size_t rows, size_t cols)
}
}
void
CV_SplitTest
::
run
(
int
)
{
try
...
...
@@ -224,13 +225,15 @@ void CV_SplitTest::run(int)
}
////////////////////////////////////////////////////////////////////////////////
// Split and merge
struct
CV_SplitMergeTest
:
public
CvTest
{
CV_SplitMergeTest
()
:
CvTest
(
"GPU-SplitMerge"
,
"split merge"
)
{}
void
can_split_merge
(
size_t
rows
,
size_t
cols
);
void
run
(
int
);
}
split_merge_test
;
};
void
CV_SplitMergeTest
::
can_split_merge
(
size_t
rows
,
size_t
cols
)
{
for
(
size_t
num_channels
=
1
;
num_channels
<=
4
;
++
num_channels
)
...
...
@@ -273,3 +276,17 @@ void CV_SplitMergeTest::run(int)
throw
;
}
}
/////////////////////////////////////////////////////////////////////////////
/////////////////// tests registration /////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// If we comment some tests, we may foget/miss to uncomment it after.
// Placing all test definitions in one place
// makes us know about what tests are commented.
CV_SplitTest
split_test
;
CV_MergeTest
merge_test
;
CV_SplitMergeTest
split_merge_test
;
tests/gpu/src/stereo_bm.cpp
View file @
91b5c97d
...
...
@@ -47,19 +47,13 @@
#include <string>
class
CV_GpuStereoBMTest
:
public
CvTest
struct
CV_GpuStereoBMTest
:
public
CvTest
{
public
:
CV_GpuStereoBMTest
();
CV_GpuStereoBMTest
()
:
CvTest
(
"GPU-StereoBM"
,
"StereoBM"
){}
~
CV_GpuStereoBMTest
()
{}
protected
:
void
run
(
int
);
};
CV_GpuStereoBMTest
::
CV_GpuStereoBMTest
()
:
CvTest
(
"GPU-StereoBM"
,
"StereoBM"
){}
void
CV_GpuStereoBMTest
::
run
(
int
)
{
void
run
(
int
)
{
cv
::
Mat
img_l
=
cv
::
imread
(
std
::
string
(
ts
->
get_data_path
())
+
"stereobm/aloe-L.png"
,
0
);
cv
::
Mat
img_r
=
cv
::
imread
(
std
::
string
(
ts
->
get_data_path
())
+
"stereobm/aloe-R.png"
,
0
);
cv
::
Mat
img_reference
=
cv
::
imread
(
std
::
string
(
ts
->
get_data_path
())
+
"stereobm/aloe-disp.png"
,
0
);
...
...
@@ -94,6 +88,11 @@ void CV_GpuStereoBMTest::run(int )
}
ts
->
set_failed_test_info
(
CvTS
::
OK
);
}
}
};
/////////////////////////////////////////////////////////////////////////////
/////////////////// tests registration /////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
CV_GpuStereoBMTest
CV_GpuStereoBM_test
;
tests/gpu/src/stereo_bm_async.cpp
View file @
91b5c97d
...
...
@@ -47,23 +47,14 @@
using
namespace
cv
;
using
namespace
std
;
class
CV_GpuMatAsyncCallStereoBMTest
:
public
CvTest
struct
CV_GpuMatAsyncCallStereoBMTest
:
public
CvTest
{
public
:
CV_GpuMatAsyncCallStereoBMTest
()
;
~
CV_GpuMatAsyncCallStereoBMTest
()
;
CV_GpuMatAsyncCallStereoBMTest
()
:
CvTest
(
"GPU-MatAsyncCallStereoBM"
,
"asyncStereoBM"
)
{}
~
CV_GpuMatAsyncCallStereoBMTest
()
{}
protected
:
void
run
(
int
);
};
CV_GpuMatAsyncCallStereoBMTest
::
CV_GpuMatAsyncCallStereoBMTest
()
:
CvTest
(
"GPU-MatAsyncCallStereoBM"
,
"asyncStereoBM"
)
{}
CV_GpuMatAsyncCallStereoBMTest
::~
CV_GpuMatAsyncCallStereoBMTest
()
{}
void
CV_GpuMatAsyncCallStereoBMTest
::
run
(
int
/* start_from */
)
{
void
run
(
int
/* start_from */
)
{
cv
::
Mat
img_l
=
cv
::
imread
(
std
::
string
(
ts
->
get_data_path
())
+
"stereobm/aloe-L.png"
,
0
);
cv
::
Mat
img_r
=
cv
::
imread
(
std
::
string
(
ts
->
get_data_path
())
+
"stereobm/aloe-R.png"
,
0
);
cv
::
Mat
img_reference
=
cv
::
imread
(
std
::
string
(
ts
->
get_data_path
())
+
"stereobm/aloe-disp.png"
,
0
);
...
...
@@ -105,6 +96,11 @@ void CV_GpuMatAsyncCallStereoBMTest::run( int /* start_from */)
}
ts
->
set_failed_test_info
(
CvTS
::
OK
);
}
}
};
/////////////////////////////////////////////////////////////////////////////
/////////////////// tests registration /////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
CV_GpuMatAsyncCallStereoBMTest
CV_GpuMatAsyncCallStereoBMTest_test
;
tests/gpu/src/stereo_bp.cpp
View file @
91b5c97d
...
...
@@ -47,18 +47,13 @@
#include <string>
class
CV_GpuStereoBPTest
:
public
CvTest
struct
CV_GpuStereoBPTest
:
public
CvTest
{
public
:
CV_GpuStereoBPTest
();
protected
:
void
run
(
int
);
};
CV_GpuStereoBPTest
::
CV_GpuStereoBPTest
()
:
CvTest
(
"GPU-StereoBP"
,
"StereoBP"
){}
CV_GpuStereoBPTest
()
:
CvTest
(
"GPU-StereoBP"
,
"StereoBP"
){}
~
CV_GpuStereoBPTest
()
{}
void
CV_GpuStereoBPTest
::
run
(
int
)
{
void
run
(
int
)
{
cv
::
Mat
img_l
=
cv
::
imread
(
std
::
string
(
ts
->
get_data_path
())
+
"stereobp/aloe-L.png"
);
cv
::
Mat
img_r
=
cv
::
imread
(
std
::
string
(
ts
->
get_data_path
())
+
"stereobp/aloe-R.png"
);
cv
::
Mat
img_template
=
cv
::
imread
(
std
::
string
(
ts
->
get_data_path
())
+
"stereobp/aloe-disp.png"
,
0
);
...
...
@@ -96,6 +91,11 @@ void CV_GpuStereoBPTest::run(int )
}
ts
->
set_failed_test_info
(
CvTS
::
OK
);
}
}
};
/////////////////////////////////////////////////////////////////////////////
/////////////////// tests registration /////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
CV_GpuStereoBPTest
CV_GpuStereoBP_test
;
tests/gpu/src/stereo_csbp.cpp
View file @
91b5c97d
...
...
@@ -46,19 +46,13 @@
#include <iostream>
#include <string>
class
CV_GpuStereoCSBPTest
:
public
CvTest
struct
CV_GpuStereoCSBPTest
:
public
CvTest
{
public
:
CV_GpuStereoCSBPTest
();
protected
:
void
run
(
int
);
};
CV_GpuStereoCSBPTest
()
:
CvTest
(
"GPU-StereoCSBP"
,
"ConstantSpaceStereoBP"
){}
~
CV_GpuStereoCSBPTest
()
{}
CV_GpuStereoCSBPTest
::
CV_GpuStereoCSBPTest
()
:
CvTest
(
"GPU-StereoCSBP"
,
"ConstantSpaceStereoBP"
){}
void
CV_GpuStereoCSBPTest
::
run
(
int
)
{
void
run
(
int
)
{
cv
::
Mat
img_l
=
cv
::
imread
(
std
::
string
(
ts
->
get_data_path
())
+
"csstereobp/aloe-L.png"
);
cv
::
Mat
img_r
=
cv
::
imread
(
std
::
string
(
ts
->
get_data_path
())
+
"csstereobp/aloe-R.png"
);
cv
::
Mat
img_template
=
cv
::
imread
(
std
::
string
(
ts
->
get_data_path
())
+
"csstereobp/aloe-disp.png"
,
0
);
...
...
@@ -96,6 +90,11 @@ void CV_GpuStereoCSBPTest::run(int )
}
ts
->
set_failed_test_info
(
CvTS
::
OK
);
}
}
};
/////////////////////////////////////////////////////////////////////////////
/////////////////// tests registration /////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
CV_GpuStereoCSBPTest
CV_GpuCSStereoBP_test
;
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