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
ca3848d7
Commit
ca3848d7
authored
Oct 25, 2018
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12937 from mshabunin:fix-static-4
parents
13f244b6
28556f14
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
97 additions
and
91 deletions
+97
-91
calibration.cpp
modules/calib3d/src/calibration.cpp
+1
-0
chessboard.cpp
modules/calib3d/src/chessboard.cpp
+3
-1
base.hpp
modules/core/include/opencv2/core/base.hpp
+0
-86
cvdef.h
modules/core/include/opencv2/core/cvdef.h
+88
-2
pooling_layer.cpp
modules/dnn/src/layers/pooling_layer.cpp
+2
-1
grfmt_pfm.cpp
modules/imgcodecs/src/grfmt_pfm.cpp
+1
-1
contours.cpp
modules/imgproc/src/contours.cpp
+1
-0
hog.cpp
modules/objdetect/src/hog.cpp
+1
-0
No files found.
modules/calib3d/src/calibration.cpp
View file @
ca3848d7
...
...
@@ -1133,6 +1133,7 @@ CV_IMPL void cvFindExtrinsicCameraParams2( const CvMat* objectPoints,
if
(
cvDet
(
&
_RR
)
<
0
)
cvScale
(
&
_RRt
,
&
_RRt
,
-
1
);
sc
=
cvNorm
(
&
_RR
);
CV_Assert
(
fabs
(
sc
)
>
DBL_EPSILON
);
cvSVD
(
&
_RR
,
&
matW
,
&
matU
,
&
matV
,
CV_SVD_MODIFY_A
+
CV_SVD_U_T
+
CV_SVD_V_T
);
cvGEMM
(
&
matU
,
&
matV
,
1
,
0
,
0
,
&
matR
,
CV_GEMM_A_T
);
cvScale
(
&
_tt
,
&
_t
,
cvNorm
(
&
matR
)
/
sc
);
...
...
modules/calib3d/src/chessboard.cpp
View file @
ca3848d7
...
...
@@ -164,7 +164,9 @@ cv::Mat findHomography1D(cv::InputArray _src,cv::InputArray _dst)
Mat
H
=
dst_T
.
inv
()
*
Mat
(
H_
,
false
)
*
src_T
;
// enforce frobeniusnorm of one
double
scale
=
1.0
/
cv
::
norm
(
H
);
double
scale
=
cv
::
norm
(
H
);
CV_Assert
(
fabs
(
scale
)
>
DBL_EPSILON
);
scale
=
1.0
/
scale
;
return
H
*
scale
;
}
void
polyfit
(
const
Mat
&
src_x
,
const
Mat
&
src_y
,
Mat
&
dst
,
int
order
)
...
...
modules/core/include/opencv2/core/base.hpp
View file @
ca3848d7
...
...
@@ -283,84 +283,6 @@ enum BorderTypes {
//! @addtogroup core_utils
//! @{
//! @cond IGNORED
//////////////// 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)
# elif __has_extension(c_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(__clang__) && defined(__GNUC__) && (__GNUC__*100 + __GNUC_MINOR__ > 302)
# define CV_StaticAssert(condition, reason) ({ extern int __attribute__((error("CV_StaticAssert: " reason " " #condition))) CV_StaticAssert(); ((condition) ? 0 : CV_StaticAssert()); })
# else
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
// Suppress warning "-Wdeprecated-declarations" / C4996
#if defined(_MSC_VER)
#define CV_DO_PRAGMA(x) __pragma(x)
#elif defined(__GNUC__)
#define CV_DO_PRAGMA(x) _Pragma (#x)
#else
#define CV_DO_PRAGMA(x)
#endif
#ifdef _MSC_VER
#define CV_SUPPRESS_DEPRECATED_START \
CV_DO_PRAGMA(warning(push)) \
CV_DO_PRAGMA(warning(disable: 4996))
#define CV_SUPPRESS_DEPRECATED_END CV_DO_PRAGMA(warning(pop))
#elif defined (__clang__) || ((__GNUC__) && (__GNUC__*100 + __GNUC_MINOR__ > 405))
#define CV_SUPPRESS_DEPRECATED_START \
CV_DO_PRAGMA(GCC diagnostic push) \
CV_DO_PRAGMA(GCC diagnostic ignored "-Wdeprecated-declarations")
#define CV_SUPPRESS_DEPRECATED_END CV_DO_PRAGMA(GCC diagnostic pop)
#else
#define CV_SUPPRESS_DEPRECATED_START
#define CV_SUPPRESS_DEPRECATED_END
#endif
#define CV_UNUSED(name) (void)name
#if defined __GNUC__ && !defined __EXCEPTIONS
#define CV_TRY
#define CV_CATCH(A, B) for (A B; false; )
#define CV_CATCH_ALL if (false)
#define CV_THROW(A) abort()
#define CV_RETHROW() abort()
#else
#define CV_TRY try
#define CV_CATCH(A, B) catch(const A & B)
#define CV_CATCH_ALL catch(...)
#define CV_THROW(A) throw A
#define CV_RETHROW() throw
#endif
//! @endcond
/*! @brief Signals an error and raises the exception.
By default the function prints information about the error to stderr,
...
...
@@ -375,14 +297,6 @@ It is possible to alternate error processing by using redirectError().
*/
CV_EXPORTS
CV_NORETURN
void
error
(
int
_code
,
const
String
&
_err
,
const
char
*
_func
,
const
char
*
_file
,
int
_line
);
#if defined __GNUC__
#define CV_Func __func__
#elif defined _MSC_VER
#define CV_Func __FUNCTION__
#else
#define CV_Func ""
#endif
#ifdef CV_STATIC_ANALYSIS
// In practice, some macro are not processed correctly (noreturn is not detected).
...
...
modules/core/include/opencv2/core/cvdef.h
View file @
ca3848d7
...
...
@@ -82,6 +82,92 @@ namespace cv { namespace debug_build_guard { } using namespace debug_build_guard
#define __CV_VA_NUM_ARGS_HELPER(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, N, ...) N
#define __CV_VA_NUM_ARGS(...) __CV_EXPAND(__CV_VA_NUM_ARGS_HELPER(__VA_ARGS__, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0))
#if defined __GNUC__
#define CV_Func __func__
#elif defined _MSC_VER
#define CV_Func __FUNCTION__
#else
#define CV_Func ""
#endif
//! @cond IGNORED
//////////////// 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)
# elif __has_extension(c_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(__clang__) && defined(__GNUC__) && (__GNUC__*100 + __GNUC_MINOR__ > 302)
# define CV_StaticAssert(condition, reason) ({ extern int __attribute__((error("CV_StaticAssert: " reason " " #condition))) CV_StaticAssert(); ((condition) ? 0 : CV_StaticAssert()); })
# else
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
// Suppress warning "-Wdeprecated-declarations" / C4996
#if defined(_MSC_VER)
#define CV_DO_PRAGMA(x) __pragma(x)
#elif defined(__GNUC__)
#define CV_DO_PRAGMA(x) _Pragma (#x)
#else
#define CV_DO_PRAGMA(x)
#endif
#ifdef _MSC_VER
#define CV_SUPPRESS_DEPRECATED_START \
CV_DO_PRAGMA(warning(push)) \
CV_DO_PRAGMA(warning(disable: 4996))
#define CV_SUPPRESS_DEPRECATED_END CV_DO_PRAGMA(warning(pop))
#elif defined (__clang__) || ((__GNUC__) && (__GNUC__*100 + __GNUC_MINOR__ > 405))
#define CV_SUPPRESS_DEPRECATED_START \
CV_DO_PRAGMA(GCC diagnostic push) \
CV_DO_PRAGMA(GCC diagnostic ignored "-Wdeprecated-declarations")
#define CV_SUPPRESS_DEPRECATED_END CV_DO_PRAGMA(GCC diagnostic pop)
#else
#define CV_SUPPRESS_DEPRECATED_START
#define CV_SUPPRESS_DEPRECATED_END
#endif
#define CV_UNUSED(name) (void)name
#if defined __GNUC__ && !defined __EXCEPTIONS
#define CV_TRY
#define CV_CATCH(A, B) for (A B; false; )
#define CV_CATCH_ALL if (false)
#define CV_THROW(A) abort()
#define CV_RETHROW() abort()
#else
#define CV_TRY try
#define CV_CATCH(A, B) catch(const A & B)
#define CV_CATCH_ALL catch(...)
#define CV_THROW(A) throw A
#define CV_RETHROW() throw
#endif
//! @endcond
// undef problematic defines sometimes defined by system headers (windows.h in particular)
#undef small
#undef min
...
...
@@ -654,7 +740,7 @@ class float16_t
public
:
#if CV_FP16_TYPE
float16_t
()
{}
float16_t
()
:
h
(
0
)
{}
explicit
float16_t
(
float
x
)
{
h
=
(
__fp16
)
x
;
}
operator
float
()
const
{
return
(
float
)
h
;
}
static
float16_t
fromBits
(
ushort
w
)
...
...
@@ -681,7 +767,7 @@ protected:
__fp16
h
;
#else
float16_t
()
{}
float16_t
()
:
w
(
0
)
{}
explicit
float16_t
(
float
x
)
{
#if CV_AVX2
...
...
modules/dnn/src/layers/pooling_layer.cpp
View file @
ca3848d7
...
...
@@ -332,7 +332,8 @@ public:
int
poolingType
;
float
spatialScale
;
PoolingInvoker
()
:
src
(
0
),
rois
(
0
),
dst
(
0
),
mask
(
0
),
avePoolPaddedArea
(
false
),
nstripes
(
0
),
PoolingInvoker
()
:
src
(
0
),
rois
(
0
),
dst
(
0
),
mask
(
0
),
pad_l
(
0
),
pad_t
(
0
),
pad_r
(
0
),
pad_b
(
0
),
avePoolPaddedArea
(
false
),
nstripes
(
0
),
computeMaxIdx
(
0
),
poolingType
(
MAX
),
spatialScale
(
0
)
{}
static
void
run
(
const
Mat
&
src
,
const
Mat
&
rois
,
Mat
&
dst
,
Mat
&
mask
,
Size
kernel
,
...
...
modules/imgcodecs/src/grfmt_pfm.cpp
View file @
ca3848d7
...
...
@@ -79,7 +79,7 @@ PFMDecoder::~PFMDecoder()
{
}
PFMDecoder
::
PFMDecoder
()
PFMDecoder
::
PFMDecoder
()
:
m_scale_factor
(
0
),
m_swap_byte_order
(
false
)
{
m_strm
.
close
();
}
...
...
modules/imgproc/src/contours.cpp
View file @
ca3848d7
...
...
@@ -1532,6 +1532,7 @@ icvFindContoursInInterval( const CvArr* src,
tmp_prev
->
link
=
0
;
// First line. None of runs is binded
tmp
.
pt
.
x
=
0
;
tmp
.
pt
.
y
=
0
;
CV_WRITE_SEQ_ELEM
(
tmp
,
writer
);
upper_line
=
(
CvLinkedRunPoint
*
)
CV_GET_WRITTEN_ELEM
(
writer
);
...
...
modules/objdetect/src/hog.cpp
View file @
ca3848d7
...
...
@@ -240,6 +240,7 @@ void HOGDescriptor::computeGradient(InputArray _img, InputOutputArray _grad, Inp
CV_INSTRUMENT_REGION
();
Mat
img
=
_img
.
getMat
();
CV_Assert
(
!
img
.
empty
());
CV_Assert
(
img
.
type
()
==
CV_8U
||
img
.
type
()
==
CV_8UC3
);
Size
gradsize
(
img
.
cols
+
paddingTL
.
width
+
paddingBR
.
width
,
...
...
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