Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
f104d5be
O
Opencv
项目概览
Greenplum
/
Opencv
11 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
f104d5be
编写于
4月 11, 2014
作者:
A
Andrey Pavlenko
提交者:
OpenCV Buildbot
4月 11, 2014
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2600 from ilya-lavrenov:ipp_calc_hist
上级
fd90efc9
b970ec7d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
69 addition
and
1 deletion
+69
-1
modules/imgproc/src/histogram.cpp
modules/imgproc/src/histogram.cpp
+69
-1
未找到文件。
modules/imgproc/src/histogram.cpp
浏览文件 @
f104d5be
...
...
@@ -1175,6 +1175,48 @@ calcHist_8u( std::vector<uchar*>& _ptrs, const std::vector<int>& _deltas,
}
}
#if defined HAVE_IPP && !defined HAVE_IPP_ICV_ONLY
class
IPPCalcHistInvoker
:
public
ParallelLoopBody
{
public:
IPPCalcHistInvoker
(
const
Mat
&
_src
,
Mat
&
_hist
,
AutoBuffer
<
Ipp32s
>
&
_levels
,
Ipp32s
_histSize
,
Ipp32s
_low
,
Ipp32s
_high
,
bool
*
_ok
)
:
ParallelLoopBody
(),
src
(
&
_src
),
hist
(
&
_hist
),
levels
(
&
_levels
),
histSize
(
_histSize
),
low
(
_low
),
high
(
_high
),
ok
(
_ok
)
{
*
ok
=
true
;
}
virtual
void
operator
()
(
const
Range
&
range
)
const
{
Mat
phist
(
hist
->
size
(),
hist
->
type
(),
Scalar
::
all
(
0
));
IppStatus
status
=
ippiHistogramEven_8u_C1R
(
src
->
data
+
src
->
step
*
range
.
start
,
(
int
)
src
->
step
,
ippiSize
(
src
->
cols
,
range
.
end
-
range
.
start
),
(
Ipp32s
*
)
phist
.
data
,
(
Ipp32s
*
)
*
levels
,
histSize
,
low
,
high
);
if
(
status
<
0
)
{
*
ok
=
false
;
return
;
}
for
(
int
i
=
0
;
i
<
histSize
;
++
i
)
CV_XADD
((
int
*
)(
hist
->
data
+
i
*
hist
->
step
),
*
(
int
*
)(
phist
.
data
+
i
*
phist
.
step
));
}
private:
const
Mat
*
src
;
Mat
*
hist
;
AutoBuffer
<
Ipp32s
>
*
levels
;
Ipp32s
histSize
,
low
,
high
;
bool
*
ok
;
const
IPPCalcHistInvoker
&
operator
=
(
const
IPPCalcHistInvoker
&
);
};
#endif
}
void
cv
::
calcHist
(
const
Mat
*
images
,
int
nimages
,
const
int
*
channels
,
...
...
@@ -1190,6 +1232,32 @@ void cv::calcHist( const Mat* images, int nimages, const int* channels,
Mat
hist
=
_hist
.
getMat
(),
ihist
=
hist
;
ihist
.
flags
=
(
ihist
.
flags
&
~
CV_MAT_TYPE_MASK
)
|
CV_32S
;
#if defined HAVE_IPP && !defined HAVE_IPP_ICV_ONLY
if
(
nimages
==
1
&&
images
[
0
].
type
()
==
CV_8UC1
&&
dims
==
1
&&
channels
&&
channels
[
0
]
==
0
&&
mask
.
empty
()
&&
images
[
0
].
dims
<=
2
&&
!
accumulate
&&
uniform
)
{
ihist
.
setTo
(
Scalar
::
all
(
0
));
AutoBuffer
<
Ipp32s
>
levels
(
histSize
[
0
]
+
1
);
bool
ok
=
true
;
const
Mat
&
src
=
images
[
0
];
int
nstripes
=
std
::
min
<
int
>
(
8
,
src
.
total
()
/
(
1
<<
16
));
#ifdef HAVE_CONCURRENCY
nstripes
=
1
;
#endif
IPPCalcHistInvoker
invoker
(
src
,
ihist
,
levels
,
histSize
[
0
]
+
1
,
(
Ipp32s
)
ranges
[
0
][
0
],
(
Ipp32s
)
ranges
[
0
][
1
],
&
ok
);
Range
range
(
0
,
src
.
rows
);
parallel_for_
(
range
,
invoker
,
nstripes
);
if
(
ok
)
{
ihist
.
convertTo
(
hist
,
CV_32F
);
return
;
}
}
#endif
if
(
!
accumulate
||
histdata
!=
hist
.
data
)
hist
=
Scalar
(
0.
);
else
...
...
@@ -1477,7 +1545,7 @@ void cv::calcHist( InputArrayOfArrays images, const std::vector<int>& channels,
CV_OCL_RUN
(
images
.
total
()
==
1
&&
channels
.
size
()
==
1
&&
images
.
channels
(
0
)
==
1
&&
channels
[
0
]
==
0
&&
images
.
isUMatVector
()
&&
mask
.
empty
()
&&
!
accumulate
&&
histSize
.
size
()
==
1
&&
histSize
[
0
]
==
BINS
&&
ranges
.
size
()
==
2
&&
ranges
[
0
]
==
0
&&
ranges
[
1
]
==
256
,
ranges
[
0
]
==
0
&&
ranges
[
1
]
==
BINS
,
ocl_calcHist
(
images
,
hist
))
int
i
,
dims
=
(
int
)
histSize
.
size
(),
rsz
=
(
int
)
ranges
.
size
(),
csz
=
(
int
)
channels
.
size
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录