Skip to content

Commit c08ede7

Browse files
committed
OpenCV4
1 parent daa90aa commit c08ede7

File tree

170 files changed

+19252
-8433
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

170 files changed

+19252
-8433
lines changed

3rdParty/opencv2/README.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

3rdParty/opencv2/calib3d.hpp

Lines changed: 180 additions & 78 deletions
Large diffs are not rendered by default.

3rdParty/opencv2/core.hpp

Lines changed: 145 additions & 80 deletions
Large diffs are not rendered by default.

3rdParty/opencv2/core/affine.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
namespace cv
5252
{
5353

54-
//! @addtogroup core
54+
//! @addtogroup core_eigen
5555
//! @{
5656

5757
/** @brief Affine transform

3rdParty/opencv2/core/async.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@
77

88
#include <opencv2/core/mat.hpp>
99

10-
#ifdef CV_CXX11
1110
//#include <future>
1211
#include <chrono>
13-
#endif
1412

1513
namespace cv {
1614

@@ -69,7 +67,6 @@ class CV_EXPORTS_W AsyncArray
6967

7068
CV_WRAP bool valid() const CV_NOEXCEPT;
7169

72-
#ifdef CV_CXX11
7370
inline AsyncArray(AsyncArray&& o) { p = o.p; o.p = NULL; }
7471
inline AsyncArray& operator=(AsyncArray&& o) CV_NOEXCEPT { std::swap(p, o.p); return *this; }
7572

@@ -89,7 +86,6 @@ class CV_EXPORTS_W AsyncArray
8986
std::future<Mat> getFutureMat() const;
9087
std::future<UMat> getFutureUMat() const;
9188
#endif
92-
#endif
9389

9490

9591
// PImpl

3rdParty/opencv2/core/base.hpp

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -271,11 +271,11 @@ enum BorderTypes {
271271
BORDER_REFLECT = 2, //!< `fedcba|abcdefgh|hgfedcb`
272272
BORDER_WRAP = 3, //!< `cdefgh|abcdefgh|abcdefg`
273273
BORDER_REFLECT_101 = 4, //!< `gfedcb|abcdefgh|gfedcba`
274-
BORDER_TRANSPARENT = 5, //!< `uvwxyz|abcdefgh|ijklmno`
274+
BORDER_TRANSPARENT = 5, //!< `uvwxyz|abcdefgh|ijklmno` - Treats outliers as transparent.
275275

276276
BORDER_REFLECT101 = BORDER_REFLECT_101, //!< same as BORDER_REFLECT_101
277277
BORDER_DEFAULT = BORDER_REFLECT_101, //!< same as BORDER_REFLECT_101
278-
BORDER_ISOLATED = 16 //!< do not look outside of ROI
278+
BORDER_ISOLATED = 16 //!< Interpolation restricted within the ROI boundaries.
279279
};
280280

281281
//! @} core_array
@@ -288,14 +288,29 @@ enum BorderTypes {
288288
By default the function prints information about the error to stderr,
289289
then it either stops if setBreakOnError() had been called before or raises the exception.
290290
It is possible to alternate error processing by using redirectError().
291-
@param _code - error code (Error::Code)
292-
@param _err - error description
293-
@param _func - function name. Available only when the compiler supports getting it
294-
@param _file - source file name where the error has occurred
295-
@param _line - line number in the source file where the error has occurred
291+
@param code - error code (Error::Code)
292+
@param err - error description
293+
@param func - function name. Available only when the compiler supports getting it
294+
@param file - source file name where the error has occurred
295+
@param line - line number in the source file where the error has occurred
296296
@see CV_Error, CV_Error_, CV_Assert, CV_DbgAssert
297297
*/
298-
CV_EXPORTS CV_NORETURN void error(int _code, const String& _err, const char* _func, const char* _file, int _line);
298+
CV_EXPORTS CV_NORETURN void error(int code, const String& err, const char* func, const char* file, int line);
299+
300+
/*! @brief Signals an error and terminate application.
301+
302+
By default the function prints information about the error to stderr, then it terminates application
303+
with std::terminate. The function is designed for invariants check in functions and methods with
304+
noexcept attribute.
305+
@param code - error code (Error::Code)
306+
@param err - error description
307+
@param func - function name. Available only when the compiler supports getting it
308+
@param file - source file name where the error has occurred
309+
@param line - line number in the source file where the error has occurred
310+
@see CV_AssertTerminate
311+
*/
312+
CV_EXPORTS CV_NORETURN void terminate(int code, const String& err, const char* func, const char* file, int line) CV_NOEXCEPT;
313+
299314

300315
#ifdef CV_STATIC_ANALYSIS
301316

@@ -338,8 +353,11 @@ for example:
338353
The macros CV_Assert (and CV_DbgAssert(expr)) evaluate the specified expression. If it is 0, the macros
339354
raise an error (see cv::error). The macro CV_Assert checks the condition in both Debug and Release
340355
configurations while CV_DbgAssert is only retained in the Debug configuration.
356+
CV_AssertTerminate is analog of CV_Assert for invariants check in functions with noexcept attribute.
357+
It does not throw exception, but terminates the application.
341358
*/
342359
#define CV_Assert( expr ) do { if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ ); } while(0)
360+
#define CV_AssertTerminate( expr ) do { if(!!(expr)) ; else cv::terminate( #expr, CV_Func, __FILE__, __LINE__ ); } while(0)
343361

344362
#endif // CV_STATIC_ANALYSIS
345363

3rdParty/opencv2/core/bindings_utils.hpp

Lines changed: 89 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ String dumpInt(int argument)
3535
return cv::format("Int: %d", argument);
3636
}
3737

