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
0ac934d0
Commit
0ac934d0
authored
Nov 14, 2016
by
Rostislav Vasilikhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added OpenVX call to equalizeHist() function
parent
90b52cd9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
0 deletions
+52
-0
histogram.cpp
modules/imgproc/src/histogram.cpp
+52
-0
No files found.
modules/imgproc/src/histogram.cpp
View file @
0ac934d0
...
...
@@ -42,6 +42,12 @@
#include "precomp.hpp"
#include "opencl_kernels_imgproc.hpp"
#ifdef HAVE_OPENVX
#define IVX_USE_OPENCV
#define IVX_HIDE_INFO_WARNINGS
#include "ivx.hpp"
#endif
namespace
cv
{
...
...
@@ -3700,6 +3706,45 @@ static bool ocl_equalizeHist(InputArray _src, OutputArray _dst)
#endif
#ifdef HAVE_OPENVX
namespace
cv
{
static
bool
openvx_equalize_hist
(
Mat
srcMat
,
Mat
dstMat
)
{
using
namespace
ivx
;
try
{
Context
context
=
Context
::
create
();
Image
srcImage
=
Image
::
createFromHandle
(
context
,
Image
::
matTypeToFormat
(
srcMat
.
type
()),
Image
::
createAddressing
(
srcMat
),
srcMat
.
data
);
Image
dstImage
=
Image
::
createFromHandle
(
context
,
Image
::
matTypeToFormat
(
dstMat
.
type
()),
Image
::
createAddressing
(
dstMat
),
dstMat
.
data
);
IVX_CHECK_STATUS
(
vxuEqualizeHist
(
context
,
srcImage
,
dstImage
));
#ifdef VX_VERSION_1_1
//we should take user memory back before release
//(it's not done automatically according to standard)
srcImage
.
swapHandle
();
dstImage
.
swapHandle
();
#endif
}
catch
(
RuntimeError
&
e
)
{
CV_Error
(
CV_StsInternal
,
e
.
what
());
return
false
;
}
catch
(
WrapperError
&
e
)
{
CV_Error
(
CV_StsInternal
,
e
.
what
());
return
false
;
}
return
true
;
}
}
#endif
void
cv
::
equalizeHist
(
InputArray
_src
,
OutputArray
_dst
)
{
CV_INSTRUMENT_REGION
()
...
...
@@ -3716,6 +3761,13 @@ void cv::equalizeHist( InputArray _src, OutputArray _dst )
_dst
.
create
(
src
.
size
(),
src
.
type
()
);
Mat
dst
=
_dst
.
getMat
();
#ifdef HAVE_OPENVX
if
(
openvx_equalize_hist
(
src
,
dst
))
{
return
;
}
#endif
Mutex
histogramLockInstance
;
const
int
hist_sz
=
EqualizeHistCalcHist_Invoker
::
HIST_SZ
;
...
...
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