Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
969a7133
O
Opencv
项目概览
Greenplum
/
Opencv
大约 1 年 前同步成功
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Opencv
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
969a7133
编写于
3月 27, 2013
作者:
A
Andrey Kamaev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Implementation of cv::Matx and cv::Vec is almost moved to matx.hpp
上级
d2192c07
变更
8
展开全部
隐藏空白更改
内联
并排
Showing
8 changed file
with
1178 addition
and
1090 deletion
+1178
-1090
modules/core/include/opencv2/core.hpp
modules/core/include/opencv2/core.hpp
+6
-39
modules/core/include/opencv2/core/base.hpp
modules/core/include/opencv2/core/base.hpp
+140
-0
modules/core/include/opencv2/core/matx.hpp
modules/core/include/opencv2/core/matx.hpp
+950
-4
modules/core/include/opencv2/core/operations.hpp
modules/core/include/opencv2/core/operations.hpp
+70
-1040
modules/core/include/opencv2/core/types.hpp
modules/core/include/opencv2/core/types.hpp
+1
-0
modules/core/src/gl_core_3_1.cpp
modules/core/src/gl_core_3_1.cpp
+2
-2
modules/core/src/system.cpp
modules/core/src/system.cpp
+5
-0
modules/imgproc/test/test_imgwarp_strict.cpp
modules/imgproc/test/test_imgwarp_strict.cpp
+4
-5
未找到文件。
modules/core/include/opencv2/core.hpp
浏览文件 @
969a7133
...
...
@@ -49,14 +49,17 @@
#include "opencv2/core/cvdef.h"
#include "opencv2/core/version.hpp"
#include "opencv2/core/types_c.h"
#ifdef __cplusplus
#include "opencv2/core/cvstd.hpp"
#include "opencv2/core/base.hpp"
#include "opencv2/core/cvstd.hpp"
#include "opencv2/core/traits.hpp"
#include "opencv2/core/matx.hpp"
#include "opencv2/core/types.hpp"
#endif
#include "opencv2/core/types_c.h"
#ifdef __cplusplus
#ifndef SKIP_INCLUDES
#include <limits.h>
...
...
@@ -127,22 +130,6 @@ public:
*/
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
...
...
@@ -2059,26 +2046,6 @@ protected:
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 //////////////////////////
/*!
...
...
modules/core/include/opencv2/core/base.hpp
浏览文件 @
969a7133
...
...
@@ -44,11 +44,71 @@
#ifndef __OPENCV_CORE_BASE_HPP__
#define __OPENCV_CORE_BASE_HPP__
#include <climits>
#include "opencv2/core/cvdef.h"
#include "opencv2/core/cvstd.hpp"
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
enum
{
DECOMP_LU
=
0
,
DECOMP_SVD
=
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) ///////////////////
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)
//////////////////////////////// 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 //////////////////
template
<
typename
_Tp
,
int
cn
>
class
CV_EXPORTS
Vec
;
...
...
@@ -182,6 +320,8 @@ namespace gpu
class
CV_EXPORTS
GpuMat
;
}
}
// cv
#endif //__OPENCV_CORE_BASE_HPP__
modules/core/include/opencv2/core/matx.hpp
浏览文件 @
969a7133
此差异已折叠。
点击以展开。
modules/core/include/opencv2/core/operations.hpp
浏览文件 @
969a7133
此差异已折叠。
点击以展开。
modules/core/include/opencv2/core/types.hpp
浏览文件 @
969a7133
...
...
@@ -45,6 +45,7 @@
#define __OPENCV_CORE_TYPES_HPP__
#include <climits>
#include <cfloat>
#include <vector>
#ifndef OPENCV_NOSTL
...
...
modules/core/src/gl_core_3_1.cpp
浏览文件 @
969a7133
...
...
@@ -136,14 +136,14 @@
void
*
func
=
(
void
*
)
CV_GL_GET_PROC_ADDRESS
(
name
);
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
;
}
#else
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
;
}
#endif
...
...
modules/core/src/system.cpp
浏览文件 @
969a7133
...
...
@@ -465,6 +465,11 @@ void error( const Exception& 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
redirectError
(
CvErrorCallback
errCallback
,
void
*
userdata
,
void
**
prevUserdata
)
{
...
...
modules/imgproc/test/test_imgwarp_strict.cpp
浏览文件 @
969a7133
...
...
@@ -47,7 +47,7 @@
using
namespace
cv
;
namespace
internal
namespace
{
void
__wrap_printf_func
(
const
char
*
fmt
,
...)
{
...
...
@@ -62,7 +62,6 @@ namespace internal
#define PRINT_TO_LOG __wrap_printf_func
}
using
internal
::
PRINT_TO_LOG
;
#define SHOW_IMAGE
#undef SHOW_IMAGE
...
...
@@ -359,7 +358,7 @@ CV_Resize_Test::~CV_Resize_Test()
{
}
namespace
internal
namespace
{
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
}
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
();
int
ofs
=
0
,
ksize
=
2
;
...
...
@@ -874,7 +873,7 @@ void CV_Remap_Test::remap_generic(const Mat& _src, Mat& _dst)
height1
=
std
::
max
(
ssize
.
height
-
ksize
+
1
,
0
);
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
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录