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
6dbb32a0
Commit
6dbb32a0
authored
Aug 26, 2013
by
Vladislav Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
switched to new device layer in split/merge
parent
3ab7f4b2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
111 deletions
+0
-111
core.cpp
modules/cudaarithm/src/core.cpp
+0
-111
split_merge.cu
modules/cudaarithm/src/cuda/split_merge.cu
+0
-0
split_merge.hpp
modules/cudev/include/opencv2/cudev/grid/split_merge.hpp
+0
-0
No files found.
modules/cudaarithm/src/core.cpp
View file @
6dbb32a0
...
...
@@ -63,117 +63,6 @@ void cv::cuda::copyMakeBorder(InputArray, OutputArray, int, int, int, int, int,
#else
/* !defined (HAVE_CUDA) */
////////////////////////////////////////////////////////////////////////
// merge/split
namespace
cv
{
namespace
cuda
{
namespace
device
{
namespace
split_merge
{
void
merge
(
const
PtrStepSzb
*
src
,
PtrStepSzb
&
dst
,
int
total_channels
,
size_t
elem_size
,
const
cudaStream_t
&
stream
);
void
split
(
const
PtrStepSzb
&
src
,
PtrStepSzb
*
dst
,
int
num_channels
,
size_t
elem_size1
,
const
cudaStream_t
&
stream
);
}
}}}
namespace
{
void
merge_caller
(
const
GpuMat
*
src
,
size_t
n
,
OutputArray
_dst
,
Stream
&
stream
)
{
CV_Assert
(
src
!=
0
);
CV_Assert
(
n
>
0
&&
n
<=
4
);
const
int
depth
=
src
[
0
].
depth
();
const
Size
size
=
src
[
0
].
size
();
for
(
size_t
i
=
0
;
i
<
n
;
++
i
)
{
CV_Assert
(
src
[
i
].
size
()
==
size
);
CV_Assert
(
src
[
i
].
depth
()
==
depth
);
CV_Assert
(
src
[
i
].
channels
()
==
1
);
}
if
(
depth
==
CV_64F
)
{
if
(
!
deviceSupports
(
NATIVE_DOUBLE
))
CV_Error
(
cv
::
Error
::
StsUnsupportedFormat
,
"The device doesn't support double"
);
}
if
(
n
==
1
)
{
src
[
0
].
copyTo
(
_dst
,
stream
);
}
else
{
_dst
.
create
(
size
,
CV_MAKE_TYPE
(
depth
,
(
int
)
n
));
GpuMat
dst
=
_dst
.
getGpuMat
();
PtrStepSzb
src_as_devmem
[
4
];
for
(
size_t
i
=
0
;
i
<
n
;
++
i
)
src_as_devmem
[
i
]
=
src
[
i
];
PtrStepSzb
dst_as_devmem
(
dst
);
cv
::
cuda
::
device
::
split_merge
::
merge
(
src_as_devmem
,
dst_as_devmem
,
(
int
)
n
,
CV_ELEM_SIZE
(
depth
),
StreamAccessor
::
getStream
(
stream
));
}
}
void
split_caller
(
const
GpuMat
&
src
,
GpuMat
*
dst
,
Stream
&
stream
)
{
CV_Assert
(
dst
!=
0
);
const
int
depth
=
src
.
depth
();
const
int
num_channels
=
src
.
channels
();
CV_Assert
(
num_channels
<=
4
);
if
(
depth
==
CV_64F
)
{
if
(
!
deviceSupports
(
NATIVE_DOUBLE
))
CV_Error
(
cv
::
Error
::
StsUnsupportedFormat
,
"The device doesn't support double"
);
}
if
(
num_channels
==
1
)
{
src
.
copyTo
(
dst
[
0
],
stream
);
return
;
}
for
(
int
i
=
0
;
i
<
num_channels
;
++
i
)
dst
[
i
].
create
(
src
.
size
(),
depth
);
PtrStepSzb
dst_as_devmem
[
4
];
for
(
int
i
=
0
;
i
<
num_channels
;
++
i
)
dst_as_devmem
[
i
]
=
dst
[
i
];
PtrStepSzb
src_as_devmem
(
src
);
cv
::
cuda
::
device
::
split_merge
::
split
(
src_as_devmem
,
dst_as_devmem
,
num_channels
,
src
.
elemSize1
(),
StreamAccessor
::
getStream
(
stream
));
}
}
void
cv
::
cuda
::
merge
(
const
GpuMat
*
src
,
size_t
n
,
OutputArray
dst
,
Stream
&
stream
)
{
merge_caller
(
src
,
n
,
dst
,
stream
);
}
void
cv
::
cuda
::
merge
(
const
std
::
vector
<
GpuMat
>&
src
,
OutputArray
dst
,
Stream
&
stream
)
{
merge_caller
(
&
src
[
0
],
src
.
size
(),
dst
,
stream
);
}
void
cv
::
cuda
::
split
(
InputArray
_src
,
GpuMat
*
dst
,
Stream
&
stream
)
{
GpuMat
src
=
_src
.
getGpuMat
();
split_caller
(
src
,
dst
,
stream
);
}
void
cv
::
cuda
::
split
(
InputArray
_src
,
std
::
vector
<
GpuMat
>&
dst
,
Stream
&
stream
)
{
GpuMat
src
=
_src
.
getGpuMat
();
dst
.
resize
(
src
.
channels
());
if
(
src
.
channels
()
>
0
)
split_caller
(
src
,
&
dst
[
0
],
stream
);
}
////////////////////////////////////////////////////////////////////////
// transpose
...
...
modules/cudaarithm/src/cuda/split_merge.cu
View file @
6dbb32a0
This diff is collapsed.
Click to expand it.
modules/cudev/include/opencv2/cudev/grid/split_merge.hpp
View file @
6dbb32a0
This diff is collapsed.
Click to expand it.
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