Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion 3rdParty/opencv2/README.md

This file was deleted.

258 changes: 180 additions & 78 deletions 3rdParty/opencv2/calib3d.hpp

Large diffs are not rendered by default.

225 changes: 145 additions & 80 deletions 3rdParty/opencv2/core.hpp

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion 3rdParty/opencv2/core/affine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
namespace cv
{

//! @addtogroup core
//! @addtogroup core_eigen
//! @{

/** @brief Affine transform
Expand Down
4 changes: 0 additions & 4 deletions 3rdParty/opencv2/core/async.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@

#include <opencv2/core/mat.hpp>

#ifdef CV_CXX11
//#include <future>
#include <chrono>
#endif

namespace cv {

Expand Down Expand Up @@ -69,7 +67,6 @@ class CV_EXPORTS_W AsyncArray

CV_WRAP bool valid() const CV_NOEXCEPT;

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

Expand All @@ -89,7 +86,6 @@ class CV_EXPORTS_W AsyncArray
std::future<Mat> getFutureMat() const;
std::future<UMat> getFutureUMat() const;
#endif
#endif


// PImpl
Expand Down
34 changes: 26 additions & 8 deletions 3rdParty/opencv2/core/base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,11 @@ enum BorderTypes {
BORDER_REFLECT = 2, //!< `fedcba|abcdefgh|hgfedcb`
BORDER_WRAP = 3, //!< `cdefgh|abcdefgh|abcdefg`
BORDER_REFLECT_101 = 4, //!< `gfedcb|abcdefgh|gfedcba`
BORDER_TRANSPARENT = 5, //!< `uvwxyz|abcdefgh|ijklmno`
BORDER_TRANSPARENT = 5, //!< `uvwxyz|abcdefgh|ijklmno` - Treats outliers as transparent.

BORDER_REFLECT101 = BORDER_REFLECT_101, //!< same as BORDER_REFLECT_101
BORDER_DEFAULT = BORDER_REFLECT_101, //!< same as BORDER_REFLECT_101
BORDER_ISOLATED = 16 //!< do not look outside of ROI
BORDER_ISOLATED = 16 //!< Interpolation restricted within the ROI boundaries.
};

//! @} core_array
Expand All @@ -288,14 +288,29 @@ enum BorderTypes {
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 _code - error code (Error::Code)
@param _err - error description
@param _func - function name. Available only when the compiler supports getting it
@param _file - source file name where the error has occurred
@param _line - line number in the source file where the error has occurred
@param code - error code (Error::Code)
@param err - error description
@param func - function name. Available only when the compiler supports getting it
@param file - source file name where the error has occurred
@param line - line number in the source file where the error has occurred
@see CV_Error, CV_Error_, CV_Assert, CV_DbgAssert
*/
CV_EXPORTS CV_NORETURN void error(int _code, const String& _err, const char* _func, const char* _file, int _line);
CV_EXPORTS CV_NORETURN void error(int code, const String& err, const char* func, const char* file, int line);

/*! @brief Signals an error and terminate application.

By default the function prints information about the error to stderr, then it terminates application
with std::terminate. The function is designed for invariants check in functions and methods with
noexcept attribute.
@param code - error code (Error::Code)
@param err - error description
@param func - function name. Available only when the compiler supports getting it
@param file - source file name where the error has occurred
@param line - line number in the source file where the error has occurred
@see CV_AssertTerminate
*/
CV_EXPORTS CV_NORETURN void terminate(int code, const String& err, const char* func, const char* file, int line) CV_NOEXCEPT;


#ifdef CV_STATIC_ANALYSIS

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

#endif // CV_STATIC_ANALYSIS

Expand Down
122 changes: 89 additions & 33 deletions 3rdParty/opencv2/core/bindings_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ String dumpInt(int argument)
return cv::format("Int: %d", argument);
}

CV_WRAP static inline
String dumpInt64(int64 argument)
{
std::ostringstream oss("Int64: ", std::ios::ate);
oss << argument;
return oss.str();
}

