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
51530d4d
Commit
51530d4d
authored
Mar 28, 2014
by
Andrey Pavlenko
Committed by
OpenCV Buildbot
Mar 28, 2014
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2543 from apavlenko:24_haar_revert
parents
8541b7bf
3747d264
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
133 additions
and
228 deletions
+133
-228
image_processing.rst
modules/ocl/doc/image_processing.rst
+4
-4
ocl.hpp
modules/ocl/include/opencv2/ocl/ocl.hpp
+4
-4
perf_imgproc.cpp
modules/ocl/perf/perf_imgproc.cpp
+2
-2
perf_match_template.cpp
modules/ocl/perf/perf_match_template.cpp
+2
-2
haar.cpp
modules/ocl/src/haar.cpp
+4
-43
imgproc.cpp
modules/ocl/src/imgproc.cpp
+15
-34
match_template.cpp
modules/ocl/src/match_template.cpp
+6
-18
haarobjectdetect.cl
modules/ocl/src/opencl/haarobjectdetect.cl
+40
-48
haarobjectdetect_scaled2.cl
modules/ocl/src/opencl/haarobjectdetect_scaled2.cl
+48
-53
imgproc_integral.cl
modules/ocl/src/opencl/imgproc_integral.cl
+0
-0
test_imgproc.cpp
modules/ocl/test/test_imgproc.cpp
+8
-20
No files found.
modules/ocl/doc/image_processing.rst
View file @
51530d4d
...
...
@@ -65,15 +65,15 @@ ocl::integral
-----------------
Computes an integral image.
.. ocv:function:: void ocl::integral(const oclMat &src, oclMat &sum, oclMat &sqsum
, int sdepth=-1
)
.. ocv:function:: void ocl::integral(const oclMat &src, oclMat &sum, oclMat &sqsum)
.. ocv:function:: void ocl::integral(const oclMat &src, oclMat &sum
, int sdepth=-1
)
.. ocv:function:: void ocl::integral(const oclMat &src, oclMat &sum)
:param src: Source image. Only ``CV_8UC1`` images are supported for now.
:param sum: Integral image containing 32-bit unsigned integer
or 32-bit floating-point
.
:param sum: Integral image containing 32-bit unsigned integer
values packed into ``CV_32SC1``
.
:param sqsum: Sqsum values is ``CV_32FC1``
or ``CV_64FC1``
type.
:param sqsum: Sqsum values is ``CV_32FC1`` type.
.. seealso:: :ocv:func:`integral`
...
...
modules/ocl/include/opencv2/ocl/ocl.hpp
View file @
51530d4d
...
...
@@ -859,10 +859,10 @@ namespace cv
CV_EXPORTS
void
warpPerspective
(
const
oclMat
&
src
,
oclMat
&
dst
,
const
Mat
&
M
,
Size
dsize
,
int
flags
=
INTER_LINEAR
);
//! computes the integral image and integral for the squared image
// sum will
support CV_32S, CV_32F, sqsum - support CV32F, CV_64F
// sum will
have CV_32S type, sqsum - CV32F type
// supports only CV_8UC1 source type
CV_EXPORTS
void
integral
(
const
oclMat
&
src
,
oclMat
&
sum
,
oclMat
&
sqsum
,
int
sdepth
=-
1
);
CV_EXPORTS
void
integral
(
const
oclMat
&
src
,
oclMat
&
sum
,
int
sdepth
=-
1
);
CV_EXPORTS
void
integral
(
const
oclMat
&
src
,
oclMat
&
sum
,
oclMat
&
sqsum
);
CV_EXPORTS
void
integral
(
const
oclMat
&
src
,
oclMat
&
sum
);
CV_EXPORTS
void
cornerHarris
(
const
oclMat
&
src
,
oclMat
&
dst
,
int
blockSize
,
int
ksize
,
double
k
,
int
bordertype
=
cv
::
BORDER_DEFAULT
);
CV_EXPORTS
void
cornerHarris_dxdy
(
const
oclMat
&
src
,
oclMat
&
dst
,
oclMat
&
Dx
,
oclMat
&
Dy
,
int
blockSize
,
int
ksize
,
double
k
,
int
bordertype
=
cv
::
BORDER_DEFAULT
);
...
...
@@ -936,7 +936,7 @@ namespace cv
Size
m_maxSize
;
vector
<
CvSize
>
sizev
;
vector
<
float
>
scalev
;
oclMat
gimg1
,
gsum
,
gsqsum
,
gsqsum_t
;
oclMat
gimg1
,
gsum
,
gsqsum
;
void
*
buffers
;
};
...
...
modules/ocl/perf/perf_imgproc.cpp
View file @
51530d4d
...
...
@@ -237,7 +237,7 @@ OCL_PERF_TEST_P(CornerHarrisFixture, CornerHarris,
typedef
tuple
<
Size
,
MatDepth
>
IntegralParams
;
typedef
TestBaseWithParam
<
IntegralParams
>
IntegralFixture
;
OCL_PERF_TEST_P
(
IntegralFixture
,
Integral1
,
::
testing
::
Combine
(
OCL_TEST_SIZES
,
OCL_PERF_ENUM
(
CV_32S
,
CV_32F
)))
OCL_PERF_TEST_P
(
IntegralFixture
,
DISABLED_
Integral1
,
::
testing
::
Combine
(
OCL_TEST_SIZES
,
OCL_PERF_ENUM
(
CV_32S
,
CV_32F
)))
{
const
IntegralParams
params
=
GetParam
();
const
Size
srcSize
=
get
<
0
>
(
params
);
...
...
@@ -250,7 +250,7 @@ OCL_PERF_TEST_P(IntegralFixture, Integral1, ::testing::Combine(OCL_TEST_SIZES, O
{
ocl
::
oclMat
oclSrc
(
src
),
oclDst
;
OCL_TEST_CYCLE
()
cv
::
ocl
::
integral
(
oclSrc
,
oclDst
,
sdepth
);
//
OCL_TEST_CYCLE() cv::ocl::integral(oclSrc, oclDst, sdepth);
oclDst
.
download
(
dst
);
...
...
modules/ocl/perf/perf_match_template.cpp
View file @
51530d4d
...
...
@@ -109,13 +109,13 @@ OCL_PERF_TEST_P(CV_TM_CCORR_NORMEDFixture, matchTemplate,
oclDst
.
download
(
dst
);
SANITY_CHECK
(
dst
,
3
e-2
);
SANITY_CHECK
(
dst
,
2
e-2
);
}
else
if
(
RUN_PLAIN_IMPL
)
{
TEST_CYCLE
()
cv
::
matchTemplate
(
src
,
templ
,
dst
,
CV_TM_CCORR_NORMED
);
SANITY_CHECK
(
dst
,
3
e-2
);
SANITY_CHECK
(
dst
,
2
e-2
);
}
else
OCL_PERF_ELSE
...
...
modules/ocl/src/haar.cpp
View file @
51530d4d
...
...
@@ -747,15 +747,6 @@ CvSeq *cv::ocl::OclCascadeClassifier::oclHaarDetectObjects( oclMat &gimg, CvMemS
oclMat
gsum
(
totalheight
+
4
,
gimg
.
cols
+
1
,
CV_32SC1
);
oclMat
gsqsum
(
totalheight
+
4
,
gimg
.
cols
+
1
,
CV_32FC1
);
int
sdepth
=
0
;
if
(
Context
::
getContext
()
->
supportsFeature
(
FEATURE_CL_DOUBLE
))
sdepth
=
CV_64FC1
;
else
sdepth
=
CV_32FC1
;
sdepth
=
CV_MAT_DEPTH
(
sdepth
);
int
type
=
CV_MAKE_TYPE
(
sdepth
,
1
);
oclMat
gsqsum_t
(
totalheight
+
4
,
gimg
.
cols
+
1
,
type
);
cl_mem
stagebuffer
;
cl_mem
nodebuffer
;
cl_mem
candidatebuffer
;
...
...
@@ -763,7 +754,6 @@ CvSeq *cv::ocl::OclCascadeClassifier::oclHaarDetectObjects( oclMat &gimg, CvMemS
cv
::
Rect
roi
,
roi2
;
cv
::
Mat
imgroi
,
imgroisq
;
cv
::
ocl
::
oclMat
resizeroi
,
gimgroi
,
gimgroisq
;
int
grp_per_CU
=
12
;
size_t
blocksize
=
8
;
...
...
@@ -783,7 +773,7 @@ CvSeq *cv::ocl::OclCascadeClassifier::oclHaarDetectObjects( oclMat &gimg, CvMemS
roi2
=
Rect
(
0
,
0
,
sz
.
width
-
1
,
sz
.
height
-
1
);
resizeroi
=
gimg1
(
roi2
);
gimgroi
=
gsum
(
roi
);
gimgroisq
=
gsqsum
_t
(
roi
);
gimgroisq
=
gsqsum
(
roi
);
int
width
=
gimgroi
.
cols
-
1
-
cascade
->
orig_window_size
.
width
;
int
height
=
gimgroi
.
rows
-
1
-
cascade
->
orig_window_size
.
height
;
scaleinfo
[
i
].
width_height
=
(
width
<<
16
)
|
height
;
...
...
@@ -797,13 +787,8 @@ CvSeq *cv::ocl::OclCascadeClassifier::oclHaarDetectObjects( oclMat &gimg, CvMemS
scaleinfo
[
i
].
factor
=
factor
;
cv
::
ocl
::
resize
(
gimg
,
resizeroi
,
Size
(
sz
.
width
-
1
,
sz
.
height
-
1
),
0
,
0
,
INTER_LINEAR
);
cv
::
ocl
::
integral
(
resizeroi
,
gimgroi
,
gimgroisq
);
indexy
+=
sz
.
height
;
}
if
(
gsqsum_t
.
depth
()
==
CV_64F
)
gsqsum_t
.
convertTo
(
gsqsum
,
CV_32FC1
);
else
gsqsum
=
gsqsum_t
;
gcascade
=
(
GpuHidHaarClassifierCascade
*
)
cascade
->
hid_cascade
;
stage
=
(
GpuHidHaarStageClassifier
*
)(
gcascade
+
1
);
...
...
@@ -1040,12 +1025,7 @@ CvSeq *cv::ocl::OclCascadeClassifier::oclHaarDetectObjects( oclMat &gimg, CvMemS
int
n_factors
=
0
;
oclMat
gsum
;
oclMat
gsqsum
;
oclMat
gsqsum_t
;
cv
::
ocl
::
integral
(
gimg
,
gsum
,
gsqsum_t
);
if
(
gsqsum_t
.
depth
()
==
CV_64F
)
gsqsum_t
.
convertTo
(
gsqsum
,
CV_32FC1
);
else
gsqsum
=
gsqsum_t
;
cv
::
ocl
::
integral
(
gimg
,
gsum
,
gsqsum
);
CvSize
sz
;
vector
<
CvSize
>
sizev
;
vector
<
float
>
scalev
;
...
...
@@ -1320,16 +1300,12 @@ void cv::ocl::OclCascadeClassifierBuf::detectMultiScale(oclMat &gimg, CV_OUT std
roi2
=
Rect
(
0
,
0
,
sz
.
width
-
1
,
sz
.
height
-
1
);
resizeroi
=
gimg1
(
roi2
);
gimgroi
=
gsum
(
roi
);
gimgroisq
=
gsqsum
_t
(
roi
);
gimgroisq
=
gsqsum
(
roi
);
cv
::
ocl
::
resize
(
gimg
,
resizeroi
,
Size
(
sz
.
width
-
1
,
sz
.
height
-
1
),
0
,
0
,
INTER_LINEAR
);
cv
::
ocl
::
integral
(
resizeroi
,
gimgroi
,
gimgroisq
);
indexy
+=
sz
.
height
;
}
if
(
gsqsum_t
.
depth
()
==
CV_64F
)
gsqsum_t
.
convertTo
(
gsqsum
,
CV_32FC1
);
else
gsqsum
=
gsqsum_t
;
gcascade
=
(
GpuHidHaarClassifierCascade
*
)(
cascade
->
hid_cascade
);
stage
=
(
GpuHidHaarStageClassifier
*
)(
gcascade
+
1
);
...
...
@@ -1391,11 +1367,7 @@ void cv::ocl::OclCascadeClassifierBuf::detectMultiScale(oclMat &gimg, CV_OUT std
}
else
{
cv
::
ocl
::
integral
(
gimg
,
gsum
,
gsqsum_t
);
if
(
gsqsum_t
.
depth
()
==
CV_64F
)
gsqsum_t
.
convertTo
(
gsqsum
,
CV_32FC1
);
else
gsqsum
=
gsqsum_t
;
cv
::
ocl
::
integral
(
gimg
,
gsum
,
gsqsum
);
gcascade
=
(
GpuHidHaarClassifierCascade
*
)
cascade
->
hid_cascade
;
...
...
@@ -1621,7 +1593,6 @@ void cv::ocl::OclCascadeClassifierBuf::CreateFactorRelatedBufs(
gimg1
.
release
();
gsum
.
release
();
gsqsum
.
release
();
gsqsum_t
.
release
();
}
else
if
(
!
(
m_flags
&
CV_HAAR_SCALE_IMAGE
)
&&
(
flags
&
CV_HAAR_SCALE_IMAGE
))
{
...
...
@@ -1696,16 +1667,6 @@ void cv::ocl::OclCascadeClassifierBuf::CreateFactorRelatedBufs(
gsum
.
create
(
totalheight
+
4
,
cols
+
1
,
CV_32SC1
);
gsqsum
.
create
(
totalheight
+
4
,
cols
+
1
,
CV_32FC1
);
int
sdepth
=
0
;
if
(
Context
::
getContext
()
->
supportsFeature
(
FEATURE_CL_DOUBLE
))
sdepth
=
CV_64FC1
;
else
sdepth
=
CV_32FC1
;
sdepth
=
CV_MAT_DEPTH
(
sdepth
);
int
type
=
CV_MAKE_TYPE
(
sdepth
,
1
);
gsqsum_t
.
create
(
totalheight
+
4
,
cols
+
1
,
type
);
scaleinfo
=
(
detect_piramid_info
*
)
malloc
(
sizeof
(
detect_piramid_info
)
*
loopcount
);
for
(
int
i
=
0
;
i
<
loopcount
;
i
++
)
{
...
...
modules/ocl/src/imgproc.cpp
View file @
51530d4d
...
...
@@ -898,7 +898,7 @@ namespace cv
////////////////////////////////////////////////////////////////////////
// integral
void
integral
(
const
oclMat
&
src
,
oclMat
&
sum
,
oclMat
&
sqsum
,
int
sdepth
)
void
integral
(
const
oclMat
&
src
,
oclMat
&
sum
,
oclMat
&
sqsum
)
{
CV_Assert
(
src
.
type
()
==
CV_8UC1
);
if
(
!
src
.
clCxt
->
supportsFeature
(
ocl
::
FEATURE_CL_DOUBLE
)
&&
src
.
depth
()
==
CV_64F
)
...
...
@@ -907,11 +907,6 @@ namespace cv
return
;
}
if
(
sdepth
<=
0
)
sdepth
=
CV_32S
;
sdepth
=
CV_MAT_DEPTH
(
sdepth
);
int
type
=
CV_MAKE_TYPE
(
sdepth
,
1
);
int
vlen
=
4
;
int
offset
=
src
.
offset
/
vlen
;
int
pre_invalid
=
src
.
offset
%
vlen
;
...
...
@@ -919,26 +914,17 @@ namespace cv
oclMat
t_sum
,
t_sqsum
;
int
w
=
src
.
cols
+
1
,
h
=
src
.
rows
+
1
;
char
build_option
[
250
];
if
(
Context
::
getContext
()
->
supportsFeature
(
ocl
::
FEATURE_CL_DOUBLE
))
{
t_sqsum
.
create
(
src
.
cols
,
src
.
rows
,
CV_64FC1
);
sqsum
.
create
(
h
,
w
,
CV_64FC1
);
sprintf
(
build_option
,
"-D TYPE=double -D TYPE4=double4 -D convert_TYPE4=convert_double4"
);
}
else
{
t_sqsum
.
create
(
src
.
cols
,
src
.
rows
,
CV_32FC1
);
sqsum
.
create
(
h
,
w
,
CV_32FC1
);
sprintf
(
build_option
,
"-D TYPE=float -D TYPE4=float4 -D convert_TYPE4=convert_float4"
);
}
int
depth
=
src
.
depth
()
==
CV_8U
?
CV_32S
:
CV_64F
;
int
type
=
CV_MAKE_TYPE
(
depth
,
1
);
t_sum
.
create
(
src
.
cols
,
src
.
rows
,
type
);
sum
.
create
(
h
,
w
,
type
);
int
sum_offset
=
sum
.
offset
/
sum
.
elemSize
();
int
sqsum_offset
=
sqsum
.
offset
/
sqsum
.
elemSize
();
t_sqsum
.
create
(
src
.
cols
,
src
.
rows
,
CV_32FC1
);
sqsum
.
create
(
h
,
w
,
CV_32FC1
);
int
sum_offset
=
sum
.
offset
/
vlen
;
int
sqsum_offset
=
sqsum
.
offset
/
vlen
;
vector
<
pair
<
size_t
,
const
void
*>
>
args
;
args
.
push_back
(
make_pair
(
sizeof
(
cl_mem
)
,
(
void
*
)
&
src
.
data
));
...
...
@@ -950,9 +936,8 @@ namespace cv
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
src
.
cols
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
src
.
step
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
t_sum
.
step
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
t_sqsum
.
step
));
size_t
gt
[
3
]
=
{((
vcols
+
1
)
/
2
)
*
256
,
1
,
1
},
lt
[
3
]
=
{
256
,
1
,
1
};
openCLExecuteKernel
(
src
.
clCxt
,
&
imgproc_integral
,
"integral_cols"
,
gt
,
lt
,
args
,
-
1
,
sdepth
,
build_option
);
openCLExecuteKernel
(
src
.
clCxt
,
&
imgproc_integral
,
"integral_cols"
,
gt
,
lt
,
args
,
-
1
,
depth
);
args
.
clear
();
args
.
push_back
(
make_pair
(
sizeof
(
cl_mem
)
,
(
void
*
)
&
t_sum
.
data
));
...
...
@@ -962,16 +947,15 @@ namespace cv
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
t_sum
.
rows
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
t_sum
.
cols
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
t_sum
.
step
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
t_sqsum
.
step
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
sum
.
step
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
sqsum
.
step
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
sum_offset
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
sqsum_offset
));
size_t
gt2
[
3
]
=
{
t_sum
.
cols
*
32
,
1
,
1
},
lt2
[
3
]
=
{
256
,
1
,
1
};
openCLExecuteKernel
(
src
.
clCxt
,
&
imgproc_integral
,
"integral_rows"
,
gt2
,
lt2
,
args
,
-
1
,
sdepth
,
build_option
);
openCLExecuteKernel
(
src
.
clCxt
,
&
imgproc_integral
,
"integral_rows"
,
gt2
,
lt2
,
args
,
-
1
,
depth
);
}
void
integral
(
const
oclMat
&
src
,
oclMat
&
sum
,
int
sdepth
)
void
integral
(
const
oclMat
&
src
,
oclMat
&
sum
)
{
CV_Assert
(
src
.
type
()
==
CV_8UC1
);
int
vlen
=
4
;
...
...
@@ -979,13 +963,10 @@ namespace cv
int
pre_invalid
=
src
.
offset
%
vlen
;
int
vcols
=
(
pre_invalid
+
src
.
cols
+
vlen
-
1
)
/
vlen
;
if
(
sdepth
<=
0
)
sdepth
=
CV_32S
;
sdepth
=
CV_MAT_DEPTH
(
sdepth
);
int
type
=
CV_MAKE_TYPE
(
sdepth
,
1
);
oclMat
t_sum
;
int
w
=
src
.
cols
+
1
,
h
=
src
.
rows
+
1
;
int
depth
=
src
.
depth
()
==
CV_8U
?
CV_32S
:
CV_32F
;
int
type
=
CV_MAKE_TYPE
(
depth
,
1
);
t_sum
.
create
(
src
.
cols
,
src
.
rows
,
type
);
sum
.
create
(
h
,
w
,
type
);
...
...
@@ -1001,7 +982,7 @@ namespace cv
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
src
.
step
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
t_sum
.
step
));
size_t
gt
[
3
]
=
{((
vcols
+
1
)
/
2
)
*
256
,
1
,
1
},
lt
[
3
]
=
{
256
,
1
,
1
};
openCLExecuteKernel
(
src
.
clCxt
,
&
imgproc_integral_sum
,
"integral_sum_cols"
,
gt
,
lt
,
args
,
-
1
,
s
depth
);
openCLExecuteKernel
(
src
.
clCxt
,
&
imgproc_integral_sum
,
"integral_sum_cols"
,
gt
,
lt
,
args
,
-
1
,
depth
);
args
.
clear
();
args
.
push_back
(
make_pair
(
sizeof
(
cl_mem
)
,
(
void
*
)
&
t_sum
.
data
));
...
...
@@ -1012,7 +993,7 @@ namespace cv
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
sum
.
step
));
args
.
push_back
(
make_pair
(
sizeof
(
cl_int
)
,
(
void
*
)
&
sum_offset
));
size_t
gt2
[
3
]
=
{
t_sum
.
cols
*
32
,
1
,
1
},
lt2
[
3
]
=
{
256
,
1
,
1
};
openCLExecuteKernel
(
src
.
clCxt
,
&
imgproc_integral_sum
,
"integral_sum_rows"
,
gt2
,
lt2
,
args
,
-
1
,
s
depth
);
openCLExecuteKernel
(
src
.
clCxt
,
&
imgproc_integral_sum
,
"integral_sum_rows"
,
gt2
,
lt2
,
args
,
-
1
,
depth
);
}
/////////////////////// corner //////////////////////////////
...
...
modules/ocl/src/match_template.cpp
View file @
51530d4d
...
...
@@ -245,15 +245,12 @@ namespace cv
void
matchTemplate_CCORR_NORMED
(
const
oclMat
&
image
,
const
oclMat
&
templ
,
oclMat
&
result
,
MatchTemplateBuf
&
buf
)
{
cv
::
ocl
::
oclMat
temp
;
matchTemplate_CCORR
(
image
,
templ
,
result
,
buf
);
buf
.
image_sums
.
resize
(
1
);
buf
.
image_sqsums
.
resize
(
1
);
integral
(
image
.
reshape
(
1
),
buf
.
image_sums
[
0
],
temp
);
if
(
temp
.
depth
()
==
CV_64F
)
temp
.
convertTo
(
buf
.
image_sqsums
[
0
],
CV_32FC1
);
else
buf
.
image_sqsums
[
0
]
=
temp
;
integral
(
image
.
reshape
(
1
),
buf
.
image_sums
[
0
],
buf
.
image_sqsums
[
0
]);
unsigned
long
long
templ_sqsum
=
(
unsigned
long
long
)
sqrSum
(
templ
.
reshape
(
1
))[
0
];
Context
*
clCxt
=
image
.
clCxt
;
...
...
@@ -419,12 +416,7 @@ namespace cv
{
buf
.
image_sums
.
resize
(
1
);
buf
.
image_sqsums
.
resize
(
1
);
cv
::
ocl
::
oclMat
temp
;
integral
(
image
,
buf
.
image_sums
[
0
],
temp
);
if
(
temp
.
depth
()
==
CV_64F
)
temp
.
convertTo
(
buf
.
image_sqsums
[
0
],
CV_32FC1
);
else
buf
.
image_sqsums
[
0
]
=
temp
;
integral
(
image
,
buf
.
image_sums
[
0
],
buf
.
image_sqsums
[
0
]);
templ_sum
[
0
]
=
(
float
)
sum
(
templ
)[
0
];
...
...
@@ -460,14 +452,10 @@ namespace cv
templ_sum
*=
scale
;
buf
.
image_sums
.
resize
(
buf
.
images
.
size
());
buf
.
image_sqsums
.
resize
(
buf
.
images
.
size
());
cv
::
ocl
::
oclMat
temp
;
for
(
int
i
=
0
;
i
<
image
.
oclchannels
();
i
++
)
{
integral
(
buf
.
images
[
i
],
buf
.
image_sums
[
i
],
temp
);
if
(
temp
.
depth
()
==
CV_64F
)
temp
.
convertTo
(
buf
.
image_sqsums
[
i
],
CV_32FC1
);
else
buf
.
image_sqsums
[
i
]
=
temp
;
integral
(
buf
.
images
[
i
],
buf
.
image_sums
[
i
],
buf
.
image_sqsums
[
i
]);
}
switch
(
image
.
oclchannels
())
...
...
modules/ocl/src/opencl/haarobjectdetect.cl
View file @
51530d4d
...
...
@@ -62,13 +62,13 @@ typedef struct __attribute__((aligned (128) )) GpuHidHaarTreeNode
GpuHidHaarTreeNode
;
//
typedef
struct
__attribute__
((
aligned
(
32
)))
GpuHidHaarClassifier
//
{
//
int
count
__attribute__
((
aligned
(
4
)))
;
//
GpuHidHaarTreeNode*
node
__attribute__
((
aligned
(
8
)))
;
//
float*
alpha
__attribute__
((
aligned
(
8
)))
;
//
}
//
GpuHidHaarClassifier
;
typedef
struct
__attribute__
((
aligned
(
32
)))
GpuHidHaarClassifier
{
int
count
__attribute__
((
aligned
(
4
)))
;
GpuHidHaarTreeNode*
node
__attribute__
((
aligned
(
8
)))
;
float*
alpha
__attribute__
((
aligned
(
8
)))
;
}
GpuHidHaarClassifier
;
typedef
struct
__attribute__
((
aligned
(
64
)))
GpuHidHaarStageClassifier
...
...
@@ -84,22 +84,22 @@ typedef struct __attribute__((aligned (64))) GpuHidHaarStageClassifier
GpuHidHaarStageClassifier
;
//
typedef
struct
__attribute__
((
aligned
(
64
)))
GpuHidHaarClassifierCascade
//
{
//
int
count
__attribute__
((
aligned
(
4
)))
;
//
int
is_stump_based
__attribute__
((
aligned
(
4
)))
;
//
int
has_tilted_features
__attribute__
((
aligned
(
4
)))
;
//
int
is_tree
__attribute__
((
aligned
(
4
)))
;
//
int
pq0
__attribute__
((
aligned
(
4
)))
;
//
int
pq1
__attribute__
((
aligned
(
4
)))
;
//
int
pq2
__attribute__
((
aligned
(
4
)))
;
//
int
pq3
__attribute__
((
aligned
(
4
)))
;
//
int
p0
__attribute__
((
aligned
(
4
)))
;
//
int
p1
__attribute__
((
aligned
(
4
)))
;
//
int
p2
__attribute__
((
aligned
(
4
)))
;
//
int
p3
__attribute__
((
aligned
(
4
)))
;
//
float
inv_window_area
__attribute__
((
aligned
(
4
)))
;
//
}
GpuHidHaarClassifierCascade
;
typedef
struct
__attribute__
((
aligned
(
64
)))
GpuHidHaarClassifierCascade
{
int
count
__attribute__
((
aligned
(
4
)))
;
int
is_stump_based
__attribute__
((
aligned
(
4
)))
;
int
has_tilted_features
__attribute__
((
aligned
(
4
)))
;
int
is_tree
__attribute__
((
aligned
(
4
)))
;
int
pq0
__attribute__
((
aligned
(
4
)))
;
int
pq1
__attribute__
((
aligned
(
4
)))
;
int
pq2
__attribute__
((
aligned
(
4
)))
;
int
pq3
__attribute__
((
aligned
(
4
)))
;
int
p0
__attribute__
((
aligned
(
4
)))
;
int
p1
__attribute__
((
aligned
(
4
)))
;
int
p2
__attribute__
((
aligned
(
4
)))
;
int
p3
__attribute__
((
aligned
(
4
)))
;
float
inv_window_area
__attribute__
((
aligned
(
4
)))
;
}
GpuHidHaarClassifierCascade
;
#
ifdef
PACKED_CLASSIFIER
...
...
@@ -196,12 +196,10 @@ __kernel void gpuRunHaarClassifierCascadePacked(
for
(
int
stageloop
=
start_stage
; (stageloop < end_stage) && result; stageloop++ )
{//
iterate
until
candidate
is
valid
float
stage_sum
=
0.0f
;
__global
GpuHidHaarStageClassifier*
stageinfo
=
(
__global
GpuHidHaarStageClassifier*
)
((
__global
uchar*
)
stagecascadeptr+stageloop*sizeof
(
GpuHidHaarStageClassifier
))
;
int
lcl_off
=
(
yl*DATA_SIZE_X
)
+
(
xl
)
;
int
stagecount
=
stageinfo->count
;
float
stagethreshold
=
stageinfo->threshold
;
for
(
int
nodeloop
=
0
; nodeloop < stagecount; nodecounter++,nodeloop++ )
int2
stageinfo
=
*
(
global
int2*
)(
stagecascadeptr+stageloop
)
;
float
stagethreshold
=
as_float
(
stageinfo.y
)
;
int
lcl_off
=
(
lid_y*DATA_SIZE_X
)
+
(
lid_x
)
;
for
(
int
nodeloop
=
0
; nodeloop < stageinfo.x; nodecounter++,nodeloop++ )
{
//
simple
macro
to
extract
shorts
from
int
#
define
M0
(
_t
)
((
_t
)
&0xFFFF
)
...
...
@@ -357,17 +355,14 @@ __kernel void __attribute__((reqd_work_group_size(8,8,1)))gpuRunHaarClassifierCa
variance_norm_factor
=
variance_norm_factor
*
correction
-
mean
*
mean
;
variance_norm_factor
=
variance_norm_factor
>=0.f
?
sqrt
(
variance_norm_factor
)
:
1.f
;
for
(
int
stageloop
=
start_stage
; (stageloop < split_stage) && result; stageloop++ )
for
(
int
stageloop
=
start_stage
; (stageloop < split_stage)
&& result; stageloop++ )
{
float
stage_sum
=
0.f
;
__global
GpuHidHaarStageClassifier*
stageinfo
=
(
__global
GpuHidHaarStageClassifier*
)
((
__global
uchar*
)
stagecascadeptr+stageloop*sizeof
(
GpuHidHaarStageClassifier
))
;
int
stagecount
=
stageinfo->count
;
float
stagethreshold
=
stageinfo->threshold
;
for
(
int
nodeloop
=
0
; nodeloop < stagecount; )
int2
stageinfo
=
*
(
global
int2*
)(
stagecascadeptr+stageloop
)
;
float
stagethreshold
=
as_float
(
stageinfo.y
)
;
for
(
int
nodeloop
=
0
; nodeloop < stageinfo.x; )
{
__global
GpuHidHaarTreeNode*
currentnodeptr
=
(
__global
GpuHidHaarTreeNode*
)
(((
__global
uchar*
)
nodeptr
)
+
nodecounter
*
sizeof
(
GpuHidHaarTreeNode
))
;
__global
GpuHidHaarTreeNode*
currentnodeptr
=
(
nodeptr
+
nodecounter
)
;
int4
info1
=
*
(
__global
int4*
)(
&
(
currentnodeptr->p[0][0]
))
;
int4
info2
=
*
(
__global
int4*
)(
&
(
currentnodeptr->p[1][0]
))
;
...
...
@@ -423,7 +418,7 @@ __kernel void __attribute__((reqd_work_group_size(8,8,1)))gpuRunHaarClassifierCa
#endif
}
result = (stage_sum >= stagethreshold)
? 1 : 0
;
result = (stage_sum >= stagethreshold);
}
if(factor < 2)
{
...
...
@@ -452,17 +447,14 @@ __kernel void __attribute__((reqd_work_group_size(8,8,1)))gpuRunHaarClassifierCa
lclcount[0]=0;
barrier(CLK_LOCAL_MEM_FENCE);
//int2 stageinfo = *(global int2*)(stagecascadeptr+stageloop);
__global GpuHidHaarStageClassifier* stageinfo = (__global GpuHidHaarStageClassifier*)
((__global uchar*)stagecascadeptr+stageloop*sizeof(GpuHidHaarStageClassifier));
int stagecount = stageinfo->count;
float stagethreshold = stageinfo->threshold;
int2 stageinfo = *(global int2*)(stagecascadeptr+stageloop);
float stagethreshold = as_float(stageinfo.y);
int perfscale = queuecount > 4 ? 3 : 2;
int queuecount_loop = (queuecount + (1<<perfscale)-1) >> perfscale;
int lcl_compute_win = lcl_sz >> perfscale;
int lcl_compute_win_id = (lcl_id >>(6-perfscale));
int lcl_loops = (stage
count
+ lcl_compute_win -1) >> (6-perfscale);
int lcl_loops = (stage
info.x
+ lcl_compute_win -1) >> (6-perfscale);
int lcl_compute_id = lcl_id - (lcl_compute_win_id << (6-perfscale));
for(int queueloop=0; queueloop<queuecount_loop; queueloop++)
{
...
...
@@ -477,10 +469,10 @@ __kernel void __attribute__((reqd_work_group_size(8,8,1)))gpuRunHaarClassifierCa
float part_sum = 0.f;
const int stump_factor = STUMP_BASED ? 1 : 2;
int root_offset = 0;
for(int lcl_loop=0; lcl_loop<lcl_loops && tempnodecounter<stage
count
;)
for(int lcl_loop=0; lcl_loop<lcl_loops && tempnodecounter<stage
info.x
;)
{
__global GpuHidHaarTreeNode* currentnodeptr =
(__global GpuHidHaarTreeNode*)
(((__global uchar*)nodeptr) + sizeof(GpuHidHaarTreeNode) * ((nodecounter + tempnodecounter) * stump_factor + root_offset))
;
__global GpuHidHaarTreeNode* currentnodeptr =
nodeptr + (nodecounter + tempnodecounter) * stump_factor + root_offset
;
int4 info1 = *(__global int4*)(&(currentnodeptr->p[0][0]));
int4 info2 = *(__global int4*)(&(currentnodeptr->p[1][0]));
...
...
@@ -557,7 +549,7 @@ __kernel void __attribute__((reqd_work_group_size(8,8,1)))gpuRunHaarClassifierCa
queuecount
=
lclcount[0]
;
barrier
(
CLK_LOCAL_MEM_FENCE
)
;
nodecounter
+=
stage
count
;
nodecounter
+=
stage
info.x
;
}//end
for
(
int
stageloop
=
splitstage
; stageloop< endstage && queuecount>0;stageloop++)
if
(
lcl_id<queuecount
)
...
...
modules/ocl/src/opencl/haarobjectdetect_scaled2.cl
View file @
51530d4d
...
...
@@ -59,13 +59,13 @@ typedef struct __attribute__((aligned(128))) GpuHidHaarTreeNode
int
right
__attribute__
((
aligned
(
4
)))
;
}
GpuHidHaarTreeNode
;
//
typedef
struct
__attribute__
((
aligned
(
32
)))
GpuHidHaarClassifier
//
{
//
int
count
__attribute__
((
aligned
(
4
)))
;
//
GpuHidHaarTreeNode
*node
__attribute__
((
aligned
(
8
)))
;
//
float
*alpha
__attribute__
((
aligned
(
8
)))
;
//
}
//
GpuHidHaarClassifier
;
typedef
struct
__attribute__
((
aligned
(
32
)))
GpuHidHaarClassifier
{
int
count
__attribute__
((
aligned
(
4
)))
;
GpuHidHaarTreeNode
*node
__attribute__
((
aligned
(
8
)))
;
float
*alpha
__attribute__
((
aligned
(
8
)))
;
}
GpuHidHaarClassifier
;
typedef
struct
__attribute__
((
aligned
(
64
)))
GpuHidHaarStageClassifier
{
int
count
__attribute__
((
aligned
(
4
)))
;
...
...
@@ -77,29 +77,29 @@ typedef struct __attribute__((aligned(64))) GpuHidHaarStageClassifier
int
reserved3
__attribute__
((
aligned
(
8
)))
;
}
GpuHidHaarStageClassifier
;
//
typedef
struct
__attribute__
((
aligned
(
64
)))
GpuHidHaarClassifierCascade
//
{
//
int
count
__attribute__
((
aligned
(
4
)))
;
//
int
is_stump_based
__attribute__
((
aligned
(
4
)))
;
//
int
has_tilted_features
__attribute__
((
aligned
(
4
)))
;
//
int
is_tree
__attribute__
((
aligned
(
4
)))
;
//
int
pq0
__attribute__
((
aligned
(
4
)))
;
//
int
pq1
__attribute__
((
aligned
(
4
)))
;
//
int
pq2
__attribute__
((
aligned
(
4
)))
;
//
int
pq3
__attribute__
((
aligned
(
4
)))
;
//
int
p0
__attribute__
((
aligned
(
4
)))
;
//
int
p1
__attribute__
((
aligned
(
4
)))
;
//
int
p2
__attribute__
((
aligned
(
4
)))
;
//
int
p3
__attribute__
((
aligned
(
4
)))
;
//
float
inv_window_area
__attribute__
((
aligned
(
4
)))
;
//
}
GpuHidHaarClassifierCascade
;
typedef
struct
__attribute__
((
aligned
(
64
)))
GpuHidHaarClassifierCascade
{
int
count
__attribute__
((
aligned
(
4
)))
;
int
is_stump_based
__attribute__
((
aligned
(
4
)))
;
int
has_tilted_features
__attribute__
((
aligned
(
4
)))
;
int
is_tree
__attribute__
((
aligned
(
4
)))
;
int
pq0
__attribute__
((
aligned
(
4
)))
;
int
pq1
__attribute__
((
aligned
(
4
)))
;
int
pq2
__attribute__
((
aligned
(
4
)))
;
int
pq3
__attribute__
((
aligned
(
4
)))
;
int
p0
__attribute__
((
aligned
(
4
)))
;
int
p1
__attribute__
((
aligned
(
4
)))
;
int
p2
__attribute__
((
aligned
(
4
)))
;
int
p3
__attribute__
((
aligned
(
4
)))
;
float
inv_window_area
__attribute__
((
aligned
(
4
)))
;
}
GpuHidHaarClassifierCascade
;
__kernel
void
gpuRunHaarClassifierCascade_scaled2
(
global
GpuHidHaarStageClassifier
*stagecascadeptr
_
,
global
GpuHidHaarStageClassifier
*stagecascadeptr,
global
int4
*info,
global
GpuHidHaarTreeNode
*nodeptr
_
,
global
GpuHidHaarTreeNode
*nodeptr,
global
const
int
*restrict
sum,
global
const
float
*restrict
sqsum,
global
const
float
*restrict
sqsum,
global
int4
*candidate,
const
int
rows,
const
int
cols,
...
...
@@ -132,7 +132,8 @@ __kernel void gpuRunHaarClassifierCascade_scaled2(
int
max_idx
=
rows
*
cols
-
1
;
for
(
int
scalei
=
0
; scalei < loopcount; scalei++)
{
int4
scaleinfo1
=
info[scalei]
;
int4
scaleinfo1
;
scaleinfo1
=
info[scalei]
;
int
grpnumperline
=
(
scaleinfo1.y
&
0xffff0000
)
>>
16
;
int
totalgrp
=
scaleinfo1.y
&
0xffff
;
float
factor
=
as_float
(
scaleinfo1.w
)
;
...
...
@@ -173,18 +174,15 @@ __kernel void gpuRunHaarClassifierCascade_scaled2(
for
(
int
stageloop
=
start_stage
; (stageloop < end_stage) && result; stageloop++)
{
float
stage_sum
=
0.f
;
__global
GpuHidHaarStageClassifier*
stageinfo
=
(
__global
GpuHidHaarStageClassifier*
)
(((
__global
uchar*
)
stagecascadeptr_
)
+stageloop*sizeof
(
GpuHidHaarStageClassifier
))
;
int
stagecount
=
stageinfo->count
;
int
stagecount
=
stagecascadeptr[stageloop].count
;
for
(
int
nodeloop
=
0
; nodeloop < stagecount;)
{
__global
GpuHidHaarTreeNode*
currentnodeptr
=
(
__global
GpuHidHaarTreeNode*
)
(((
__global
uchar*
)
nodeptr_
)
+
nodecounter
*
sizeof
(
GpuHidHaarTreeNode
))
;
__global
GpuHidHaarTreeNode
*currentnodeptr
=
(
nodeptr
+
nodecounter
)
;
int4
info1
=
*
(
__global
int4
*
)(
&
(
currentnodeptr->p[0][0]
))
;
int4
info2
=
*
(
__global
int4
*
)(
&
(
currentnodeptr->p[1][0]
))
;
int4
info3
=
*
(
__global
int4
*
)(
&
(
currentnodeptr->p[2][0]
))
;
float4
w
=
*
(
__global
float4
*
)(
&
(
currentnodeptr->weight[0]
))
;
float3
alpha3
=
*
(
__global
float3*
)(
&
(
currentnodeptr->alpha[0]
))
;
float3
alpha3
=
*
(
__global
float3
*
)(
&
(
currentnodeptr->alpha[0]
))
;
float
nodethreshold
=
w.w
*
variance_norm_factor
;
info1.x
+=
p_offset
;
...
...
@@ -206,7 +204,7 @@ __kernel void gpuRunHaarClassifierCascade_scaled2(
sum[clamp
(
mad24
(
info3.w,
step,
info3.x
)
,
0
,
max_idx
)
]
+
sum[clamp
(
mad24
(
info3.w,
step,
info3.z
)
,
0
,
max_idx
)
]
)
*
w.z
;
bool
passThres
=
(
classsum
>=
nodethreshold
)
?
1
:
0
;
bool
passThres
=
classsum
>=
nodethreshold
;
#
if
STUMP_BASED
stage_sum
+=
passThres
?
alpha3.y
:
alpha3.x
;
...
...
@@ -236,8 +234,7 @@ __kernel void gpuRunHaarClassifierCascade_scaled2(
}
#endif
}
result = (stage_sum >= stageinfo->threshold) ? 1 : 0;
result = (int)(stage_sum >= stagecascadeptr[stageloop].threshold);
}
barrier(CLK_LOCAL_MEM_FENCE);
...
...
@@ -284,14 +281,11 @@ __kernel void gpuRunHaarClassifierCascade_scaled2(
}
}
}
__kernel
void
gpuscaleclassifier
(
global
GpuHidHaarTreeNode
*orinode,
global
GpuHidHaarTreeNode
*newnode,
float
scale,
float
weight_scale,
const
int
nodenum
)
__kernel
void
gpuscaleclassifier
(
global
GpuHidHaarTreeNode
*orinode,
global
GpuHidHaarTreeNode
*newnode,
float
scale,
float
weight_scale,
int
nodenum
)
{
const
int
counter
=
get_global_id
(
0
)
;
int
counter
=
get_global_id
(
0
)
;
int
tr_x[3],
tr_y[3],
tr_h[3],
tr_w[3],
i
=
0
;
GpuHidHaarTreeNode
t1
=
*
(
__global
GpuHidHaarTreeNode*
)
(((
__global
uchar*
)
orinode
)
+
counter
*
sizeof
(
GpuHidHaarTreeNode
))
;
__global
GpuHidHaarTreeNode*
pNew
=
(
__global
GpuHidHaarTreeNode*
)
(((
__global
uchar*
)
newnode
)
+
(
counter
+
nodenum
)
*
sizeof
(
GpuHidHaarTreeNode
))
;
GpuHidHaarTreeNode
t1
=
*
(
orinode
+
counter
)
;
#
pragma
unroll
for
(
i
=
0
; i < 3; i++)
...
...
@@ -303,21 +297,22 @@ __kernel void gpuscaleclassifier(global GpuHidHaarTreeNode *orinode, global GpuH
}
t1.weight[0]
=
-
(
t1.weight[1]
*
tr_h[1]
*
tr_w[1]
+
t1.weight[2]
*
tr_h[2]
*
tr_w[2]
)
/
(
tr_h[0]
*
tr_w[0]
)
;
counter
+=
nodenum
;
#
pragma
unroll
for
(
i
=
0
; i < 3; i++)
{
pNew->
p[i][0]
=
tr_x[i]
;
pNew->
p[i][1]
=
tr_y[i]
;
pNew->
p[i][2]
=
tr_x[i]
+
tr_w[i]
;
pNew->
p[i][3]
=
tr_y[i]
+
tr_h[i]
;
pNew->
weight[i]
=
t1.weight[i]
*
weight_scale
;
newnode[counter].
p[i][0]
=
tr_x[i]
;
newnode[counter].
p[i][1]
=
tr_y[i]
;
newnode[counter].
p[i][2]
=
tr_x[i]
+
tr_w[i]
;
newnode[counter].
p[i][3]
=
tr_y[i]
+
tr_h[i]
;
newnode[counter].
weight[i]
=
t1.weight[i]
*
weight_scale
;
}
pNew->
left
=
t1.left
;
pNew->
right
=
t1.right
;
pNew->
threshold
=
t1.threshold
;
pNew->
alpha[0]
=
t1.alpha[0]
;
pNew->
alpha[1]
=
t1.alpha[1]
;
pNew->
alpha[2]
=
t1.alpha[2]
;
newnode[counter].
left
=
t1.left
;
newnode[counter].
right
=
t1.right
;
newnode[counter].
threshold
=
t1.threshold
;
newnode[counter].
alpha[0]
=
t1.alpha[0]
;
newnode[counter].
alpha[1]
=
t1.alpha[1]
;
newnode[counter].
alpha[2]
=
t1.alpha[2]
;
}
modules/ocl/src/opencl/imgproc_integral.cl
View file @
51530d4d
This diff is collapsed.
Click to expand it.
modules/ocl/test/test_imgproc.cpp
View file @
51530d4d
...
...
@@ -295,33 +295,23 @@ OCL_TEST_P(CornerHarris, Mat)
//////////////////////////////////integral/////////////////////////////////////////////////
struct
Integral
:
public
ImgprocTestBase
{
int
sdepth
;
typedef
ImgprocTestBase
Integral
;
virtual
void
SetUp
()
{
type
=
GET_PARAM
(
0
);
blockSize
=
GET_PARAM
(
1
);
sdepth
=
GET_PARAM
(
2
);
useRoi
=
GET_PARAM
(
3
);
}
};
OCL_TEST_P
(
Integral
,
Mat1
)
{
for
(
int
j
=
0
;
j
<
LOOP_TIMES
;
j
++
)
{
random_roi
();
ocl
::
integral
(
gsrc_roi
,
gdst_roi
,
sdepth
);
integral
(
src_roi
,
dst_roi
,
sdepth
);
ocl
::
integral
(
gsrc_roi
,
gdst_roi
);
integral
(
src_roi
,
dst_roi
);
Near
();
}
}
OCL_TEST_P
(
Integral
,
Mat2
)
// TODO wrong output type
OCL_TEST_P
(
Integral
,
DISABLED_Mat2
)
{
Mat
dst1
;
ocl
::
oclMat
gdst1
;
...
...
@@ -330,12 +320,10 @@ OCL_TEST_P(Integral, Mat2)
{
random_roi
();
integral
(
src_roi
,
dst
_roi
,
dst1
,
sdepth
);
ocl
::
integral
(
gsrc_roi
,
gdst
_roi
,
gdst1
,
sdepth
);
integral
(
src_roi
,
dst
1
,
dst_roi
);
ocl
::
integral
(
gsrc_roi
,
gdst
1
,
gdst_roi
);
Near
();
if
(
gdst1
.
clCxt
->
supportsFeature
(
ocl
::
FEATURE_CL_DOUBLE
))
EXPECT_MAT_NEAR
(
dst1
,
Mat
(
gdst1
),
0.
);
}
}
...
...
@@ -575,7 +563,7 @@ INSTANTIATE_TEST_CASE_P(Imgproc, CornerHarris, Combine(
INSTANTIATE_TEST_CASE_P
(
Imgproc
,
Integral
,
Combine
(
Values
((
MatType
)
CV_8UC1
),
// TODO does not work with CV_32F, CV_64F
Values
(
0
),
// not used
Values
(
(
MatType
)
CV_32SC1
,
(
MatType
)
CV_32FC1
),
Values
(
0
),
// not used
Bool
()));
INSTANTIATE_TEST_CASE_P
(
Imgproc
,
Threshold
,
Combine
(
...
...
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