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
44ec450b
Commit
44ec450b
authored
Apr 25, 2013
by
Vladislav Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
switched to Input/Output Array in gpu::addWeighted
parent
ec70282b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
gpuarithm.hpp
modules/gpuarithm/include/opencv2/gpuarithm.hpp
+2
-2
element_operations.cpp
modules/gpuarithm/src/element_operations.cpp
+7
-3
No files found.
modules/gpuarithm/include/opencv2/gpuarithm.hpp
View file @
44ec450b
...
...
@@ -122,11 +122,11 @@ CV_EXPORTS void min(InputArray src1, InputArray src2, OutputArray dst, Stream& s
CV_EXPORTS
void
max
(
InputArray
src1
,
InputArray
src2
,
OutputArray
dst
,
Stream
&
stream
=
Stream
::
Null
());
//! computes the weighted sum of two arrays (dst = alpha*src1 + beta*src2 + gamma)
CV_EXPORTS
void
addWeighted
(
const
GpuMat
&
src1
,
double
alpha
,
const
GpuMat
&
src2
,
double
beta
,
double
gamma
,
GpuMat
&
dst
,
CV_EXPORTS
void
addWeighted
(
InputArray
src1
,
double
alpha
,
InputArray
src2
,
double
beta
,
double
gamma
,
OutputArray
dst
,
int
dtype
=
-
1
,
Stream
&
stream
=
Stream
::
Null
());
//! adds scaled array to another one (dst = alpha*src1 + src2)
static
inline
void
scaleAdd
(
const
GpuMat
&
src1
,
double
alpha
,
const
GpuMat
&
src2
,
GpuMat
&
dst
,
Stream
&
stream
=
Stream
::
Null
())
static
inline
void
scaleAdd
(
InputArray
src1
,
double
alpha
,
InputArray
src2
,
OutputArray
dst
,
Stream
&
stream
=
Stream
::
Null
())
{
addWeighted
(
src1
,
alpha
,
src2
,
1.0
,
0.0
,
dst
,
-
1
,
stream
);
}
...
...
modules/gpuarithm/src/element_operations.cpp
View file @
44ec450b
...
...
@@ -73,7 +73,7 @@ void cv::gpu::lshift(InputArray, Scalar_<int>, OutputArray, Stream&) { throw_no_
void
cv
::
gpu
::
min
(
InputArray
,
InputArray
,
OutputArray
,
Stream
&
)
{
throw_no_cuda
();
}
void
cv
::
gpu
::
max
(
InputArray
,
InputArray
,
OutputArray
,
Stream
&
)
{
throw_no_cuda
();
}
void
cv
::
gpu
::
addWeighted
(
const
GpuMat
&
,
double
,
const
GpuMat
&
,
double
,
double
,
GpuMat
&
,
int
,
Stream
&
)
{
throw_no_cuda
();
}
void
cv
::
gpu
::
addWeighted
(
InputArray
,
double
,
InputArray
,
double
,
double
,
OutputArray
,
int
,
Stream
&
)
{
throw_no_cuda
();
}
double
cv
::
gpu
::
threshold
(
const
GpuMat
&
,
GpuMat
&
,
double
,
double
,
int
,
Stream
&
)
{
throw_no_cuda
();
return
0.0
;}
...
...
@@ -2427,7 +2427,7 @@ namespace arithm
void
addWeighted
(
PtrStepSzb
src1
,
double
alpha
,
PtrStepSzb
src2
,
double
beta
,
double
gamma
,
PtrStepSzb
dst
,
cudaStream_t
stream
);
}
void
cv
::
gpu
::
addWeighted
(
const
GpuMat
&
src1
,
double
alpha
,
const
GpuMat
&
src2
,
double
beta
,
double
gamma
,
GpuMat
&
dst
,
int
ddepth
,
Stream
&
stream
)
void
cv
::
gpu
::
addWeighted
(
InputArray
_src1
,
double
alpha
,
InputArray
_src2
,
double
beta
,
double
gamma
,
OutputArray
_
dst
,
int
ddepth
,
Stream
&
stream
)
{
typedef
void
(
*
func_t
)(
PtrStepSzb
src1
,
double
alpha
,
PtrStepSzb
src2
,
double
beta
,
double
gamma
,
PtrStepSzb
dst
,
cudaStream_t
stream
);
static
const
func_t
funcs
[
7
][
7
][
7
]
=
...
...
@@ -2889,6 +2889,9 @@ void cv::gpu::addWeighted(const GpuMat& src1, double alpha, const GpuMat& src2,
}
};
GpuMat
src1
=
_src1
.
getGpuMat
();
GpuMat
src2
=
_src2
.
getGpuMat
();
int
sdepth1
=
src1
.
depth
();
int
sdepth2
=
src2
.
depth
();
ddepth
=
ddepth
>=
0
?
CV_MAT_DEPTH
(
ddepth
)
:
std
::
max
(
sdepth1
,
sdepth2
);
...
...
@@ -2903,7 +2906,8 @@ void cv::gpu::addWeighted(const GpuMat& src1, double alpha, const GpuMat& src2,
CV_Error
(
cv
::
Error
::
StsUnsupportedFormat
,
"The device doesn't support double"
);
}
dst
.
create
(
src1
.
size
(),
CV_MAKE_TYPE
(
ddepth
,
cn
));
_dst
.
create
(
src1
.
size
(),
CV_MAKE_TYPE
(
ddepth
,
cn
));
GpuMat
dst
=
_dst
.
getGpuMat
();
PtrStepSzb
src1_
(
src1
.
rows
,
src1
.
cols
*
cn
,
src1
.
data
,
src1
.
step
);
PtrStepSzb
src2_
(
src1
.
rows
,
src1
.
cols
*
cn
,
src2
.
data
,
src2
.
step
);
...
...
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