Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
1b7ad93d
O
Opencv
项目概览
Greenplum
/
Opencv
大约 1 年 前同步成功
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Opencv
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1b7ad93d
编写于
7月 24, 2012
作者:
M
marina.kolpakova
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
LBP features integrated in CascadeClassifier_GPU
上级
2dc93574
变更
5
展开全部
隐藏空白更改
内联
并排
Showing
5 changed file
with
504 addition
and
491 deletion
+504
-491
modules/gpu/include/opencv2/gpu/gpu.hpp
modules/gpu/include/opencv2/gpu/gpu.hpp
+20
-34
modules/gpu/perf/perf_objdetect.cpp
modules/gpu/perf/perf_objdetect.cpp
+1
-1
modules/gpu/src/cascadeclassifier.cpp
modules/gpu/src/cascadeclassifier.cpp
+473
-447
modules/gpu/src/cuda/lbp.cu
modules/gpu/src/cuda/lbp.cu
+1
-0
modules/gpu/test/test_objdetect.cpp
modules/gpu/test/test_objdetect.cpp
+9
-9
未找到文件。
modules/gpu/include/opencv2/gpu/gpu.hpp
浏览文件 @
1b7ad93d
...
...
@@ -1397,7 +1397,7 @@ public:
};
////////////////////////////////// CascadeClassifier_GPU //////////////////////////////////////////
// The cascade classifier class for object detection
.
// The cascade classifier class for object detection
: supports old haar and new lbp xlm formats and nvbin for haar cascades olny.
class
CV_EXPORTS
CascadeClassifier_GPU
{
public:
...
...
@@ -1407,42 +1407,28 @@ public:
bool
empty
()
const
;
bool
load
(
const
std
::
string
&
filename
);
void
release
();
/* returns number of detected objects */
int
detectMultiScale
(
const
GpuMat
&
image
,
GpuMat
&
objectsBuf
,
double
scaleFactor
=
1.2
,
int
minNeighbors
=
4
,
Size
minSize
=
Size
());
bool
findLargestObject
;
bool
visualizeInPlace
;
Size
getClassifierSize
()
const
;
private:
struct
CascadeClassifierImpl
;
CascadeClassifierImpl
*
impl
;
};
// The cascade classifier class for object detection.
class
CV_EXPORTS
CascadeClassifier_GPU_LBP
{
public:
CascadeClassifier_GPU_LBP
(
cv
::
Size
detectionFrameSize
=
cv
::
Size
());
~
CascadeClassifier_GPU_LBP
();
bool
empty
()
const
;
bool
load
(
const
std
::
string
&
filename
);
void
release
();
int
detectMultiScale
(
const
GpuMat
&
image
,
GpuMat
&
objectsBuf
,
double
scaleFactor
=
1.1
,
int
minNeighbors
=
4
,
cv
::
Size
maxObjectSize
=
cv
::
Size
()
/*, Size minSize = Size()*/
);
Size
getClassifierSize
()
const
;
void
release
();
private:
/* returns number of detected objects */
int
detectMultiScale
(
const
GpuMat
&
image
,
GpuMat
&
objectsBuf
,
double
scaleFactor
=
1.2
,
int
minNeighbors
=
4
,
Size
minSize
=
Size
());
bool
findLargestObject
;
bool
visualizeInPlace
;
Size
getClassifierSize
()
const
;
private:
struct
CascadeClassifierImpl
;
CascadeClassifierImpl
*
impl
;
};
////////////////////////////////// SURF //////////////////////////////////////////
struct
HaarCascade
;
struct
LbpCascade
;
friend
class
CascadeClassifier_GPU_LBP
;
public:
int
detectMultiScale
(
const
GpuMat
&
image
,
GpuMat
&
objectsBuf
,
Size
maxObjectSize
,
Size
minSize
=
Size
(),
double
scaleFactor
=
1.1
,
int
minNeighbors
=
4
);
};
////////////////////////////////// SURF //////////////////////////////////////////
class
CV_EXPORTS
SURF_GPU
{
...
...
modules/gpu/perf/perf_objdetect.cpp
浏览文件 @
1b7ad93d
...
...
@@ -70,7 +70,7 @@ GPU_PERF_TEST_1(LBPClassifier, cv::gpu::DeviceInfo)
cv
::
gpu
::
GpuMat
img
(
img_host
);
cv
::
gpu
::
GpuMat
gpu_rects
;
cv
::
gpu
::
CascadeClassifier_GPU
_LBP
cascade
(
img
.
size
());
cv
::
gpu
::
CascadeClassifier_GPU
cascade
;
ASSERT_TRUE
(
cascade
.
load
(
perf
::
TestBase
::
getDataPath
(
"gpu/lbpcascade/lbpcascade_frontalface.xml"
)));
cascade
.
detectMultiScale
(
img
,
gpu_rects
);
...
...
modules/gpu/src/cascadeclassifier.cpp
浏览文件 @
1b7ad93d
此差异已折叠。
点击以展开。
modules/gpu/src/cuda/lbp.cu
浏览文件 @
1b7ad93d
...
...
@@ -290,6 +290,7 @@ namespace cv { namespace gpu { namespace device
{
const
int
block
=
128
;
int
grid
=
divUp
(
workAmount
,
block
);
cudaFuncSetCacheConfig
(
lbp_cascade
,
cudaFuncCachePreferL1
);
Cascade
cascade
((
Stage
*
)
mstages
.
ptr
(),
nstages
,
(
ClNode
*
)
mnodes
.
ptr
(),
mleaves
.
ptr
(),
msubsets
.
ptr
(),
(
uchar4
*
)
mfeatures
.
ptr
(),
subsetSize
);
lbp_cascade
<<<
grid
,
block
>>>
(
cascade
,
frameW
,
frameH
,
windowW
,
windowH
,
initialScale
,
factor
,
workAmount
,
integral
.
ptr
(),
integral
.
step
/
sizeof
(
int
),
objects
,
classified
);
}
...
...
modules/gpu/test/test_objdetect.cpp
浏览文件 @
1b7ad93d
...
...
@@ -302,13 +302,13 @@ PARAM_TEST_CASE(LBP_Read_classifier, cv::gpu::DeviceInfo, int)
TEST_P
(
LBP_Read_classifier
,
Accuracy
)
{
cv
::
gpu
::
CascadeClassifier_GPU
_LBP
classifier
;
cv
::
gpu
::
CascadeClassifier_GPU
classifier
;
std
::
string
classifierXmlPath
=
std
::
string
(
cvtest
::
TS
::
ptr
()
->
get_data_path
())
+
"lbpcascade/lbpcascade_frontalface.xml"
;
ASSERT_TRUE
(
classifier
.
load
(
classifierXmlPath
));
}
INSTANTIATE_TEST_CASE_P
(
GPU_ObjDetect
,
LBP_Read_classifier
,
testing
::
Combine
(
ALL_DEVICES
,
testing
::
Values
<
int
>
(
0
)));
INSTANTIATE_TEST_CASE_P
(
GPU_ObjDetect
,
LBP_Read_classifier
,
testing
::
Combine
(
ALL_DEVICES
,
testing
::
Values
<
int
>
(
0
)));
PARAM_TEST_CASE
(
LBP_classify
,
cv
::
gpu
::
DeviceInfo
,
int
)
...
...
@@ -344,7 +344,7 @@ TEST_P(LBP_classify, Accuracy)
for
(;
it
!=
rects
.
end
();
++
it
)
cv
::
rectangle
(
markedImage
,
*
it
,
CV_RGB
(
0
,
0
,
255
));
cv
::
gpu
::
CascadeClassifier_GPU
_LBP
gpuClassifier
;
cv
::
gpu
::
CascadeClassifier_GPU
gpuClassifier
;
ASSERT_TRUE
(
gpuClassifier
.
load
(
classifierXmlPath
));
cv
::
gpu
::
GpuMat
gpu_rects
;
...
...
@@ -352,23 +352,23 @@ TEST_P(LBP_classify, Accuracy)
int
count
=
gpuClassifier
.
detectMultiScale
(
tested
,
gpu_rects
);
cv
::
Mat
downloaded
(
gpu_rects
);
const
cv
::
Rect
*
faces
=
downloaded
.
ptr
<
cv
::
Rect
>
();
const
cv
::
Rect
*
faces
=
downloaded
.
ptr
<
cv
::
Rect
>
();
for
(
int
i
=
0
;
i
<
count
;
i
++
)
{
cv
::
Rect
r
=
faces
[
i
];
#if defined (LOG_CASCADE_STATISTIC)
std
::
cout
<<
r
.
x
<<
" "
<<
r
.
y
<<
" "
<<
r
.
width
<<
" "
<<
r
.
height
<<
std
::
endl
;
#endif
std
::
cout
<<
r
.
x
<<
" "
<<
r
.
y
<<
" "
<<
r
.
width
<<
" "
<<
r
.
height
<<
std
::
endl
;
cv
::
rectangle
(
markedImage
,
r
,
CV_RGB
(
255
,
0
,
0
));
#endif
}
#if defined (LOG_CASCADE_STATISTIC)
cv
::
imshow
(
"Res"
,
markedImage
);
cv
::
waitKey
();
cv
::
imshow
(
"Res"
,
markedImage
);
cv
::
waitKey
();
#endif
}
INSTANTIATE_TEST_CASE_P
(
GPU_ObjDetect
,
LBP_classify
,
testing
::
Combine
(
ALL_DEVICES
,
testing
::
Values
<
int
>
(
0
)));
testing
::
Combine
(
ALL_DEVICES
,
testing
::
Values
<
int
>
(
0
)));
}
// namespace
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录