38+
CV_WRAP static inline
39+
String dumpInt64(int64 argument)
40+
{
41+
std::ostringstream oss("Int64: ", std::ios::ate);
42+
oss << argument;
43+
return oss.str();
44+
}
45+
3846
CV_WRAP static inline
3947
String dumpSizeT(size_t argument)
4048
{
@@ -67,20 +75,6 @@ String dumpString(const String& argument)
6775
return cv::format("String: %s", argument.c_str());
6876
}
6977

70-
CV_WRAP static inline
71-
String testOverloadResolution(int value, const Point& point = Point(42, 24))
72-
{
73-
return format("overload (int=%d, point=(x=%d, y=%d))", value, point.x,
74-
point.y);
75-
}
76-
77-
CV_WRAP static inline
78-
String testOverloadResolution(const Rect& rect)
79-
{
80-
return format("overload (rect=(x=%d, y=%d, w=%d, h=%d))", rect.x, rect.y,
81-
rect.width, rect.height);
82-
}
83-
8478
CV_WRAP static inline
8579
String dumpRect(const Rect& argument)
8680
{
@@ -103,6 +97,42 @@ String dumpRotatedRect(const RotatedRect& argument)
10397
argument.size.height, argument.angle);
10498
}
10599

100+
CV_WRAP static inline
101+
String dumpRange(const Range& argument)
102+
{
103+
if (argument == Range::all())
104+
{
105+
return "range: all";
106+
}
107+
else
108+
{
109+
return format("range: (s=%d, e=%d)", argument.start, argument.end);
110+
}
111+
}
112+
113+
CV_EXPORTS_W String dumpVectorOfInt(const std::vector<int>& vec);
114+
115+
CV_EXPORTS_W String dumpVectorOfDouble(const std::vector<double>& vec);
116+
117+
CV_EXPORTS_W String dumpVectorOfRect(const std::vector<Rect>& vec);
118+
119+
120+
//! @cond IGNORED
121+
122+
CV_WRAP static inline
123+
String testOverloadResolution(int value, const Point& point = Point(42, 24))
124+
{
125+
return format("overload (int=%d, point=(x=%d, y=%d))", value, point.x,
126+
point.y);
127+
}
128+
129+
CV_WRAP static inline
130+
String testOverloadResolution(const Rect& rect)
131+
{
132+
return format("overload (rect=(x=%d, y=%d, w=%d, h=%d))", rect.x, rect.y,
133+
rect.width, rect.height);
134+
}
135+
106136
CV_WRAP static inline
107137
RotatedRect testRotatedRect(float x, float y, float w, float h, float angle)
108138
{
@@ -118,19 +148,6 @@ std::vector<RotatedRect> testRotatedRectVector(float x, float y, float w, float
118148
return result;
119149
}
120150

121-
CV_WRAP static inline
122-
String dumpRange(const Range& argument)
123-
{
124-
if (argument == Range::all())
125-
{
126-
return "range: all";
127-
}
128-
else
129-
{
130-
return format("range: (s=%d, e=%d)", argument.start, argument.end);
131-
}
132-
}
133-
134151
CV_WRAP static inline
135152
int testOverwriteNativeMethod(int argument)
136153
{
@@ -143,12 +160,6 @@ String testReservedKeywordConversion(int positional_argument, int lambda = 2, in
143160
return format("arg=%d, lambda=%d, from=%d", positional_argument, lambda, from);
144161
}
145162

146-
CV_EXPORTS_W String dumpVectorOfInt(const std::vector<int>& vec);
147-
148-
CV_EXPORTS_W String dumpVectorOfDouble(const std::vector<double>& vec);
149-
150-
CV_EXPORTS_W String dumpVectorOfRect(const std::vector<Rect>& vec);
151-
152163
CV_WRAP static inline
153164
void generateVectorOfRect(size_t len, CV_OUT std::vector<Rect>& vec)
154165
{
@@ -219,6 +230,49 @@ AsyncArray testAsyncException()
219230
return p.getArrayResult();
220231
}
221232

233+
CV_WRAP static inline
234+
String dumpVec2i(const cv::Vec2i value = cv::Vec2i(42, 24)) {
235+
return format("Vec2i(%d, %d)", value[0], value[1]);
236+
}
237+
238+
struct CV_EXPORTS_W_SIMPLE ClassWithKeywordProperties {
239+
CV_PROP_RW int lambda;
240+
CV_PROP int except;
241+
242+
CV_WRAP explicit ClassWithKeywordProperties(int lambda_arg = 24, int except_arg = 42)
243+
{
244+
lambda = lambda_arg;
245+
except = except_arg;
246+
}
247+
};
248+
249+
struct CV_EXPORTS_W_PARAMS FunctionParams
250+
{
251+
CV_PROP_RW int lambda = -1;
252+
CV_PROP_RW float sigma = 0.0f;
253+
254+
FunctionParams& setLambda(int value) CV_NOEXCEPT
255+
{
256+
lambda = value;
257+
return *this;
258+
}
259+
260+
FunctionParams& setSigma(float value) CV_NOEXCEPT
261+
{
262+
sigma = value;
263+
return *this;
264+
}
265+
};
266+
267+
CV_WRAP static inline String
268+
copyMatAndDumpNamedArguments(InputArray src, OutputArray dst,
269+
const FunctionParams& params = FunctionParams())
270+
{
271+
src.copyTo(dst);
272+
return format("lambda=%d, sigma=%.1f", params.lambda,
273+
params.sigma);
274+
}
275+
222276
namespace nested {
223277
CV_WRAP static inline bool testEchoBooleanFunction(bool flag) {
224278
return flag;
@@ -272,6 +326,8 @@ class CV_EXPORTS_W CV_WRAP_AS(ExportClassName) OriginalClassName
272326
typedef OriginalClassName::Params OriginalClassName_Params;
273327
} // namespace nested
274328

329+
//! @endcond IGNORED
330+
275331
namespace fs {
276332
CV_EXPORTS_W cv::String getCacheDirectoryForDownloads();
277333
} // namespace fs

3rdParty/opencv2/core/bufferpool.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
namespace cv
1616
{
1717

18-
//! @addtogroup core
18+
//! @addtogroup core_opencl
1919
//! @{
2020

2121
class BufferPoolController

3rdParty/opencv2/core/check.hpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ struct CheckContext {
6565
static const cv::detail::CheckContext CV__CHECK_LOCATION_VARNAME(id) = \
6666
{ CV__CHECK_FUNCTION, CV__CHECK_FILENAME, __LINE__, testOp, "" message, "" p1_str, "" p2_str }
6767

68+
CV_EXPORTS void CV_NORETURN check_failed_auto(const bool v1, const bool v2, const CheckContext& ctx);
6869
CV_EXPORTS void CV_NORETURN check_failed_auto(const int v1, const int v2, const CheckContext& ctx);
6970
CV_EXPORTS void CV_NORETURN check_failed_auto(const size_t v1, const size_t v2, const CheckContext& ctx);
7071
CV_EXPORTS void CV_NORETURN check_failed_auto(const float v1, const float v2, const CheckContext& ctx);
@@ -74,6 +75,9 @@ CV_EXPORTS void CV_NORETURN check_failed_MatDepth(const int v1, const int v2, co
7475
CV_EXPORTS void CV_NORETURN check_failed_MatType(const int v1, const int v2, const CheckContext& ctx);
7576
CV_EXPORTS void CV_NORETURN check_failed_MatChannels(const int v1, const int v2, const CheckContext& ctx);
7677

78+
CV_EXPORTS void CV_NORETURN check_failed_true(const bool v, const CheckContext& ctx);
79+
CV_EXPORTS void CV_NORETURN check_failed_false(const bool v, const CheckContext& ctx);
80+
7781
CV_EXPORTS void CV_NORETURN check_failed_auto(const int v, const CheckContext& ctx);
7882
CV_EXPORTS void CV_NORETURN check_failed_auto(const size_t v, const CheckContext& ctx);
7983
CV_EXPORTS void CV_NORETURN check_failed_auto(const float v, const CheckContext& ctx);
@@ -131,9 +135,18 @@ CV_EXPORTS void CV_NORETURN check_failed_MatChannels(const int v, const CheckCon
131135
/// Example: depth == CV_32F || depth == CV_64F
132136
#define CV_CheckDepth(t, test_expr, msg) CV__CHECK_CUSTOM_TEST(_, MatDepth, t, (test_expr), #t, #test_expr, msg)
133137

138+
/// Example: channel == 1 || channel == 3
139+
#define CV_CheckChannels(t, test_expr, msg) CV__CHECK_CUSTOM_TEST(_, MatChannels, t, (test_expr), #t, #test_expr, msg)
140+
134141
/// Example: v == A || v == B
135142
#define CV_Check(v, test_expr, msg) CV__CHECK_CUSTOM_TEST(_, auto, v, (test_expr), #v, #test_expr, msg)
136143

144+
/// Example: v == true
145+
#define CV_CheckTrue(v, msg) CV__CHECK_CUSTOM_TEST(_, true, v, v, #v, "", msg)
146+
147+
/// Example: v == false
148+
#define CV_CheckFalse(v, msg) CV__CHECK_CUSTOM_TEST(_, false, v, (!(v)), #v, "", msg)
149+
137150
/// Some complex conditions: CV_Check(src2, src2.empty() || (src2.type() == src1.type() && src2.size() == src1.size()), "src2 should have same size/type as src1")
138151
// TODO define pretty-printers
139152

0 commit comments

Comments
 (0)