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
f2aa6ebe
Commit
f2aa6ebe
authored
Apr 25, 2013
by
Vladislav Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
switched to Input/Output Array in shift operations
parent
d81f54db
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
20 deletions
+26
-20
gpuarithm.hpp
modules/gpuarithm/include/opencv2/gpuarithm.hpp
+8
-8
element_operations.cpp
modules/gpuarithm/src/element_operations.cpp
+18
-12
No files found.
modules/gpuarithm/include/opencv2/gpuarithm.hpp
View file @
f2aa6ebe
...
...
@@ -107,6 +107,14 @@ CV_EXPORTS void bitwise_and(InputArray src1, InputArray src2, OutputArray dst, I
//! calculates per-element bit-wise "exclusive or" operation
CV_EXPORTS
void
bitwise_xor
(
InputArray
src1
,
InputArray
src2
,
OutputArray
dst
,
InputArray
mask
=
noArray
(),
Stream
&
stream
=
Stream
::
Null
());
//! pixel by pixel right shift of an image by a constant value
//! supports 1, 3 and 4 channels images with integers elements
CV_EXPORTS
void
rshift
(
InputArray
src
,
Scalar_
<
int
>
val
,
OutputArray
dst
,
Stream
&
stream
=
Stream
::
Null
());
//! pixel by pixel left shift of an image by a constant value
//! supports 1, 3 and 4 channels images with CV_8U, CV_16U or CV_32S depth
CV_EXPORTS
void
lshift
(
InputArray
src
,
Scalar_
<
int
>
val
,
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
,
int
dtype
=
-
1
,
Stream
&
stream
=
Stream
::
Null
());
...
...
@@ -117,14 +125,6 @@ static inline void scaleAdd(const GpuMat& src1, double alpha, const GpuMat& src2
addWeighted
(
src1
,
alpha
,
src2
,
1.0
,
0.0
,
dst
,
-
1
,
stream
);
}
//! pixel by pixel right shift of an image by a constant value
//! supports 1, 3 and 4 channels images with integers elements
CV_EXPORTS
void
rshift
(
const
GpuMat
&
src
,
Scalar_
<
int
>
sc
,
GpuMat
&
dst
,
Stream
&
stream
=
Stream
::
Null
());
//! pixel by pixel left shift of an image by a constant value
//! supports 1, 3 and 4 channels images with CV_8U, CV_16U or CV_32S depth
CV_EXPORTS
void
lshift
(
const
GpuMat
&
src
,
Scalar_
<
int
>
sc
,
GpuMat
&
dst
,
Stream
&
stream
=
Stream
::
Null
());
//! computes per-element minimum of two arrays (dst = min(src1, src2))
CV_EXPORTS
void
min
(
const
GpuMat
&
src1
,
const
GpuMat
&
src2
,
GpuMat
&
dst
,
Stream
&
stream
=
Stream
::
Null
());
...
...
modules/gpuarithm/src/element_operations.cpp
View file @
f2aa6ebe
...
...
@@ -79,9 +79,9 @@ void cv::gpu::bitwise_and(InputArray, InputArray, OutputArray, InputArray, Strea
void
cv
::
gpu
::
bitwise_xor
(
InputArray
,
InputArray
,
OutputArray
,
InputArray
,
Stream
&
)
{
throw_no_cuda
();
}
void
cv
::
gpu
::
rshift
(
const
GpuMat
&
,
Scalar_
<
int
>
,
GpuMat
&
,
Stream
&
)
{
throw_no_cuda
();
}
void
cv
::
gpu
::
rshift
(
InputArray
,
Scalar_
<
int
>
,
OutputArray
,
Stream
&
)
{
throw_no_cuda
();
}
void
cv
::
gpu
::
lshift
(
const
GpuMat
&
,
Scalar_
<
int
>
,
GpuMat
&
,
Stream
&
)
{
throw_no_cuda
();
}
void
cv
::
gpu
::
lshift
(
InputArray
,
Scalar_
<
int
>
,
OutputArray
,
Stream
&
)
{
throw_no_cuda
();
}
void
cv
::
gpu
::
min
(
const
GpuMat
&
,
const
GpuMat
&
,
GpuMat
&
,
Stream
&
)
{
throw_no_cuda
();
}
void
cv
::
gpu
::
min
(
const
GpuMat
&
,
double
,
GpuMat
&
,
Stream
&
)
{
throw_no_cuda
();
}
...
...
@@ -2213,7 +2213,7 @@ namespace
};
}
void
cv
::
gpu
::
rshift
(
const
GpuMat
&
src
,
Scalar_
<
int
>
sc
,
GpuMat
&
dst
,
Stream
&
stream
)
void
cv
::
gpu
::
rshift
(
InputArray
_src
,
Scalar_
<
int
>
val
,
OutputArray
_
dst
,
Stream
&
stream
)
{
typedef
void
(
*
func_t
)(
const
GpuMat
&
src
,
Scalar_
<
Npp32u
>
sc
,
GpuMat
&
dst
,
cudaStream_t
stream
);
static
const
func_t
funcs
[
5
][
4
]
=
...
...
@@ -2225,15 +2225,18 @@ void cv::gpu::rshift(const GpuMat& src, Scalar_<int> sc, GpuMat& dst, Stream& st
{
NppShift
<
CV_32S
,
1
,
nppiRShiftC_32s_C1R
>::
call
,
0
,
NppShift
<
CV_32S
,
3
,
nppiRShiftC_32s_C3R
>::
call
,
NppShift
<
CV_32S
,
4
,
nppiRShiftC_32s_C4R
>::
call
},
};
CV_Assert
(
src
.
depth
()
<
CV_32F
);
CV_Assert
(
src
.
channels
()
==
1
||
src
.
channels
()
==
3
||
src
.
channels
()
==
4
);
GpuMat
src
=
_src
.
getGpuMat
();
dst
.
create
(
src
.
size
(),
src
.
type
());
CV_Assert
(
src
.
depth
()
<
CV_32F
);
CV_Assert
(
src
.
channels
()
==
1
||
src
.
channels
()
==
3
||
src
.
channels
()
==
4
);
_dst
.
create
(
src
.
size
(),
src
.
type
());
GpuMat
dst
=
_dst
.
getGpuMat
();
funcs
[
src
.
depth
()][
src
.
channels
()
-
1
](
src
,
sc
,
dst
,
StreamAccessor
::
getStream
(
stream
));
funcs
[
src
.
depth
()][
src
.
channels
()
-
1
](
src
,
val
,
dst
,
StreamAccessor
::
getStream
(
stream
));
}
void
cv
::
gpu
::
lshift
(
const
GpuMat
&
src
,
Scalar_
<
int
>
sc
,
GpuMat
&
dst
,
Stream
&
stream
)
void
cv
::
gpu
::
lshift
(
InputArray
_src
,
Scalar_
<
int
>
val
,
OutputArray
_
dst
,
Stream
&
stream
)
{
typedef
void
(
*
func_t
)(
const
GpuMat
&
src
,
Scalar_
<
Npp32u
>
sc
,
GpuMat
&
dst
,
cudaStream_t
stream
);
static
const
func_t
funcs
[
5
][
4
]
=
...
...
@@ -2245,12 +2248,15 @@ void cv::gpu::lshift(const GpuMat& src, Scalar_<int> sc, GpuMat& dst, Stream& st
{
NppShift
<
CV_32S
,
1
,
nppiLShiftC_32s_C1R
>::
call
,
0
,
NppShift
<
CV_32S
,
3
,
nppiLShiftC_32s_C3R
>::
call
,
NppShift
<
CV_32S
,
4
,
nppiLShiftC_32s_C4R
>::
call
},
};
CV_Assert
(
src
.
depth
()
==
CV_8U
||
src
.
depth
()
==
CV_16U
||
src
.
depth
()
==
CV_32S
);
CV_Assert
(
src
.
channels
()
==
1
||
src
.
channels
()
==
3
||
src
.
channels
()
==
4
);
GpuMat
src
=
_src
.
getGpuMat
();
dst
.
create
(
src
.
size
(),
src
.
type
());
CV_Assert
(
src
.
depth
()
==
CV_8U
||
src
.
depth
()
==
CV_16U
||
src
.
depth
()
==
CV_32S
);
CV_Assert
(
src
.
channels
()
==
1
||
src
.
channels
()
==
3
||
src
.
channels
()
==
4
);
_dst
.
create
(
src
.
size
(),
src
.
type
());
GpuMat
dst
=
_dst
.
getGpuMat
();
funcs
[
src
.
depth
()][
src
.
channels
()
-
1
](
src
,
sc
,
dst
,
StreamAccessor
::
getStream
(
stream
));
funcs
[
src
.
depth
()][
src
.
channels
()
-
1
](
src
,
val
,
dst
,
StreamAccessor
::
getStream
(
stream
));
}
//////////////////////////////////////////////////////////////////////////////
...
...
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