CV_WRAP static inline
String dumpSizeT(size_t argument)
{
Expand Down Expand Up @@ -67,20 +75,6 @@ String dumpString(const String& argument)
return cv::format("String: %s", argument.c_str());
}

CV_WRAP static inline
String testOverloadResolution(int value, const Point& point = Point(42, 24))
{
return format("overload (int=%d, point=(x=%d, y=%d))", value, point.x,
point.y);
}

CV_WRAP static inline
String testOverloadResolution(const Rect& rect)
{
return format("overload (rect=(x=%d, y=%d, w=%d, h=%d))", rect.x, rect.y,
rect.width, rect.height);
}

CV_WRAP static inline
String dumpRect(const Rect& argument)
{
Expand All @@ -103,6 +97,42 @@ String dumpRotatedRect(const RotatedRect& argument)
argument.size.height, argument.angle);
}

CV_WRAP static inline
String dumpRange(const Range& argument)
{
if (argument == Range::all())
{
return "range: all";
}
else
{
return format("range: (s=%d, e=%d)", argument.start, argument.end);
}
}

CV_EXPORTS_W String dumpVectorOfInt(const std::vector<int>& vec);

CV_EXPORTS_W String dumpVectorOfDouble(const std::vector<double>& vec);

CV_EXPORTS_W String dumpVectorOfRect(const std::vector<Rect>& vec);


//! @cond IGNORED

CV_WRAP static inline
String testOverloadResolution(int value, const Point& point = Point(42, 24))
{
return format("overload (int=%d, point=(x=%d, y=%d))", value, point.x,
point.y);
}

CV_WRAP static inline
String testOverloadResolution(const Rect& rect)
{
return format("overload (rect=(x=%d, y=%d, w=%d, h=%d))", rect.x, rect.y,
rect.width, rect.height);
}

