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
969a7133
Commit
969a7133
authored
Mar 27, 2013
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implementation of cv::Matx and cv::Vec is almost moved to matx.hpp
parent
d2192c07
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
158 additions
and
46 deletions
+158
-46
core.hpp
modules/core/include/opencv2/core.hpp
+6
-39
base.hpp
modules/core/include/opencv2/core/base.hpp
+140
-0
matx.hpp
modules/core/include/opencv2/core/matx.hpp
+0
-0
operations.hpp
modules/core/include/opencv2/core/operations.hpp
+0
-0
types.hpp
modules/core/include/opencv2/core/types.hpp
+1
-0
gl_core_3_1.cpp
modules/core/src/gl_core_3_1.cpp
+2
-2
system.cpp
modules/core/src/system.cpp
+5
-0
test_imgwarp_strict.cpp
modules/imgproc/test/test_imgwarp_strict.cpp
+4
-5
No files found.
modules/core/include/opencv2/core.hpp
View file @
969a7133
...
@@ -49,14 +49,17 @@
...
@@ -49,14 +49,17 @@
#include "opencv2/core/cvdef.h"
#include "opencv2/core/cvdef.h"
#include "opencv2/core/version.hpp"
#include "opencv2/core/version.hpp"
#include "opencv2/core/types_c.h"
#ifdef __cplusplus
#ifdef __cplusplus
#include "opencv2/core/cvstd.hpp"
#include "opencv2/core/base.hpp"
#include "opencv2/core/base.hpp"
#include "opencv2/core/cvstd.hpp"
#include "opencv2/core/traits.hpp"
#include "opencv2/core/traits.hpp"
#include "opencv2/core/matx.hpp"
#include "opencv2/core/matx.hpp"
#include "opencv2/core/types.hpp"
#include "opencv2/core/types.hpp"
#endif
#include "opencv2/core/types_c.h"
#ifdef __cplusplus
#ifndef SKIP_INCLUDES
#ifndef SKIP_INCLUDES
#include <limits.h>
#include <limits.h>
...
@@ -127,22 +130,6 @@ public:
...
@@ -127,22 +130,6 @@ public:
*/
*/
CV_EXPORTS
void
error
(
const
Exception
&
exc
);
CV_EXPORTS
void
error
(
const
Exception
&
exc
);
#ifdef __GNUC__
#define CV_Error( code, msg ) cv::error( cv::Exception(code, msg, __func__, __FILE__, __LINE__) )
#define CV_Error_( code, args ) cv::error( cv::Exception(code, cv::format args, __func__, __FILE__, __LINE__) )
#define CV_Assert( expr ) if(!!(expr)) ; else cv::error( cv::Exception(CV_StsAssert, #expr, __func__, __FILE__, __LINE__) )
#else
#define CV_Error( code, msg ) cv::error( cv::Exception(code, msg, "", __FILE__, __LINE__) )
#define CV_Error_( code, args ) cv::error( cv::Exception(code, cv::format args, "", __FILE__, __LINE__) )
#define CV_Assert( expr ) if(!!(expr)) ; else cv::error( cv::Exception(CV_StsAssert, #expr, "", __FILE__, __LINE__) )
#endif
#ifdef _DEBUG
#define CV_DbgAssert(expr) CV_Assert(expr)
#else
#define CV_DbgAssert(expr)
#endif
/*!
/*!
Allocates memory buffer
Allocates memory buffer
...
@@ -2059,26 +2046,6 @@ protected:
...
@@ -2059,26 +2046,6 @@ protected:
MatIterator_
<
_Tp
>
it
;
MatIterator_
<
_Tp
>
it
;
};
};
template
<
typename
_Tp
,
int
m
,
int
n
>
class
CV_EXPORTS
MatxCommaInitializer
{
public
:
MatxCommaInitializer
(
Matx
<
_Tp
,
m
,
n
>*
_mtx
);
template
<
typename
T2
>
MatxCommaInitializer
<
_Tp
,
m
,
n
>&
operator
,
(
T2
val
);
Matx
<
_Tp
,
m
,
n
>
operator
*
()
const
;
Matx
<
_Tp
,
m
,
n
>*
dst
;
int
idx
;
};
template
<
typename
_Tp
,
int
m
>
class
CV_EXPORTS
VecCommaInitializer
:
public
MatxCommaInitializer
<
_Tp
,
m
,
1
>
{
public
:
VecCommaInitializer
(
Vec
<
_Tp
,
m
>*
_vec
);
template
<
typename
T2
>
VecCommaInitializer
<
_Tp
,
m
>&
operator
,
(
T2
val
);
Vec
<
_Tp
,
m
>
operator
*
()
const
;
};
/////////////////////////// multi-dimensional dense matrix //////////////////////////
/////////////////////////// multi-dimensional dense matrix //////////////////////////
/*!
/*!
...
...
modules/core/include/opencv2/core/base.hpp
View file @
969a7133
...
@@ -44,11 +44,71 @@
...
@@ -44,11 +44,71 @@
#ifndef __OPENCV_CORE_BASE_HPP__
#ifndef __OPENCV_CORE_BASE_HPP__
#define __OPENCV_CORE_BASE_HPP__
#define __OPENCV_CORE_BASE_HPP__
#include <climits>
#include "opencv2/core/cvdef.h"
#include "opencv2/core/cvdef.h"
#include "opencv2/core/cvstd.hpp"
namespace
cv
namespace
cv
{
{
// error codes
namespace
Error
{
enum
{
StsOk
=
0
,
/* everithing is ok */
StsBackTrace
=
-
1
,
/* pseudo error for back trace */
StsError
=
-
2
,
/* unknown /unspecified error */
StsInternal
=
-
3
,
/* internal error (bad state) */
StsNoMem
=
-
4
,
/* insufficient memory */
StsBadArg
=
-
5
,
/* function arg/param is bad */
StsBadFunc
=
-
6
,
/* unsupported function */
StsNoConv
=
-
7
,
/* iter. didn't converge */
StsAutoTrace
=
-
8
,
/* tracing */
HeaderIsNull
=
-
9
,
/* image header is NULL */
BadImageSize
=
-
10
,
/* image size is invalid */
BadOffset
=
-
11
,
/* offset is invalid */
BadDataPtr
=
-
12
,
/**/
BadStep
=
-
13
,
/**/
BadModelOrChSeq
=
-
14
,
/**/
BadNumChannels
=
-
15
,
/**/
BadNumChannel1U
=
-
16
,
/**/
BadDepth
=
-
17
,
/**/
BadAlphaChannel
=
-
18
,
/**/
BadOrder
=
-
19
,
/**/
BadOrigin
=
-
20
,
/**/
BadAlign
=
-
21
,
/**/
BadCallBack
=
-
22
,
/**/
BadTileSize
=
-
23
,
/**/
BadCOI
=
-
24
,
/**/
BadROISize
=
-
25
,
/**/
MaskIsTiled
=
-
26
,
/**/
StsNullPtr
=
-
27
,
/* null pointer */
StsVecLengthErr
=
-
28
,
/* incorrect vector length */
StsFilterStructContentErr
=
-
29
,
/* incorr. filter structure content */
StsKernelStructContentErr
=
-
30
,
/* incorr. transform kernel content */
StsFilterOffsetErr
=
-
31
,
/* incorrect filter ofset value */
StsBadSize
=
-
201
,
/* the input/output structure size is incorrect */
StsDivByZero
=
-
202
,
/* division by zero */
StsInplaceNotSupported
=
-
203
,
/* in-place operation is not supported */
StsObjectNotFound
=
-
204
,
/* request can't be completed */
StsUnmatchedFormats
=
-
205
,
/* formats of input/output arrays differ */
StsBadFlag
=
-
206
,
/* flag is wrong or not supported */
StsBadPoint
=
-
207
,
/* bad CvPoint */
StsBadMask
=
-
208
,
/* bad format of mask (neither 8uC1 nor 8sC1)*/
StsUnmatchedSizes
=
-
209
,
/* sizes of input/output structures do not match */
StsUnsupportedFormat
=
-
210
,
/* the data format/type is not supported by the function*/
StsOutOfRange
=
-
211
,
/* some of parameters are out of range */
StsParseError
=
-
212
,
/* invalid syntax/structure of the parsed file */
StsNotImplemented
=
-
213
,
/* the requested function/feature is not implemented */
StsBadMemBlock
=
-
214
,
/* an allocated block has been corrupted */
StsAssert
=
-
215
,
/* assertion failed */
GpuNotSupported
=
-
216
,
GpuApiCallError
=
-
217
,
OpenGlNotSupported
=
-
218
,
OpenGlApiCallError
=
-
219
};
}
//Error
// matrix decomposition types
// matrix decomposition types
enum
{
DECOMP_LU
=
0
,
enum
{
DECOMP_LU
=
0
,
DECOMP_SVD
=
1
,
DECOMP_SVD
=
1
,
...
@@ -95,6 +155,71 @@ enum { DFT_INVERSE = 1,
...
@@ -95,6 +155,71 @@ enum { DFT_INVERSE = 1,
//////////////// static assert /////////////////
#define CVAUX_CONCAT_EXP(a, b) a##b
#define CVAUX_CONCAT(a, b) CVAUX_CONCAT_EXP(a,b)
#if defined(__clang__)
# ifndef __has_extension
# define __has_extension __has_feature
/* compatibility, for older versions of clang */
# endif
# if __has_extension(cxx_static_assert)
# define CV_StaticAssert(condition, reason) static_assert((condition), reason " " #condition)
# endif
#elif defined(__GNUC__)
# if (defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L)
# define CV_StaticAssert(condition, reason) static_assert((condition), reason " " #condition)
# endif
#elif defined(_MSC_VER)
# if _MSC_VER >= 1600
/* MSVC 10 */
# define CV_StaticAssert(condition, reason) static_assert((condition), reason " " #condition)
# endif
#endif
#ifndef CV_StaticAssert
# if defined(__GNUC__) && (__GNUC__ > 3) && (__GNUC_MINOR__ > 2)
# define CV_StaticAssert(condition, reason) ({ extern int __attribute__((error("CV_StaticAssert: " reason " " #condition))) CV_StaticAssert(); ((condition) ? 0 : CV_StaticAssert()); })
# else
namespace
cv
{
template
<
bool
x
>
struct
CV_StaticAssert_failed
;
template
<>
struct
CV_StaticAssert_failed
<
true
>
{
enum
{
val
=
1
};
};
template
<
int
x
>
struct
CV_StaticAssert_test
{};
}
# define CV_StaticAssert(condition, reason)\
typedef cv::CV_StaticAssert_test< sizeof(cv::CV_StaticAssert_failed< static_cast<bool>(condition) >) > CVAUX_CONCAT(CV_StaticAssert_failed_at_, __LINE__)
# endif
#endif
//! Signals an error and raises the exception.
/*!
By default the function prints information about the error to stderr,
then it either stops if setBreakOnError() had been called before or raises the exception.
It is possible to alternate error processing by using redirectError().
\param exc the exception raisen.
*/
CV_EXPORTS
void
error
(
int
_code
,
const
String
&
_err
,
const
char
*
_func
,
const
char
*
_file
,
int
_line
);
#ifdef __GNUC__
# define CV_Error( code, msg ) cv::error( code, msg, __func__, __FILE__, __LINE__ )
# define CV_Error_( code, args ) cv::error( code, cv::format args, __func__, __FILE__, __LINE__ )
# define CV_Assert( expr ) if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, __func__, __FILE__, __LINE__ )
#else
# define CV_Error( code, msg ) cv::error( code, msg, "", __FILE__, __LINE__ )
# define CV_Error_( code, args ) cv::error( code, cv::format args, "", __FILE__, __LINE__ )
# define CV_Assert( expr ) if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, "", __FILE__, __LINE__ )
#endif
#ifdef _DEBUG
# define CV_DbgAssert(expr) CV_Assert(expr)
#else
# define CV_DbgAssert(expr)
#endif
/////////////// saturate_cast (used in image & signal processing) ///////////////////
/////////////// saturate_cast (used in image & signal processing) ///////////////////
template
<
typename
_Tp
>
static
inline
_Tp
saturate_cast
(
uchar
v
)
{
return
_Tp
(
v
);
}
template
<
typename
_Tp
>
static
inline
_Tp
saturate_cast
(
uchar
v
)
{
return
_Tp
(
v
);
}
...
@@ -144,6 +269,19 @@ template<> inline unsigned saturate_cast<unsigned>(double v) { return cvRound(v)
...
@@ -144,6 +269,19 @@ template<> inline unsigned saturate_cast<unsigned>(double v) { return cvRound(v)
//////////////////////////////// low-level functions ////////////////////////////////
CV_EXPORTS
int
LU
(
float
*
A
,
size_t
astep
,
int
m
,
float
*
b
,
size_t
bstep
,
int
n
);
CV_EXPORTS
int
LU
(
double
*
A
,
size_t
astep
,
int
m
,
double
*
b
,
size_t
bstep
,
int
n
);
CV_EXPORTS
bool
Cholesky
(
float
*
A
,
size_t
astep
,
int
m
,
float
*
b
,
size_t
bstep
,
int
n
);
CV_EXPORTS
bool
Cholesky
(
double
*
A
,
size_t
astep
,
int
m
,
double
*
b
,
size_t
bstep
,
int
n
);
CV_EXPORTS
float
normL2Sqr_
(
const
float
*
a
,
const
float
*
b
,
int
n
);
CV_EXPORTS
float
normL1_
(
const
float
*
a
,
const
float
*
b
,
int
n
);
CV_EXPORTS
int
normL1_
(
const
uchar
*
a
,
const
uchar
*
b
,
int
n
);
CV_EXPORTS
int
normHamming
(
const
uchar
*
a
,
const
uchar
*
b
,
int
n
);
CV_EXPORTS
int
normHamming
(
const
uchar
*
a
,
const
uchar
*
b
,
int
n
,
int
cellSize
);
////////////////// forward declarations for important OpenCV types //////////////////
////////////////// forward declarations for important OpenCV types //////////////////
template
<
typename
_Tp
,
int
cn
>
class
CV_EXPORTS
Vec
;
template
<
typename
_Tp
,
int
cn
>
class
CV_EXPORTS
Vec
;
...
@@ -182,6 +320,8 @@ namespace gpu
...
@@ -182,6 +320,8 @@ namespace gpu
class
CV_EXPORTS
GpuMat
;
class
CV_EXPORTS
GpuMat
;
}
}
}
// cv
}
// cv
#endif //__OPENCV_CORE_BASE_HPP__
#endif //__OPENCV_CORE_BASE_HPP__
modules/core/include/opencv2/core/matx.hpp
View file @
969a7133
This diff is collapsed.
Click to expand it.
modules/core/include/opencv2/core/operations.hpp
View file @
969a7133
This diff is collapsed.
Click to expand it.
modules/core/include/opencv2/core/types.hpp
View file @
969a7133
...
@@ -45,6 +45,7 @@
...
@@ -45,6 +45,7 @@
#define __OPENCV_CORE_TYPES_HPP__
#define __OPENCV_CORE_TYPES_HPP__
#include <climits>
#include <climits>
#include <cfloat>
#include <vector>
#include <vector>
#ifndef OPENCV_NOSTL
#ifndef OPENCV_NOSTL
...
...
modules/core/src/gl_core_3_1.cpp
View file @
969a7133
...
@@ -136,14 +136,14 @@
...
@@ -136,14 +136,14 @@
void
*
func
=
(
void
*
)
CV_GL_GET_PROC_ADDRESS
(
name
);
void
*
func
=
(
void
*
)
CV_GL_GET_PROC_ADDRESS
(
name
);
if
(
!
func
)
if
(
!
func
)
{
{
CV_Error
(
CV_
OpenGlApiCallError
,
cv
::
format
(
"Can't load OpenGL extension [%s]"
,
name
)
);
CV_Error
(
cv
::
Error
::
OpenGlApiCallError
,
cv
::
format
(
"Can't load OpenGL extension [%s]"
,
name
)
);
}
}
return
func
;
return
func
;
}
}
#else
#else
static
void
*
IntGetProcAddress
(
const
char
*
)
static
void
*
IntGetProcAddress
(
const
char
*
)
{
{
CV_Error
(
CV_
OpenGlNotSupported
,
"The library is compiled without OpenGL support"
);
CV_Error
(
cv
::
Error
::
OpenGlNotSupported
,
"The library is compiled without OpenGL support"
);
return
0
;
return
0
;
}
}
#endif
#endif
...
...
modules/core/src/system.cpp
View file @
969a7133
...
@@ -465,6 +465,11 @@ void error( const Exception& exc )
...
@@ -465,6 +465,11 @@ void error( const Exception& exc )
throw
exc
;
throw
exc
;
}
}
void
error
(
int
_code
,
const
String
&
_err
,
const
char
*
_func
,
const
char
*
_file
,
int
_line
)
{
error
(
cv
::
Exception
(
_code
,
_err
,
_func
,
_file
,
_line
));
}
CvErrorCallback
CvErrorCallback
redirectError
(
CvErrorCallback
errCallback
,
void
*
userdata
,
void
**
prevUserdata
)
redirectError
(
CvErrorCallback
errCallback
,
void
*
userdata
,
void
**
prevUserdata
)
{
{
...
...
modules/imgproc/test/test_imgwarp_strict.cpp
View file @
969a7133
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
using
namespace
cv
;
using
namespace
cv
;
namespace
internal
namespace
{
{
void
__wrap_printf_func
(
const
char
*
fmt
,
...)
void
__wrap_printf_func
(
const
char
*
fmt
,
...)
{
{
...
@@ -62,7 +62,6 @@ namespace internal
...
@@ -62,7 +62,6 @@ namespace internal
#define PRINT_TO_LOG __wrap_printf_func
#define PRINT_TO_LOG __wrap_printf_func
}
}
using
internal
::
PRINT_TO_LOG
;
#define SHOW_IMAGE
#define SHOW_IMAGE
#undef SHOW_IMAGE
#undef SHOW_IMAGE
...
@@ -359,7 +358,7 @@ CV_Resize_Test::~CV_Resize_Test()
...
@@ -359,7 +358,7 @@ CV_Resize_Test::~CV_Resize_Test()
{
{
}
}
namespace
internal
namespace
{
{
void
interpolateLinear
(
float
x
,
float
*
coeffs
)
void
interpolateLinear
(
float
x
,
float
*
coeffs
)
{
{
...
@@ -523,7 +522,7 @@ void CV_Resize_Test::resize_1d(const Mat& _src, Mat& _dst, int dy, const dim& _d
...
@@ -523,7 +522,7 @@ void CV_Resize_Test::resize_1d(const Mat& _src, Mat& _dst, int dy, const dim& _d
}
}
else
if
(
interpolation
==
INTER_LINEAR
||
interpolation
==
INTER_CUBIC
||
interpolation
==
INTER_LANCZOS4
)
else
if
(
interpolation
==
INTER_LINEAR
||
interpolation
==
INTER_CUBIC
||
interpolation
==
INTER_LANCZOS4
)
{
{
inter
nal
::
interpolate_method
inter_func
=
internal
::
inter_array
[
interpolation
-
(
interpolation
==
INTER_LANCZOS4
?
2
:
1
)];
inter
polate_method
inter_func
=
inter_array
[
interpolation
-
(
interpolation
==
INTER_LANCZOS4
?
2
:
1
)];
size_t
elemsize
=
_src
.
elemSize
();
size_t
elemsize
=
_src
.
elemSize
();
int
ofs
=
0
,
ksize
=
2
;
int
ofs
=
0
,
ksize
=
2
;
...
@@ -874,7 +873,7 @@ void CV_Remap_Test::remap_generic(const Mat& _src, Mat& _dst)
...
@@ -874,7 +873,7 @@ void CV_Remap_Test::remap_generic(const Mat& _src, Mat& _dst)
height1
=
std
::
max
(
ssize
.
height
-
ksize
+
1
,
0
);
height1
=
std
::
max
(
ssize
.
height
-
ksize
+
1
,
0
);
float
ix
[
8
],
w
[
16
];
float
ix
[
8
],
w
[
16
];
inter
nal
::
interpolate_method
inter_func
=
internal
::
inter_array
[
interpolation
-
(
interpolation
==
INTER_LANCZOS4
?
2
:
1
)];
inter
polate_method
inter_func
=
inter_array
[
interpolation
-
(
interpolation
==
INTER_LANCZOS4
?
2
:
1
)];
for
(
int
dy
=
0
;
dy
<
dsize
.
height
;
++
dy
)
for
(
int
dy
=
0
;
dy
<
dsize
.
height
;
++
dy
)
{
{
...
...
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