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
a4e598f4
Commit
a4e598f4
authored
Dec 24, 2014
by
Vladislav Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use new BufferPool class for some cudaarithm routines
parent
7454189c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
14 deletions
+28
-14
arithm.cpp
modules/cudaarithm/src/arithm.cpp
+11
-4
integral.cu
modules/cudaarithm/src/cuda/integral.cu
+17
-10
No files found.
modules/cudaarithm/src/arithm.cpp
View file @
a4e598f4
...
...
@@ -315,13 +315,20 @@ void cv::cuda::dft(InputArray _src, OutputArray _dst, Size dft_size, int flags,
// We don't support real-to-real transform
CV_Assert
(
is_complex_input
||
is_complex_output
);
GpuMat
src_cont
=
src
;
// Make sure here we work with the continuous input,
// as CUFFT can't handle gaps
createContinuous
(
src
.
rows
,
src
.
cols
,
src
.
type
(),
src_cont
);
if
(
src_cont
.
data
!=
src
.
data
)
GpuMat
src_cont
;
if
(
src
.
isContinuous
())
{
src_cont
=
src
;
}
else
{
BufferPool
pool
(
stream
);
src_cont
.
allocator
=
pool
.
getAllocator
();
createContinuous
(
src
.
rows
,
src
.
cols
,
src
.
type
(),
src_cont
);
src
.
copyTo
(
src_cont
,
stream
);
}
Size
dft_size_opt
=
dft_size
;
if
(
is_1d_input
&&
!
is_row_dft
)
...
...
modules/cudaarithm/src/cuda/integral.cu
View file @
a4e598f4
...
...
@@ -50,51 +50,58 @@
#include "opencv2/cudaarithm.hpp"
#include "opencv2/cudev.hpp"
#include "opencv2/core/private.cuda.hpp"
using namespace cv;
using namespace cv::cuda;
using namespace cv::cudev;
////////////////////////////////////////////////////////////////////////
// integral
void cv::cuda::integral(InputArray _src, OutputArray _dst,
GpuMat& buffer,
Stream& stream)
void cv::cuda::integral(InputArray _src, OutputArray _dst, Stream& stream)
{
GpuMat src =
_src.getGpuMat(
);
GpuMat src =
getInputMat(_src, stream
);
CV_Assert( src.type() == CV_8UC1 );
GpuMat_<int>& res = (GpuMat_<int>&) buffer;
BufferPool pool(stream);
GpuMat_<int> res(src.size(), pool.getAllocator());
gridIntegral(globPtr<uchar>(src), res, stream);
_dst.create(src.rows + 1, src.cols + 1, CV_32SC1);
GpuMat dst = _dst.getGpuMat();
GpuMat dst = getOutputMat(_dst, src.rows + 1, src.cols + 1, CV_32SC1, stream);
dst.setTo(Scalar::all(0), stream);
GpuMat inner = dst(Rect(1, 1, src.cols, src.rows));
res.copyTo(inner, stream);
syncOutput(dst, _dst, stream);
}
//////////////////////////////////////////////////////////////////////////////
// sqrIntegral
void cv::cuda::sqrIntegral(InputArray _src, OutputArray _dst,
GpuMat& buf,
Stream& stream)
void cv::cuda::sqrIntegral(InputArray _src, OutputArray _dst, Stream& stream)
{
GpuMat src =
_src.getGpuMat(
);
GpuMat src =
getInputMat(_src, stream
);
CV_Assert( src.type() == CV_8UC1 );
GpuMat_<double>& res = (GpuMat_<double>&) buf;
BufferPool pool(Stream::Null());
GpuMat_<double> res(pool.getBuffer(src.size(), CV_64FC1));
gridIntegral(sqr_(cvt_<int>(globPtr<uchar>(src))), res, stream);
_dst.create(src.rows + 1, src.cols + 1, CV_64FC1);
GpuMat dst = _dst.getGpuMat();
GpuMat dst = getOutputMat(_dst, src.rows + 1, src.cols + 1, CV_64FC1, stream);
dst.setTo(Scalar::all(0), stream);
GpuMat inner = dst(Rect(1, 1, src.cols, src.rows));
res.copyTo(inner, stream);
syncOutput(dst, _dst, stream);
}
#endif
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