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
f2df7848
Commit
f2df7848
authored
Nov 15, 2010
by
Anatoly Baksheev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed error reporting in GPU module (exceptions in destructors, etc)
parent
d7d0754f
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
134 additions
and
115 deletions
+134
-115
types_c.h
modules/core/include/opencv2/core/types_c.h
+1
-1
system.cpp
modules/core/src/system.cpp
+3
-0
gpu.hpp
modules/gpu/include/opencv2/gpu/gpu.hpp
+73
-69
error.cpp
modules/gpu/src/error.cpp
+53
-42
precomp.hpp
modules/gpu/src/precomp.hpp
+2
-1
gputest.hpp
tests/gpu/src/gputest.hpp
+2
-2
No files found.
modules/core/include/opencv2/core/types_c.h
View file @
f2df7848
...
@@ -245,7 +245,7 @@ enum {
...
@@ -245,7 +245,7 @@ enum {
CV_StsNotImplemented
=
-
213
,
/* the requested function/feature is not implemented */
CV_StsNotImplemented
=
-
213
,
/* the requested function/feature is not implemented */
CV_StsBadMemBlock
=
-
214
,
/* an allocated block has been corrupted */
CV_StsBadMemBlock
=
-
214
,
/* an allocated block has been corrupted */
CV_StsAssert
=
-
215
,
/* assertion failed */
CV_StsAssert
=
-
215
,
/* assertion failed */
CV_GpuNot
Found
=
-
216
,
CV_GpuNot
Supported
=
-
216
,
CV_GpuApiCallError
=
-
217
,
CV_GpuApiCallError
=
-
217
,
CV_GpuNppCallError
=
-
218
CV_GpuNppCallError
=
-
218
};
};
...
...
modules/core/src/system.cpp
View file @
f2df7848
...
@@ -527,6 +527,9 @@ CV_IMPL const char* cvErrorStr( int status )
...
@@ -527,6 +527,9 @@ CV_IMPL const char* cvErrorStr( int status )
case
CV_StsNotImplemented
:
return
"The function/feature is not implemented"
;
case
CV_StsNotImplemented
:
return
"The function/feature is not implemented"
;
case
CV_StsBadMemBlock
:
return
"Memory block has been corrupted"
;
case
CV_StsBadMemBlock
:
return
"Memory block has been corrupted"
;
case
CV_StsAssert
:
return
"Assertion failed"
;
case
CV_StsAssert
:
return
"Assertion failed"
;
case
CV_GpuNotSupported
:
return
"No GPU support"
;
case
CV_GpuApiCallError
:
return
"GPU API error"
;
case
CV_GpuNppCallError
:
return
"NPP API error"
;
};
};
sprintf
(
buf
,
"Unknown %s code %d"
,
status
>=
0
?
"status"
:
"error"
,
status
);
sprintf
(
buf
,
"Unknown %s code %d"
,
status
>=
0
?
"status"
:
"error"
,
status
);
...
...
modules/gpu/include/opencv2/gpu/gpu.hpp
View file @
f2df7848
...
@@ -69,7 +69,7 @@ namespace cv
...
@@ -69,7 +69,7 @@ namespace cv
CV_EXPORTS
void
getGpuMemInfo
(
size_t
&
free
,
size_t
&
total
);
CV_EXPORTS
void
getGpuMemInfo
(
size_t
&
free
,
size_t
&
total
);
//////////////////////////////// Error handling ////////////////////////
//////////////////////////////// Error handling ////////////////////////
CV_EXPORTS
void
error
(
const
char
*
error_string
,
const
char
*
file
,
const
int
line
,
const
char
*
func
);
CV_EXPORTS
void
error
(
const
char
*
error_string
,
const
char
*
file
,
const
int
line
,
const
char
*
func
);
CV_EXPORTS
void
nppError
(
int
err
,
const
char
*
file
,
const
int
line
,
const
char
*
func
);
CV_EXPORTS
void
nppError
(
int
err
,
const
char
*
file
,
const
int
line
,
const
char
*
func
);
...
@@ -83,19 +83,18 @@ namespace cv
...
@@ -83,19 +83,18 @@ namespace cv
public
:
public
:
//! default constructor
//! default constructor
GpuMat
();
GpuMat
();
//! constructs GpuMatrix of the specified size and type
//! constructs GpuMatrix of the specified size and type (_type is CV_8UC1, CV_64FC3, CV_32SC(12) etc.)
// (_type is CV_8UC1, CV_64FC3, CV_32SC(12) etc.)
GpuMat
(
int
rows
,
int
cols
,
int
type
);
GpuMat
(
int
_rows
,
int
_cols
,
int
_type
);
GpuMat
(
Size
size
,
int
type
);
GpuMat
(
Size
_size
,
int
_type
);
//! constucts GpuMatrix and fills it with the specified value _s.
//! constucts GpuMatrix and fills it with the specified value _s.
GpuMat
(
int
_rows
,
int
_cols
,
int
_type
,
const
Scalar
&
_
s
);
GpuMat
(
int
rows
,
int
cols
,
int
type
,
const
Scalar
&
s
);
GpuMat
(
Size
_size
,
int
_type
,
const
Scalar
&
_
s
);
GpuMat
(
Size
size
,
int
type
,
const
Scalar
&
s
);
//! copy constructor
//! copy constructor
GpuMat
(
const
GpuMat
&
m
);
GpuMat
(
const
GpuMat
&
m
);
//! constructor for GpuMatrix headers pointing to user-allocated data
//! constructor for GpuMatrix headers pointing to user-allocated data
GpuMat
(
int
_rows
,
int
_cols
,
int
_type
,
void
*
_data
,
size_t
_
step
=
Mat
::
AUTO_STEP
);
GpuMat
(
int
rows
,
int
cols
,
int
type
,
void
*
data
,
size_t
step
=
Mat
::
AUTO_STEP
);
GpuMat
(
Size
_size
,
int
_type
,
void
*
_data
,
size_t
_
step
=
Mat
::
AUTO_STEP
);
GpuMat
(
Size
size
,
int
type
,
void
*
data
,
size_t
step
=
Mat
::
AUTO_STEP
);
//! creates a matrix header for a part of the bigger matrix
//! creates a matrix header for a part of the bigger matrix
GpuMat
(
const
GpuMat
&
m
,
const
Range
&
rowRange
,
const
Range
&
colRange
);
GpuMat
(
const
GpuMat
&
m
,
const
Range
&
rowRange
,
const
Range
&
colRange
);
...
@@ -117,7 +116,7 @@ namespace cv
...
@@ -117,7 +116,7 @@ namespace cv
template
<
class
T
>
operator
DevMem2D_
<
T
>
()
const
;
template
<
class
T
>
operator
DevMem2D_
<
T
>
()
const
;
template
<
class
T
>
operator
PtrStep_
<
T
>
()
const
;
template
<
class
T
>
operator
PtrStep_
<
T
>
()
const
;
//! pefroms blocking upload data to GpuMat.
.
//! pefroms blocking upload data to GpuMat.
void
upload
(
const
cv
::
Mat
&
m
);
void
upload
(
const
cv
::
Mat
&
m
);
//! upload async
//! upload async
...
@@ -156,15 +155,15 @@ namespace cv
...
@@ -156,15 +155,15 @@ namespace cv
//! sets every GpuMatrix element to s
//! sets every GpuMatrix element to s
GpuMat
&
operator
=
(
const
Scalar
&
s
);
GpuMat
&
operator
=
(
const
Scalar
&
s
);
//! sets some of the GpuMatrix elements to s, according to the mask
//! sets some of the GpuMatrix elements to s, according to the mask
GpuMat
&
setTo
(
const
Scalar
&
s
,
const
GpuMat
&
mask
=
GpuMat
());
GpuMat
&
setTo
(
const
Scalar
&
s
,
const
GpuMat
&
mask
=
GpuMat
());
//! creates alternative GpuMatrix header for the same data, with different
//! creates alternative GpuMatrix header for the same data, with different
// number of channels and/or different number of rows. see cvReshape.
// number of channels and/or different number of rows. see cvReshape.
GpuMat
reshape
(
int
_cn
,
int
_rows
=
0
)
const
;
GpuMat
reshape
(
int
cn
,
int
rows
=
0
)
const
;
//! allocates new GpuMatrix data unless the GpuMatrix already has specified size and type.
//! allocates new GpuMatrix data unless the GpuMatrix already has specified size and type.
// previous data is unreferenced if needed.
// previous data is unreferenced if needed.
void
create
(
int
_rows
,
int
_cols
,
int
_
type
);
void
create
(
int
rows
,
int
cols
,
int
type
);
void
create
(
Size
_size
,
int
_
type
);
void
create
(
Size
size
,
int
type
);
//! decreases reference counter;
//! decreases reference counter;
// deallocate the data when reference counter reaches 0.
// deallocate the data when reference counter reaches 0.
void
release
();
void
release
();
...
@@ -205,12 +204,12 @@ namespace cv
...
@@ -205,12 +204,12 @@ namespace cv
bool
empty
()
const
;
bool
empty
()
const
;
//! returns pointer to y-th row
//! returns pointer to y-th row
uchar
*
ptr
(
int
y
=
0
);
uchar
*
ptr
(
int
y
=
0
);
const
uchar
*
ptr
(
int
y
=
0
)
const
;
const
uchar
*
ptr
(
int
y
=
0
)
const
;
//! template version of the above method
//! template version of the above method
template
<
typename
_Tp
>
_Tp
*
ptr
(
int
y
=
0
);
template
<
typename
_Tp
>
_Tp
*
ptr
(
int
y
=
0
);
template
<
typename
_Tp
>
const
_Tp
*
ptr
(
int
y
=
0
)
const
;
template
<
typename
_Tp
>
const
_Tp
*
ptr
(
int
y
=
0
)
const
;
//! matrix transposition
//! matrix transposition
GpuMat
t
()
const
;
GpuMat
t
()
const
;
...
@@ -238,6 +237,11 @@ namespace cv
...
@@ -238,6 +237,11 @@ namespace cv
uchar
*
dataend
;
uchar
*
dataend
;
};
};
//#define TemplatedGpuMat // experimental now, deprecated to use
#ifdef TemplatedGpuMat
#include "GpuMat_BetaDeprecated.hpp"
#endif
//////////////////////////////// CudaMem ////////////////////////////////
//////////////////////////////// CudaMem ////////////////////////////////
// CudaMem is limited cv::Mat with page locked memory allocation.
// CudaMem is limited cv::Mat with page locked memory allocation.
// Page locked memory is only needed for async and faster coping to GPU.
// Page locked memory is only needed for async and faster coping to GPU.
...
@@ -252,12 +256,12 @@ namespace cv
...
@@ -252,12 +256,12 @@ namespace cv
CudaMem
();
CudaMem
();
CudaMem
(
const
CudaMem
&
m
);
CudaMem
(
const
CudaMem
&
m
);
CudaMem
(
int
_rows
,
int
_cols
,
int
_
type
,
int
_alloc_type
=
ALLOC_PAGE_LOCKED
);
CudaMem
(
int
rows
,
int
cols
,
int
type
,
int
_alloc_type
=
ALLOC_PAGE_LOCKED
);
CudaMem
(
Size
_size
,
int
_type
,
int
_
alloc_type
=
ALLOC_PAGE_LOCKED
);
CudaMem
(
Size
size
,
int
type
,
int
alloc_type
=
ALLOC_PAGE_LOCKED
);
//! creates from cv::Mat with coping data
//! creates from cv::Mat with coping data
explicit
CudaMem
(
const
Mat
&
m
,
int
_
alloc_type
=
ALLOC_PAGE_LOCKED
);
explicit
CudaMem
(
const
Mat
&
m
,
int
alloc_type
=
ALLOC_PAGE_LOCKED
);
~
CudaMem
();
~
CudaMem
();
...
@@ -267,8 +271,8 @@ namespace cv
...
@@ -267,8 +271,8 @@ namespace cv
CudaMem
clone
()
const
;
CudaMem
clone
()
const
;
//! allocates new matrix data unless the matrix already has specified size and type.
//! allocates new matrix data unless the matrix already has specified size and type.
void
create
(
int
_rows
,
int
_cols
,
int
_type
,
int
_
alloc_type
=
ALLOC_PAGE_LOCKED
);
void
create
(
int
rows
,
int
cols
,
int
type
,
int
alloc_type
=
ALLOC_PAGE_LOCKED
);
void
create
(
Size
_size
,
int
_type
,
int
_
alloc_type
=
ALLOC_PAGE_LOCKED
);
void
create
(
Size
size
,
int
type
,
int
alloc_type
=
ALLOC_PAGE_LOCKED
);
//! decrements reference counter and released memory if needed.
//! decrements reference counter and released memory if needed.
void
release
();
void
release
();
...
@@ -362,30 +366,30 @@ namespace cv
...
@@ -362,30 +366,30 @@ namespace cv
CV_EXPORTS
void
add
(
const
GpuMat
&
a
,
const
Scalar
&
sc
,
GpuMat
&
c
);
CV_EXPORTS
void
add
(
const
GpuMat
&
a
,
const
Scalar
&
sc
,
GpuMat
&
c
);
//! subtracts one matrix from another (c = a - b)
//! subtracts one matrix from another (c = a - b)
//! supports CV_8UC1, CV_8UC4, CV_32SC1, CV_32FC1 types
//! supports CV_8UC1, CV_8UC4, CV_32SC1, CV_32FC1 types
CV_EXPORTS
void
subtract
(
const
GpuMat
&
a
,
const
GpuMat
&
b
,
GpuMat
&
c
);
CV_EXPORTS
void
subtract
(
const
GpuMat
&
a
,
const
GpuMat
&
b
,
GpuMat
&
c
);
//! subtracts scalar from a matrix (c = a - s)
//! subtracts scalar from a matrix (c = a - s)
//! supports CV_32FC1 and CV_32FC2 type
//! supports CV_32FC1 and CV_32FC2 type
CV_EXPORTS
void
subtract
(
const
GpuMat
&
a
,
const
Scalar
&
sc
,
GpuMat
&
c
);
CV_EXPORTS
void
subtract
(
const
GpuMat
&
a
,
const
Scalar
&
sc
,
GpuMat
&
c
);
//! computes element-wise product of the two arrays (c = a * b)
//! computes element-wise product of the two arrays (c = a * b)
//! supports CV_8UC1, CV_8UC4, CV_32SC1, CV_32FC1 types
//! supports CV_8UC1, CV_8UC4, CV_32SC1, CV_32FC1 types
CV_EXPORTS
void
multiply
(
const
GpuMat
&
a
,
const
GpuMat
&
b
,
GpuMat
&
c
);
CV_EXPORTS
void
multiply
(
const
GpuMat
&
a
,
const
GpuMat
&
b
,
GpuMat
&
c
);
//! multiplies matrix to a scalar (c = a * s)
//! multiplies matrix to a scalar (c = a * s)
//! supports CV_32FC1 and CV_32FC2 type
//! supports CV_32FC1 and CV_32FC2 type
CV_EXPORTS
void
multiply
(
const
GpuMat
&
a
,
const
Scalar
&
sc
,
GpuMat
&
c
);
CV_EXPORTS
void
multiply
(
const
GpuMat
&
a
,
const
Scalar
&
sc
,
GpuMat
&
c
);
//! computes element-wise quotient of the two arrays (c = a / b)
//! computes element-wise quotient of the two arrays (c = a / b)
//! supports CV_8UC1, CV_8UC4, CV_32SC1, CV_32FC1 types
//! supports CV_8UC1, CV_8UC4, CV_32SC1, CV_32FC1 types
CV_EXPORTS
void
divide
(
const
GpuMat
&
a
,
const
GpuMat
&
b
,
GpuMat
&
c
);
CV_EXPORTS
void
divide
(
const
GpuMat
&
a
,
const
GpuMat
&
b
,
GpuMat
&
c
);
//! computes element-wise quotient of matrix and scalar (c = a / s)
//! computes element-wise quotient of matrix and scalar (c = a / s)
//! supports CV_32FC1 and CV_32FC2 type
//! supports CV_32FC1 and CV_32FC2 type
CV_EXPORTS
void
divide
(
const
GpuMat
&
a
,
const
Scalar
&
sc
,
GpuMat
&
c
);
CV_EXPORTS
void
divide
(
const
GpuMat
&
a
,
const
Scalar
&
sc
,
GpuMat
&
c
);
//! transposes the matrix
//! transposes the matrix
//! supports only CV_8UC1 type
//! supports only CV_8UC1 type
CV_EXPORTS
void
transpose
(
const
GpuMat
&
src1
,
GpuMat
&
dst
);
CV_EXPORTS
void
transpose
(
const
GpuMat
&
src1
,
GpuMat
&
dst
);
//! computes element-wise absolute difference of two arrays (c = abs(a - b))
//! computes element-wise absolute difference of two arrays (c = abs(a - b))
//! supports CV_8UC1, CV_8UC4, CV_32SC1, CV_32FC1 types
//! supports CV_8UC1, CV_8UC4, CV_32SC1, CV_32FC1 types
CV_EXPORTS
void
absdiff
(
const
GpuMat
&
a
,
const
GpuMat
&
b
,
GpuMat
&
c
);
CV_EXPORTS
void
absdiff
(
const
GpuMat
&
a
,
const
GpuMat
&
b
,
GpuMat
&
c
);
//! computes element-wise absolute difference of array and scalar (c = abs(a - s))
//! computes element-wise absolute difference of array and scalar (c = abs(a - s))
//! supports only CV_32FC1 type
//! supports only CV_32FC1 type
CV_EXPORTS
void
absdiff
(
const
GpuMat
&
a
,
const
Scalar
&
s
,
GpuMat
&
c
);
CV_EXPORTS
void
absdiff
(
const
GpuMat
&
a
,
const
Scalar
&
s
,
GpuMat
&
c
);
...
@@ -402,7 +406,7 @@ namespace cv
...
@@ -402,7 +406,7 @@ namespace cv
//! supports NORM_INF, NORM_L1, NORM_L2
//! supports NORM_INF, NORM_L1, NORM_L2
//! supports only CV_8UC1 type
//! supports only CV_8UC1 type
CV_EXPORTS
double
norm
(
const
GpuMat
&
src1
,
int
normType
=
NORM_L2
);
CV_EXPORTS
double
norm
(
const
GpuMat
&
src1
,
int
normType
=
NORM_L2
);
//! computes norm of the difference between two arrays
//! computes norm of the difference between two arrays
//! supports NORM_INF, NORM_L1, NORM_L2
//! supports NORM_INF, NORM_L1, NORM_L2
//! supports only CV_8UC1 type
//! supports only CV_8UC1 type
...
@@ -454,7 +458,7 @@ namespace cv
...
@@ -454,7 +458,7 @@ namespace cv
//! computes exponent of each matrix element (b = e**a)
//! computes exponent of each matrix element (b = e**a)
//! supports only CV_32FC1 type
//! supports only CV_32FC1 type
CV_EXPORTS
void
exp
(
const
GpuMat
&
a
,
GpuMat
&
b
);
CV_EXPORTS
void
exp
(
const
GpuMat
&
a
,
GpuMat
&
b
);
//! computes natural logarithm of absolute value of each matrix element: b = log(abs(a))
//! computes natural logarithm of absolute value of each matrix element: b = log(abs(a))
//! supports only CV_32FC1 type
//! supports only CV_32FC1 type
CV_EXPORTS
void
log
(
const
GpuMat
&
a
,
GpuMat
&
b
);
CV_EXPORTS
void
log
(
const
GpuMat
&
a
,
GpuMat
&
b
);
...
@@ -472,7 +476,7 @@ namespace cv
...
@@ -472,7 +476,7 @@ namespace cv
CV_EXPORTS
void
magnitude
(
const
GpuMat
&
x
,
const
GpuMat
&
y
,
GpuMat
&
magnitude
);
CV_EXPORTS
void
magnitude
(
const
GpuMat
&
x
,
const
GpuMat
&
y
,
GpuMat
&
magnitude
);
//! Acync version
//! Acync version
CV_EXPORTS
void
magnitude
(
const
GpuMat
&
x
,
const
GpuMat
&
y
,
GpuMat
&
magnitude
,
const
Stream
&
stream
);
CV_EXPORTS
void
magnitude
(
const
GpuMat
&
x
,
const
GpuMat
&
y
,
GpuMat
&
magnitude
,
const
Stream
&
stream
);
//! computes squared magnitude of each (x(i), y(i)) vector
//! computes squared magnitude of each (x(i), y(i)) vector
//! supports only floating-point source
//! supports only floating-point source
CV_EXPORTS
void
magnitudeSqr
(
const
GpuMat
&
x
,
const
GpuMat
&
y
,
GpuMat
&
magnitude
);
CV_EXPORTS
void
magnitudeSqr
(
const
GpuMat
&
x
,
const
GpuMat
&
y
,
GpuMat
&
magnitude
);
...
@@ -496,7 +500,7 @@ namespace cv
...
@@ -496,7 +500,7 @@ namespace cv
CV_EXPORTS
void
polarToCart
(
const
GpuMat
&
magnitude
,
const
GpuMat
&
angle
,
GpuMat
&
x
,
GpuMat
&
y
,
bool
angleInDegrees
=
false
);
CV_EXPORTS
void
polarToCart
(
const
GpuMat
&
magnitude
,
const
GpuMat
&
angle
,
GpuMat
&
x
,
GpuMat
&
y
,
bool
angleInDegrees
=
false
);
//! Acync version
//! Acync version
CV_EXPORTS
void
polarToCart
(
const
GpuMat
&
magnitude
,
const
GpuMat
&
angle
,
GpuMat
&
x
,
GpuMat
&
y
,
bool
angleInDegrees
,
const
Stream
&
stream
);
CV_EXPORTS
void
polarToCart
(
const
GpuMat
&
magnitude
,
const
GpuMat
&
angle
,
GpuMat
&
x
,
GpuMat
&
y
,
bool
angleInDegrees
,
const
Stream
&
stream
);
////////////////////////////// Image processing //////////////////////////////
////////////////////////////// Image processing //////////////////////////////
//! DST[x,y] = SRC[xmap[x,y],ymap[x,y]] with bilinear interpolation.
//! DST[x,y] = SRC[xmap[x,y],ymap[x,y]] with bilinear interpolation.
...
@@ -544,7 +548,7 @@ namespace cv
...
@@ -544,7 +548,7 @@ namespace cv
//! Supports INTER_NEAREST, INTER_LINEAR
//! Supports INTER_NEAREST, INTER_LINEAR
//! supports CV_8UC1, CV_8UC4 types
//! supports CV_8UC1, CV_8UC4 types
CV_EXPORTS
void
resize
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
Size
dsize
,
double
fx
=
0
,
double
fy
=
0
,
int
interpolation
=
INTER_LINEAR
);
CV_EXPORTS
void
resize
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
Size
dsize
,
double
fx
=
0
,
double
fy
=
0
,
int
interpolation
=
INTER_LINEAR
);
//! warps the image using affine transformation
//! warps the image using affine transformation
//! Supports INTER_NEAREST, INTER_LINEAR, INTER_CUBIC
//! Supports INTER_NEAREST, INTER_LINEAR, INTER_CUBIC
CV_EXPORTS
void
warpAffine
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
const
Mat
&
M
,
Size
dsize
,
int
flags
=
INTER_LINEAR
);
CV_EXPORTS
void
warpAffine
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
const
Mat
&
M
,
Size
dsize
,
int
flags
=
INTER_LINEAR
);
...
@@ -552,16 +556,16 @@ namespace cv
...
@@ -552,16 +556,16 @@ namespace cv
//! warps the image using perspective transformation
//! warps the image using perspective transformation
//! Supports INTER_NEAREST, INTER_LINEAR, INTER_CUBIC
//! Supports INTER_NEAREST, INTER_LINEAR, INTER_CUBIC
CV_EXPORTS
void
warpPerspective
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
const
Mat
&
M
,
Size
dsize
,
int
flags
=
INTER_LINEAR
);
CV_EXPORTS
void
warpPerspective
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
const
Mat
&
M
,
Size
dsize
,
int
flags
=
INTER_LINEAR
);
//! rotate 8bit single or four channel image
//! rotate 8bit single or four channel image
//! Supports INTER_NEAREST, INTER_LINEAR, INTER_CUBIC
//! Supports INTER_NEAREST, INTER_LINEAR, INTER_CUBIC
//! supports CV_8UC1, CV_8UC4 types
//! supports CV_8UC1, CV_8UC4 types
CV_EXPORTS
void
rotate
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
Size
dsize
,
double
angle
,
double
xShift
=
0
,
double
yShift
=
0
,
int
interpolation
=
INTER_LINEAR
);
CV_EXPORTS
void
rotate
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
Size
dsize
,
double
angle
,
double
xShift
=
0
,
double
yShift
=
0
,
int
interpolation
=
INTER_LINEAR
);
//! copies 2D array to a larger destination array and pads borders with user-specifiable constant
//! copies 2D array to a larger destination array and pads borders with user-specifiable constant
//! supports CV_8UC1, CV_8UC4, CV_32SC1 types
//! supports CV_8UC1, CV_8UC4, CV_32SC1 types
CV_EXPORTS
void
copyMakeBorder
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
top
,
int
bottom
,
int
left
,
int
right
,
const
Scalar
&
value
=
Scalar
());
CV_EXPORTS
void
copyMakeBorder
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
top
,
int
bottom
,
int
left
,
int
right
,
const
Scalar
&
value
=
Scalar
());
//! computes the integral image and integral for the squared image
//! computes the integral image and integral for the squared image
//! sum will have CV_32S type, sqsum - CV32F type
//! sum will have CV_32S type, sqsum - CV32F type
//! supports only CV_8UC1 source type
//! supports only CV_8UC1 source type
...
@@ -580,11 +584,11 @@ namespace cv
...
@@ -580,11 +584,11 @@ namespace cv
//////////////////////////////// Filter Engine ////////////////////////////////
//////////////////////////////// Filter Engine ////////////////////////////////
/*!
/*!
The Base Class for 1D or Row-wise Filters
The Base Class for 1D or Row-wise Filters
This is the base class for linear or non-linear filters that process 1D data.
This is the base class for linear or non-linear filters that process 1D data.
In particular, such filters are used for the "horizontal" filtering parts in separable filters.
In particular, such filters are used for the "horizontal" filtering parts in separable filters.
*/
*/
class
CV_EXPORTS
BaseRowFilter_GPU
class
CV_EXPORTS
BaseRowFilter_GPU
{
{
public
:
public
:
...
@@ -595,11 +599,11 @@ namespace cv
...
@@ -595,11 +599,11 @@ namespace cv
};
};
/*!
/*!
The Base Class for Column-wise Filters
The Base Class for Column-wise Filters
This is the base class for linear or non-linear filters that process columns of 2D arrays.
This is the base class for linear or non-linear filters that process columns of 2D arrays.
Such filters are used for the "vertical" filtering parts in separable filters.
Such filters are used for the "vertical" filtering parts in separable filters.
*/
*/
class
CV_EXPORTS
BaseColumnFilter_GPU
class
CV_EXPORTS
BaseColumnFilter_GPU
{
{
public
:
public
:
...
@@ -610,10 +614,10 @@ namespace cv
...
@@ -610,10 +614,10 @@ namespace cv
};
};
/*!
/*!
The Base Class for Non-Separable 2D Filters.
The Base Class for Non-Separable 2D Filters.
This is the base class for linear or non-linear 2D filters.
This is the base class for linear or non-linear 2D filters.
*/
*/
class
CV_EXPORTS
BaseFilter_GPU
class
CV_EXPORTS
BaseFilter_GPU
{
{
public
:
public
:
...
@@ -625,10 +629,10 @@ namespace cv
...
@@ -625,10 +629,10 @@ namespace cv
};
};
/*!
/*!
The Base Class for Filter Engine.
The Base Class for Filter Engine.
The class can be used to apply an arbitrary filtering operation to an image.
The class can be used to apply an arbitrary filtering operation to an image.
It contains all the necessary intermediate buffers.
It contains all the necessary intermediate buffers.
*/
*/
class
CV_EXPORTS
FilterEngine_GPU
class
CV_EXPORTS
FilterEngine_GPU
{
{
...
@@ -711,7 +715,7 @@ namespace cv
...
@@ -711,7 +715,7 @@ namespace cv
//! a synonym for normalized box filter
//! 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
,
-
1
,
ksize
,
anchor
);
}
static
inline
void
blur
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
Size
ksize
,
Point
anchor
=
Point
(
-
1
,
-
1
))
{
boxFilter
(
src
,
dst
,
-
1
,
ksize
,
anchor
);
}
//! erodes the image (applies the local minimum operator)
//! erodes the image (applies the local minimum operator)
CV_EXPORTS
void
erode
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
const
Mat
&
kernel
,
Point
anchor
=
Point
(
-
1
,
-
1
),
int
iterations
=
1
);
CV_EXPORTS
void
erode
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
const
Mat
&
kernel
,
Point
anchor
=
Point
(
-
1
,
-
1
),
int
iterations
=
1
);
...
@@ -733,7 +737,7 @@ namespace cv
...
@@ -733,7 +737,7 @@ namespace cv
//! applies the vertical or horizontal Scharr operator to the image
//! applies the vertical or horizontal Scharr operator to the image
CV_EXPORTS
void
Scharr
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
ddepth
,
int
dx
,
int
dy
,
double
scale
=
1
);
CV_EXPORTS
void
Scharr
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
ddepth
,
int
dx
,
int
dy
,
double
scale
=
1
);
//! smooths the image using Gaussian filter.
//! smooths the image using Gaussian filter.
CV_EXPORTS
void
GaussianBlur
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
Size
ksize
,
double
sigma1
,
double
sigma2
=
0
);
CV_EXPORTS
void
GaussianBlur
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
Size
ksize
,
double
sigma1
,
double
sigma2
=
0
);
...
@@ -825,9 +829,9 @@ namespace cv
...
@@ -825,9 +829,9 @@ namespace cv
//! the default constructor
//! the default constructor
explicit
StereoBeliefPropagation
(
int
ndisp
=
DEFAULT_NDISP
,
explicit
StereoBeliefPropagation
(
int
ndisp
=
DEFAULT_NDISP
,
int
iters
=
DEFAULT_ITERS
,
int
iters
=
DEFAULT_ITERS
,
int
levels
=
DEFAULT_LEVELS
,
int
levels
=
DEFAULT_LEVELS
,
int
msg_type
=
CV_32F
);
int
msg_type
=
CV_32F
);
//! the full constructor taking the number of disparities, number of BP iterations on each level,
//! the full constructor taking the number of disparities, number of BP iterations on each level,
//! number of levels, truncation of data cost, data weight,
//! number of levels, truncation of data cost, data weight,
...
@@ -836,9 +840,9 @@ namespace cv
...
@@ -836,9 +840,9 @@ namespace cv
//! DiscTerm = min(disc_single_jump * fabs(f1-f2), max_disc_term)
//! DiscTerm = min(disc_single_jump * fabs(f1-f2), max_disc_term)
//! please see paper for more details
//! please see paper for more details
StereoBeliefPropagation
(
int
ndisp
,
int
iters
,
int
levels
,
StereoBeliefPropagation
(
int
ndisp
,
int
iters
,
int
levels
,
float
max_data_term
,
float
data_weight
,
float
max_data_term
,
float
data_weight
,
float
max_disc_term
,
float
disc_single_jump
,
float
max_disc_term
,
float
disc_single_jump
,
int
msg_type
=
CV_32F
);
int
msg_type
=
CV_32F
);
//! the stereo correspondence operator. Finds the disparity for the specified rectified stereo pair,
//! the stereo correspondence operator. Finds the disparity for the specified rectified stereo pair,
//! if disparity is empty output type will be CV_16S else output type will be disparity.type().
//! if disparity is empty output type will be CV_16S else output type will be disparity.type().
...
@@ -886,18 +890,18 @@ namespace cv
...
@@ -886,18 +890,18 @@ namespace cv
//! the default constructor
//! the default constructor
explicit
StereoConstantSpaceBP
(
int
ndisp
=
DEFAULT_NDISP
,
explicit
StereoConstantSpaceBP
(
int
ndisp
=
DEFAULT_NDISP
,
int
iters
=
DEFAULT_ITERS
,
int
iters
=
DEFAULT_ITERS
,
int
levels
=
DEFAULT_LEVELS
,
int
levels
=
DEFAULT_LEVELS
,
int
nr_plane
=
DEFAULT_NR_PLANE
,
int
nr_plane
=
DEFAULT_NR_PLANE
,
int
msg_type
=
CV_32F
);
int
msg_type
=
CV_32F
);
//! the full constructor taking the number of disparities, number of BP iterations on each level,
//! the full constructor taking the number of disparities, number of BP iterations on each level,
//! number of levels, number of active disparity on the first level, truncation of data cost, data weight,
//! number of levels, number of active disparity on the first level, truncation of data cost, data weight,
//! truncation of discontinuity cost, discontinuity single jump and minimum disparity threshold
//! truncation of discontinuity cost, discontinuity single jump and minimum disparity threshold
StereoConstantSpaceBP
(
int
ndisp
,
int
iters
,
int
levels
,
int
nr_plane
,
StereoConstantSpaceBP
(
int
ndisp
,
int
iters
,
int
levels
,
int
nr_plane
,
float
max_data_term
,
float
data_weight
,
float
max_disc_term
,
float
disc_single_jump
,
float
max_data_term
,
float
data_weight
,
float
max_disc_term
,
float
disc_single_jump
,
int
min_disp_th
=
0
,
int
min_disp_th
=
0
,
int
msg_type
=
CV_32F
);
int
msg_type
=
CV_32F
);
//! the stereo correspondence operator. Finds the disparity for the specified rectified stereo pair,
//! the stereo correspondence operator. Finds the disparity for the specified rectified stereo pair,
//! if disparity is empty output type will be CV_16S else output type will be disparity.type().
//! if disparity is empty output type will be CV_16S else output type will be disparity.type().
...
...
modules/gpu/src/error.cpp
View file @
f2df7848
...
@@ -54,53 +54,54 @@ using namespace cv::gpu;
...
@@ -54,53 +54,54 @@ using namespace cv::gpu;
namespace
namespace
{
{
#define error_entry(entry) { entry, #entry }
struct
NppError
struct
NppError
{
{
int
error
;
int
error
;
string
str
;
string
str
;
}
}
npp_errors
[]
=
npp_errors
[]
=
{
{
{
NPP_NOT_SUPPORTED_MODE_ERROR
,
"NPP_NOT_SUPPORTED_MODE_ERROR"
},
error_entry
(
NPP_NOT_SUPPORTED_MODE_ERROR
),
{
NPP_ROUND_MODE_NOT_SUPPORTED_ERROR
,
"NPP_ROUND_MODE_NOT_SUPPORTED_ERROR"
},
error_entry
(
NPP_ROUND_MODE_NOT_SUPPORTED_ERROR
),
{
NPP_RESIZE_NO_OPERATION_ERROR
,
"NPP_RESIZE_NO_OPERATION_ERROR"
},
error_entry
(
NPP_RESIZE_NO_OPERATION_ERROR
),
{
NPP_BAD_ARG_ERROR
,
"NPP_BAD_ARG_ERROR"
},
error_entry
(
NPP_NOT_SUFFICIENT_COMPUTE_CAPABILITY
),
{
NPP_LUT_NUMBER_OF_LEVELS_ERROR
,
"NPP_LUT_NUMBER_OF_LEVELS_ERROR"
},
error_entry
(
NPP_BAD_ARG_ERROR
),
{
NPP_TEXTURE_BIND_ERROR
,
"NPP_TEXTURE_BIND_ERROR"
},
error_entry
(
NPP_LUT_NUMBER_OF_LEVELS_ERROR
),
{
NPP_COEFF_ERROR
,
"NPP_COEFF_ERROR"
},
error_entry
(
NPP_TEXTURE_BIND_ERROR
),
{
NPP_RECT_ERROR
,
"NPP_RECT_ERROR"
},
error_entry
(
NPP_COEFF_ERROR
),
{
NPP_QUAD_ERROR
,
"NPP_QUAD_ERROR"
},
error_entry
(
NPP_RECT_ERROR
),
{
NPP_WRONG_INTERSECTION_ROI_ERROR
,
"NPP_WRONG_INTERSECTION_ROI_ERROR"
},
error_entry
(
NPP_QUAD_ERROR
),
{
NPP_NOT_EVEN_STEP_ERROR
,
"NPP_NOT_EVEN_STEP_ERROR"
},
error_entry
(
NPP_WRONG_INTERSECTION_ROI_ERROR
),
{
NPP_INTERPOLATION_ERROR
,
"NPP_INTERPOLATION_ERROR"
},
error_entry
(
NPP_NOT_EVEN_STEP_ERROR
),
{
NPP_RESIZE_FACTOR_ERROR
,
"NPP_RESIZE_FACTOR_ERROR"
},
error_entry
(
NPP_INTERPOLATION_ERROR
),
{
NPP_HAAR_CLASSIFIER_PIXEL_MATCH_ERROR
,
"NPP_HAAR_CLASSIFIER_PIXEL_MATCH_ERROR"
},
error_entry
(
NPP_RESIZE_FACTOR_ERROR
),
{
NPP_MEMFREE_ERR
,
"NPP_MEMFREE_ERR"
},
error_entry
(
NPP_HAAR_CLASSIFIER_PIXEL_MATCH_ERROR
),
{
NPP_MEMSET_ERR
,
"NPP_MEMSET_ERR"
},
error_entry
(
NPP_MEMFREE_ERR
),
{
NPP_MEMCPY_ERROR
,
"NPP_MEMCPY_ERROR"
},
error_entry
(
NPP_MEMSET_ERR
),
{
NPP_MEM_ALLOC_ERR
,
"NPP_MEM_ALLOC_ERR"
},
error_entry
(
NPP_MEMCPY_ERROR
),
{
NPP_HISTO_NUMBER_OF_LEVELS_ERROR
,
"NPP_HISTO_NUMBER_OF_LEVELS_ERROR"
},
error_entry
(
NPP_MEM_ALLOC_ERR
),
{
NPP_MIRROR_FLIP_ERR
,
"NPP_MIRROR_FLIP_ERR"
},
error_entry
(
NPP_HISTO_NUMBER_OF_LEVELS_ERROR
),
{
NPP_INVALID_INPUT
,
"NPP_INVALID_INPUT"
},
error_entry
(
NPP_MIRROR_FLIP_ERR
),
{
NPP_ALIGNMENT_ERROR
,
"NPP_ALIGNMENT_ERROR"
},
error_entry
(
NPP_INVALID_INPUT
),
{
NPP_STEP_ERROR
,
"NPP_STEP_ERROR"
},
error_entry
(
NPP_ALIGNMENT_ERROR
),
{
NPP_SIZE_ERROR
,
"NPP_SIZE_ERROR"
},
error_entry
(
NPP_STEP_ERROR
),
{
NPP_POINTER_ERROR
,
"NPP_POINTER_ERROR"
},
error_entry
(
NPP_SIZE_ERROR
),
{
NPP_NULL_POINTER_ERROR
,
"NPP_NULL_POINTER_ERROR"
},
error_entry
(
NPP_POINTER_ERROR
),
{
NPP_CUDA_KERNEL_EXECUTION_ERROR
,
"NPP_CUDA_KERNEL_EXECUTION_ERROR"
},
error_entry
(
NPP_NULL_POINTER_ERROR
),
{
NPP_NOT_IMPLEMENTED_ERROR
,
"NPP_NOT_IMPLEMENTED_ERROR"
},
error_entry
(
NPP_CUDA_KERNEL_EXECUTION_ERROR
),
{
NPP_ERROR
,
"NPP_ERROR"
},
error_entry
(
NPP_NOT_IMPLEMENTED_ERROR
),
{
NPP_NO_ERROR
,
"NPP_NO_ERROR"
},
error_entry
(
NPP_ERROR
),
{
NPP_SUCCESS
,
"NPP_SUCCESS"
},
error_entry
(
NPP_NO_ERROR
),
{
NPP_WARNING
,
"NPP_WARNING"
},
error_entry
(
NPP_SUCCESS
),
{
NPP_WRONG_INTERSECTION_QUAD_WARNING
,
"NPP_WRONG_INTERSECTION_QUAD_WARNING"
},
error_entry
(
NPP_WARNING
),
{
NPP_MISALIGNED_DST_ROI_WARNING
,
"NPP_MISALIGNED_DST_ROI_WARNING"
},
error_entry
(
NPP_WRONG_INTERSECTION_QUAD_WARNING
),
{
NPP_AFFINE_QUAD_INCORRECT_WARNING
,
"NPP_AFFINE_QUAD_INCORRECT_WARNING"
},
error_entry
(
NPP_MISALIGNED_DST_ROI_WARNING
),
//disabled in NPP for cuda 3.2-rc
error_entry
(
NPP_AFFINE_QUAD_INCORRECT_WARNING
),
//{ NPP_AFFINE_QUAD_CHANGED_WARNING, "NPP_AFFINE_QUAD_CHANGED_WARNING" },
error_entry
(
NPP_DOUBLE_SIZE_WARNING
),
//{ NPP_ADJUSTED_ROI_SIZE_WARNING, "NPP_ADJUSTED_ROI_SIZE_WARNING" },
error_entry
(
NPP_ODD_ROI_WARNING
)
{
NPP_DOUBLE_SIZE_WARNING
,
"NPP_DOUBLE_SIZE_WARNING"
},
{
NPP_ODD_ROI_WARNING
,
"NPP_ODD_ROI_WARNING"
}
};
};
int
error_num
=
sizeof
(
npp_errors
)
/
sizeof
(
npp_errors
[
0
]);
int
error_num
=
sizeof
(
npp_errors
)
/
sizeof
(
npp_errors
[
0
]);
...
@@ -136,8 +137,18 @@ namespace cv
...
@@ -136,8 +137,18 @@ namespace cv
void
error
(
const
char
*
error_string
,
const
char
*
file
,
const
int
line
,
const
char
*
func
)
void
error
(
const
char
*
error_string
,
const
char
*
file
,
const
int
line
,
const
char
*
func
)
{
{
//if (uncaught_exception())
int
code
=
CV_GpuApiCallError
;
cv
::
error
(
cv
::
Exception
(
CV_GpuApiCallError
,
error_string
,
func
,
file
,
line
)
);
if
(
std
::
uncaught_exception
())
{
const
char
*
errorStr
=
cvErrorStr
(
code
);
const
char
*
function
=
func
?
func
:
"unknown function"
;
std
::
cerr
<<
"OpenCV Error: "
<<
errorStr
<<
"("
<<
error_string
<<
") in "
<<
function
<<
", file "
<<
file
<<
", line "
<<
line
;
std
::
cerr
.
flush
();
}
else
cv
::
error
(
cv
::
Exception
(
code
,
error_string
,
func
,
file
,
line
)
);
}
}
}
}
}
}
...
...
modules/gpu/src/precomp.hpp
View file @
f2df7848
...
@@ -55,6 +55,7 @@
...
@@ -55,6 +55,7 @@
#include <vector>
#include <vector>
#include <algorithm>
#include <algorithm>
#include <sstream>
#include <sstream>
#include <exception>
#include "opencv2/gpu/gpu.hpp"
#include "opencv2/gpu/gpu.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/imgproc/imgproc.hpp"
...
@@ -68,7 +69,7 @@
...
@@ -68,7 +69,7 @@
#else
/* defined(HAVE_CUDA) */
#else
/* defined(HAVE_CUDA) */
static
inline
void
throw_nogpu
()
{
CV_Error
(
CV_GpuNotFound
,
"The library is compilled with
no
GPU support"
);
}
static
inline
void
throw_nogpu
()
{
CV_Error
(
CV_GpuNotFound
,
"The library is compilled with
out
GPU support"
);
}
#endif
/* defined(HAVE_CUDA) */
#endif
/* defined(HAVE_CUDA) */
...
...
tests/gpu/src/gputest.hpp
View file @
f2df7848
...
@@ -69,8 +69,8 @@ static inline bool check_and_treat_gpu_exception(const cv::Exception& e, CvTS* t
...
@@ -69,8 +69,8 @@ static inline bool check_and_treat_gpu_exception(const cv::Exception& e, CvTS* t
{
{
switch
(
e
.
code
)
switch
(
e
.
code
)
{
{
case
CV_GpuNot
Foun
d
:
case
CV_GpuNot
Supporte
d
:
ts
->
printf
(
CvTS
::
LOG
,
"
\n
Gpu not
found
"
);
ts
->
printf
(
CvTS
::
LOG
,
"
\n
Gpu not
supported by the library
"
);
break
;
break
;
case
CV_GpuApiCallError
:
case
CV_GpuApiCallError
:
...
...
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