5 #ifndef OPENCV_CORE_BINDINGS_UTILS_HPP
6 #define OPENCV_CORE_BINDINGS_UTILS_HPP
8 #include <opencv2/core/async.hpp>
9 #include <opencv2/core/detail/async_promise.hpp>
10 #include <opencv2/core/utils/logger.hpp>
14 namespace cv {
namespace utils {
29 return (argument) ?
String(
"Bool: True") :
String(
"Bool: False");
81 return format(
"rect: (x=%d, y=%d, w=%d, h=%d)", argument.
x, argument.
y,
88 return format(
"term_criteria: (type=%d, max_count=%d, epsilon=%lf",
95 return format(
"rotated_rect: (c_x=%f, c_y=%f, w=%f, h=%f, a=%f)",
109 return format(
"range: (s=%d, e=%d)", argument.
start, argument.
end);
125 return format(
"overload (int=%d, point=(x=%d, y=%d))",
value, point.x,
137 RotatedRect testRotatedRect(
float x,
float y,
float w,
float h,
float angle)
146 for (
int i = 0; i < 10; i++)
152 int testOverwriteNativeMethod(
int argument)
158 String testReservedKeywordConversion(
int positional_argument,
int lambda = 2,
int from = 3)
160 return format(
"arg=%d, lambda=%d, from=%d", positional_argument, lambda, from);
170 Mat tmp(
static_cast<int>(len), 1,
CV_32SC4);
183 Mat tmp(
static_cast<int>(len), 1,
CV_32SC1);
196 for (
size_t i = 0; i < len; ++i)
205 void testRaiseGeneralException()
211 AsyncArray testAsyncArray(
InputArray argument)
214 p.setValue(argument);
215 return p.getArrayResult();
219 AsyncArray testAsyncException()
230 return p.getArrayResult();
242 CV_WRAP explicit ClassWithKeywordProperties(
int lambda_arg = 24,
int except_arg = 42)
269 const FunctionParams& params = FunctionParams())
272 return format(
"lambda=%d, sigma=%.1f", params.lambda,
277 CV_WRAP static inline bool testEchoBooleanFunction(
bool flag) {
289 CV_WRAP explicit Params(
int int_param = 123,
float float_param = 3.5f)
291 int_value = int_param;
292 float_value = float_param;
296 explicit OriginalClassName(
const OriginalClassName::Params& params = OriginalClassName::Params())
301 CV_WRAP int getIntParam()
const
303 return params_.int_value;
306 CV_WRAP float getFloatParam()
const
308 return params_.float_value;
313 return "OriginalClassName";
316 CV_WRAP static Ptr<OriginalClassName>
317 create(
const OriginalClassName::Params& params = OriginalClassName::Params())
319 return makePtr<OriginalClassName>(params);
323 OriginalClassName::Params params_;
326 typedef OriginalClassName::Params OriginalClassName_Params;
Class passed to an error.
Definition: core.hpp:115
Template class for 2D points specified by its coordinates x and y.
Definition: types.hpp:163
_Tp y
y coordinate of the point
Definition: types.hpp:202
_Tp x
x coordinate of the point
Definition: types.hpp:201
@ UNIFORM
Definition: core.hpp:2891
Template class specifying a continuous subsequence (slice) of a sequence.
Definition: types.hpp:623
int end
Definition: types.hpp:631
int start
Definition: types.hpp:631
Template class for 2D rectangles.
Definition: types.hpp:444
_Tp x
x coordinate of the top-left corner
Definition: types.hpp:480
_Tp y
y coordinate of the top-left corner
Definition: types.hpp:481
_Tp width
width of the rectangle
Definition: types.hpp:482
_Tp height
height of the rectangle
Definition: types.hpp:483
The class represents rotated (i.e. not up-right) rectangles on a plane.
Definition: types.hpp:531
CV_PROP_RW float angle
returns the rotation angle. When the angle is 0, 90, 180, 270 etc., the rectangle becomes an up-right...
Definition: types.hpp:567
CV_PROP_RW Size2f size
returns width and height of the rectangle
Definition: types.hpp:565
CV_PROP_RW Point2f center
returns the rectangle mass center
Definition: types.hpp:563
_Tp height
the height
Definition: types.hpp:363
_Tp width
the width
Definition: types.hpp:362
The class defining termination criteria for iterative algorithms.
Definition: types.hpp:886
int type
the type of termination criteria: COUNT, EPS or COUNT + EPS
Definition: types.hpp:914
int maxCount
the maximum number of iterations/elements
Definition: types.hpp:915
double epsilon
the desired accuracy
Definition: types.hpp:916
Template class for short numerical vectors, a partial case of Matx.
Definition: matx.hpp:369
Point2i Point
Definition: types.hpp:209
std::string String
Definition: cvstd.hpp:151
InputArray InputArrayOfArrays
Definition: mat.hpp:443
Point_< float > Point2f
Definition: types.hpp:207
const _OutputArray & OutputArray
Definition: mat.hpp:444
CV__DEBUG_NS_END typedef const _InputArray & InputArray
Definition: mat.hpp:442
Size_< float > Size2f
Definition: types.hpp:368
const CvArr * angle
Definition: core_c.h:1194
int rows
Definition: core_c.h:257
int CvScalar value
Definition: core_c.h:720
int cols
Definition: core_c.h:221
CvRect rect
Definition: core_c.h:193
CvRNG * rng
Definition: core_c.h:1250
const CvArr CvArr * x
Definition: core_c.h:1195
const CvArr const CvArr CvArr * result
Definition: core_c.h:1423
const CvArr * y
Definition: core_c.h:1187
#define CV_32SC1
Definition: interface.h:112
int64_t int64
Definition: interface.h:61
#define CV_32SC4
Definition: interface.h:115
CV_EXPORTS LogLevel getLogLevel()
CV_EXPORTS LogLevel setLogLevel(LogLevel logLevel)
static CV_WRAP String dumpRange(const Range &argument)
Definition: bindings_utils.hpp:101
static CV_WRAP String dumpSizeT(size_t argument)
Definition: bindings_utils.hpp:47
#define CV_EXPORTS_W_SIMPLE
Definition: cvdef.h:473
CV_EXPORTS_W String dumpInputArray(InputArray argument)
CV_EXPORTS_W String dumpVectorOfDouble(const std::vector< double > &vec)
CV_EXPORTS_W String dumpInputOutputArray(InputOutputArray argument)
#define CV_OUT
Definition: cvdef.h:478
static CV_WRAP String dumpCString(const char *argument)
Definition: bindings_utils.hpp:67
static CV_WRAP String dumpBool(bool argument)
Definition: bindings_utils.hpp:27
#define CV_Error(code, msg)
Call the error handler.
Definition: base.hpp:320
static CV_WRAP String dumpDouble(double argument)
Definition: bindings_utils.hpp:61
#define CV_EXPORTS_W
Definition: cvdef.h:472
#define CV_PROP
Definition: cvdef.h:479
#define CV_NOEXCEPT
Definition: cvdef.h:800
static CV_WRAP String dumpInt64(int64 argument)
Definition: bindings_utils.hpp:39
static CV_WRAP String dumpRect(const Rect &argument)
Definition: bindings_utils.hpp:79
#define CV_PROP_RW
Definition: cvdef.h:480
static CV_WRAP String dumpString(const String &argument)
Definition: bindings_utils.hpp:73
static CV_WRAP String dumpFloat(float argument)
Definition: bindings_utils.hpp:55
static CV_WRAP String dumpTermCriteria(const TermCriteria &argument)
Definition: bindings_utils.hpp:86
CV_EXPORTS_W String dumpVectorOfInt(const std::vector< int > &vec)
static CV_WRAP String dumpInt(int argument)
Definition: bindings_utils.hpp:33
CV_EXPORTS_W String dumpInputArrayOfArrays(InputArrayOfArrays argument)
CV_EXPORTS String format(const char *fmt,...) CV_FORMAT_PRINTF(1
Returns a text string formatted using the printf-like expression.
#define CV_WRAP
Definition: cvdef.h:481
CV_EXPORTS_W String dumpInputOutputArrayOfArrays(InputOutputArrayOfArrays argument)
static CV_WRAP String dumpRotatedRect(const RotatedRect &argument)
Definition: bindings_utils.hpp:93
CV_EXPORTS_W String dumpVectorOfRect(const std::vector< Rect > &vec)
#define CV_EXPORTS_W_PARAMS
Definition: cvdef.h:476
CV_EXPORTS CV_WRAP_AS(goodFeaturesToTrackWithQuality) void goodFeaturesToTrack(InputArray image
Same as above, but returns also quality measure of the detected corners.
OutputArray dst
Definition: imgproc.hpp:3564
@ StsOk
everything is ok
Definition: base.hpp:69
CV_EXPORTS_W cv::String getCacheDirectoryForDownloads()
LogLevel
Supported logging levels and their semantic.
Definition: logger.defines.hpp:25
"black box" representation of the file storage associated with a file on disk.
Definition: calib3d.hpp:441
int width
Definition: types_c.h:835
int y
Definition: types_c.h:834
int x
Definition: types_c.h:833
int height
Definition: types_c.h:836