CV_WRAP static inline
RotatedRect testRotatedRect(float x, float y, float w, float h, float angle)
{
Expand All @@ -118,19 +148,6 @@ std::vector<RotatedRect> testRotatedRectVector(float x, float y, float w, float
return result;
}

CV_WRAP static inline
String dumpRange(const Range& argument)
{
if (argument == Range::all())
{
return "range: all";
}
else
{
return format("range: (s=%d, e=%d)", argument.start, argument.end);
}
}

CV_WRAP static inline
int testOverwriteNativeMethod(int argument)
{
Expand All @@ -143,12 +160,6 @@ String testReservedKeywordConversion(int positional_argument, int lambda = 2, in
return format("arg=%d, lambda=%d, from=%d", positional_argument, lambda, from);
}

CV_EXPORTS_W String dumpVectorOfInt(const std::vector<int>& vec);

CV_EXPORTS_W String dumpVectorOfDouble(const std::vector<double>& vec);

CV_EXPORTS_W String dumpVectorOfRect(const std::vector<Rect>& vec);

CV_WRAP static inline
void generateVectorOfRect(size_t len, CV_OUT std::vector<Rect>& vec)
{
Expand Down Expand Up @@ -219,6 +230,49 @@ AsyncArray testAsyncException()
return p.getArrayResult();
}

CV_WRAP static inline
String dumpVec2i(const cv::Vec2i value = cv::Vec2i(42, 24)) {
return format("Vec2i(%d, %d)", value[0], value[1]);
}

struct CV_EXPORTS_W_SIMPLE ClassWithKeywordProperties {
CV_PROP_RW int lambda;
CV_PROP int except;

CV_WRAP explicit ClassWithKeywordProperties(int lambda_arg = 24, int except_arg = 42)
{
lambda = lambda_arg;
except = except_arg;
}
};

struct CV_EXPORTS_W_PARAMS FunctionParams
{
CV_PROP_RW int lambda = -1;
CV_PROP_RW float sigma = 0.0f;

FunctionParams& setLambda(int value) CV_NOEXCEPT
{
lambda = value;
return *this;
}

FunctionParams& setSigma(float value) CV_NOEXCEPT
{
sigma = value;
return *this;
}
};

CV_WRAP static inline String
copyMatAndDumpNamedArguments(InputArray src, OutputArray dst,
const FunctionParams& params = FunctionParams())
{
src.copyTo(dst);
return format("lambda=%d, sigma=%.1f", params.lambda,
params.sigma);
}

namespace nested {
CV_WRAP static inline bool testEchoBooleanFunction(bool flag) {
return flag;
Expand Down Expand Up @@ -272,6 +326,8 @@ class CV_EXPORTS_W CV_WRAP_AS(ExportClassName) OriginalClassName
typedef OriginalClassName::Params OriginalClassName_Params;
} // namespace nested

//! @endcond IGNORED

namespace fs {
CV_EXPORTS_W cv::String getCacheDirectoryForDownloads();
} // namespace fs
Expand Down
2 changes: 1 addition & 1 deletion 3rdParty/opencv2/core/bufferpool.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
namespace cv
{

//! @addtogroup core
//! @addtogroup core_opencl
//! @{

class BufferPoolController
Expand Down
13 changes: 13 additions & 0 deletions 3rdParty/opencv2/core/check.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ struct CheckContext {
static const cv::detail::CheckContext CV__CHECK_LOCATION_VARNAME(id) = \
{ CV__CHECK_FUNCTION, CV__CHECK_FILENAME, __LINE__, testOp, "" message, "" p1_str, "" p2_str }

CV_EXPORTS void CV_NORETURN check_failed_auto(const bool v1, const bool v2, const CheckContext& ctx);
CV_EXPORTS void CV_NORETURN check_failed_auto(const int v1, const int v2, const CheckContext& ctx);
CV_EXPORTS void CV_NORETURN check_failed_auto(const size_t v1, const size_t v2, const CheckContext& ctx);
CV_EXPORTS void CV_NORETURN check_failed_auto(const float v1, const float v2, const CheckContext& ctx);
Expand All @@ -74,6 +75,9 @@ CV_EXPORTS void CV_NORETURN check_failed_MatDepth(const int v1, const int v2, co
CV_EXPORTS void CV_NORETURN check_failed_MatType(const int v1, const int v2, const CheckContext& ctx);
CV_EXPORTS void CV_NORETURN check_failed_MatChannels(const int v1, const int v2, const CheckContext& ctx);

CV_EXPORTS void CV_NORETURN check_failed_true(const bool v, const CheckContext& ctx);
CV_EXPORTS void CV_NORETURN check_failed_false(const bool v, const CheckContext& ctx);

CV_EXPORTS void CV_NORETURN check_failed_auto(const int v, const CheckContext& ctx);
CV_EXPORTS void CV_NORETURN check_failed_auto(const size_t v, const CheckContext& ctx);
CV_EXPORTS void CV_NORETURN check_failed_auto(const float v, const CheckContext& ctx);
Expand Down Expand Up @@ -131,9 +135,18 @@ CV_EXPORTS void CV_NORETURN check_failed_MatChannels(const int v, const CheckCon
/// Example: depth == CV_32F || depth == CV_64F
#define CV_CheckDepth(t, test_expr, msg) CV__CHECK_CUSTOM_TEST(_, MatDepth, t, (test_expr), #t, #test_expr, msg)

/// Example: channel == 1 || channel == 3
#define CV_CheckChannels(t, test_expr, msg) CV__CHECK_CUSTOM_TEST(_, MatChannels, t, (test_expr), #t, #test_expr, msg)

/// Example: v == A || v == B
#define CV_Check(v, test_expr, msg) CV__CHECK_CUSTOM_TEST(_, auto, v, (test_expr), #v, #test_expr, msg)

/// Example: v == true
#define CV_CheckTrue(v, msg) CV__CHECK_CUSTOM_TEST(_, true, v, v, #v, "", msg)

/// Example: v == false
#define CV_CheckFalse(v, msg) CV__CHECK_CUSTOM_TEST(_, false, v, (!(v)), #v, "", msg)

/// Some complex conditions: CV_Check(src2, src2.empty() || (src2.type() == src1.type() && src2.size() == src1.size()), "src2 should have same size/type as src1")
// TODO define pretty-printers

Expand Down
Loading
Loading