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
a5910ac0
Commit
a5910ac0
authored
Sep 24, 2010
by
Anatoly Baksheev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modified according to NPP for CUDA 3.2 API updates.
parent
a8161b78
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
26 deletions
+33
-26
gpu.hpp
modules/gpu/include/opencv2/gpu/gpu.hpp
+3
-4
arithm.cpp
modules/gpu/src/arithm.cpp
+11
-4
error.cpp
modules/gpu/src/error.cpp
+16
-5
precomp.cpp
modules/gpu/src/precomp.cpp
+2
-13
precomp.hpp
modules/gpu/src/precomp.hpp
+1
-0
No files found.
modules/gpu/include/opencv2/gpu/gpu.hpp
View file @
a5910ac0
...
...
@@ -372,6 +372,7 @@ namespace cv
//! computes norm of array
//! Supports NORM_INF, NORM_L1, NORM_L2
CV_EXPORTS
double
norm
(
const
GpuMat
&
src1
,
int
normType
=
NORM_L2
);
//! computes norm of the difference between two arrays
//! Supports NORM_INF, NORM_L1, NORM_L2
CV_EXPORTS
double
norm
(
const
GpuMat
&
src1
,
const
GpuMat
&
src2
,
int
normType
=
NORM_L2
);
...
...
@@ -475,11 +476,9 @@ namespace cv
//! smooths the image using the normalized box filter
CV_EXPORTS
void
boxFilter
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
Size
ksize
,
Point
anchor
=
Point
(
-
1
,
-
1
));
//! a synonym for normalized box filter
static
inline
void
blur
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
Size
ksize
,
Point
anchor
=
Point
(
-
1
,
-
1
))
{
boxFilter
(
src
,
dst
,
ksize
,
anchor
);
}
static
inline
void
blur
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
Size
ksize
,
Point
anchor
=
Point
(
-
1
,
-
1
))
{
boxFilter
(
src
,
dst
,
ksize
,
anchor
);
}
//! erodes the image (applies the local minimum operator)
CV_EXPORTS
void
erode
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
const
Mat
&
kernel
,
Point
anchor
,
int
iterations
);
...
...
modules/gpu/src/arithm.cpp
View file @
a5910ac0
...
...
@@ -310,18 +310,25 @@ Scalar cv::gpu::sum(const GpuMat& src)
CV_Assert
(
src
.
type
()
==
CV_8UC1
||
src
.
type
()
==
CV_8UC4
);
Scalar
res
;
NppiSize
sz
;
sz
.
width
=
src
.
cols
;
sz
.
height
=
src
.
rows
;
int
bufsz
;
if
(
src
.
type
()
==
CV_8UC1
)
{
nppSafeCall
(
nppiSum_8u_C1R
(
src
.
ptr
<
Npp8u
>
(),
src
.
step
,
sz
,
res
.
val
)
);
{
nppiReductionGetBufferHostSize_8u_C1R
(
sz
,
&
bufsz
);
GpuMat
buf
(
1
,
bufsz
,
CV_32S
);
nppSafeCall
(
nppiSum_8u_C1R
(
src
.
ptr
<
Npp8u
>
(),
src
.
step
,
sz
,
buf
.
ptr
<
Npp32s
>
(),
res
.
val
)
);
}
else
{
nppSafeCall
(
nppiSum_8u_C4R
(
src
.
ptr
<
Npp8u
>
(),
src
.
step
,
sz
,
res
.
val
)
);
{
nppiReductionGetBufferHostSize_8u_C4R
(
sz
,
&
bufsz
);
GpuMat
buf
(
1
,
bufsz
,
CV_32S
);
nppSafeCall
(
nppiSum_8u_C4R
(
src
.
ptr
<
Npp8u
>
(),
src
.
step
,
sz
,
buf
.
ptr
<
Npp32s
>
(),
res
.
val
)
);
}
return
res
;
...
...
modules/gpu/src/
npp_
error.cpp
→
modules/gpu/src/error.cpp
View file @
a5910ac0
...
...
@@ -42,6 +42,7 @@
#include "precomp.hpp"
using
namespace
cv
;
using
namespace
cv
::
gpu
;
...
...
@@ -56,7 +57,7 @@ namespace
struct
NppError
{
int
error
;
const
char
*
str
;
string
str
;
}
npp_errors
[]
=
{
...
...
@@ -95,8 +96,9 @@ namespace
{
NPP_WRONG_INTERSECTION_QUAD_WARNING
,
"NPP_WRONG_INTERSECTION_QUAD_WARNING"
},
{
NPP_MISALIGNED_DST_ROI_WARNING
,
"NPP_MISALIGNED_DST_ROI_WARNING"
},
{
NPP_AFFINE_QUAD_INCORRECT_WARNING
,
"NPP_AFFINE_QUAD_INCORRECT_WARNING"
},
{
NPP_AFFINE_QUAD_CHANGED_WARNING
,
"NPP_AFFINE_QUAD_CHANGED_WARNING"
},
{
NPP_ADJUSTED_ROI_SIZE_WARNING
,
"NPP_ADJUSTED_ROI_SIZE_WARNING"
},
//disabled in NPP for cuda 3.2-rc
//{ NPP_AFFINE_QUAD_CHANGED_WARNING, "NPP_AFFINE_QUAD_CHANGED_WARNING" },
//{ NPP_ADJUSTED_ROI_SIZE_WARNING, "NPP_ADJUSTED_ROI_SIZE_WARNING" },
{
NPP_DOUBLE_SIZE_WARNING
,
"NPP_DOUBLE_SIZE_WARNING"
},
{
NPP_ODD_ROI_WARNING
,
"NPP_ODD_ROI_WARNING"
}
};
...
...
@@ -116,17 +118,26 @@ namespace cv
{
namespace
gpu
{
extern
"C"
const
char
*
getNppErrorString
(
int
err
)
const
string
getNppErrorString
(
int
err
)
{
int
idx
=
std
::
find_if
(
npp_errors
,
npp_errors
+
error_num
,
Searcher
(
err
))
-
npp_errors
;
const
string
&
msg
=
(
idx
!=
error_num
)
?
npp_errors
[
idx
].
str
:
string
(
"Unknown error code"
);
std
::
stringstream
interpreter
;
interpreter
<<
"<"
<<
err
<<
"> "
<<
msg
;
return
(
idx
!=
error_num
)
?
npp_errors
[
idx
].
str
:
""
;
return
interpreter
.
str
();
}
extern
"C"
void
npp_error
(
int
err
,
const
char
*
file
,
const
int
line
,
const
char
*
func
)
{
cv
::
error
(
cv
::
Exception
(
CV_GpuNppCallError
,
getNppErrorString
(
err
),
func
,
file
,
line
)
);
}
extern
"C"
void
error
(
const
char
*
error_string
,
const
char
*
file
,
const
int
line
,
const
char
*
func
)
{
cv
::
error
(
cv
::
Exception
(
CV_GpuApiCallError
,
error_string
,
func
,
file
,
line
)
);
}
}
}
...
...
modules/gpu/src/precomp.cpp
View file @
a5910ac0
...
...
@@ -41,16 +41,4 @@
#include "precomp.hpp"
/* End of file. */
namespace
cv
{
namespace
gpu
{
extern
"C"
void
error
(
const
char
*
error_string
,
const
char
*
file
,
const
int
line
,
const
char
*
func
)
{
cv
::
error
(
cv
::
Exception
(
CV_GpuApiCallError
,
error_string
,
func
,
file
,
line
)
);
}
}
}
/* End of file. */
\ No newline at end of file
modules/gpu/src/precomp.hpp
View file @
a5910ac0
...
...
@@ -54,6 +54,7 @@
#include <limits>
#include <vector>
#include <algorithm>
#include <sstream>
#include "opencv2/gpu/gpu.hpp"
#include "opencv2/imgproc/imgproc.hpp"
...
...
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