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
9213bba4
Commit
9213bba4
authored
Apr 20, 2012
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wrapped Algorithm class.
parent
8b6d1f6e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
13 deletions
+72
-13
core.hpp
modules/core/include/opencv2/core/core.hpp
+22
-13
algorithm.cpp
modules/core/src/algorithm.cpp
+35
-0
cv2.cpp
modules/python/src2/cv2.cpp
+15
-0
No files found.
modules/core/include/opencv2/core/core.hpp
View file @
9213bba4
...
@@ -4272,7 +4272,7 @@ template<typename _Tp> struct ParamType {};
...
@@ -4272,7 +4272,7 @@ template<typename _Tp> struct ParamType {};
/*!
/*!
Base class for high-level OpenCV algorithms
Base class for high-level OpenCV algorithms
*/
*/
class
CV_EXPORTS
Algorithm
class
CV_EXPORTS
_W
Algorithm
{
{
public
:
public
:
Algorithm
();
Algorithm
();
...
@@ -4281,13 +4281,22 @@ public:
...
@@ -4281,13 +4281,22 @@ public:
template
<
typename
_Tp
>
typename
ParamType
<
_Tp
>::
member_type
get
(
const
string
&
name
)
const
;
template
<
typename
_Tp
>
typename
ParamType
<
_Tp
>::
member_type
get
(
const
string
&
name
)
const
;
template
<
typename
_Tp
>
typename
ParamType
<
_Tp
>::
member_type
get
(
const
char
*
name
)
const
;
template
<
typename
_Tp
>
typename
ParamType
<
_Tp
>::
member_type
get
(
const
char
*
name
)
const
;
void
set
(
const
string
&
name
,
int
value
);
void
set
(
const
string
&
name
,
double
value
);
CV_WRAP
int
getInt
(
const
string
&
name
)
const
;
void
set
(
const
string
&
name
,
bool
value
);
CV_WRAP
double
getDouble
(
const
string
&
name
)
const
;
void
set
(
const
string
&
name
,
const
string
&
value
);
CV_WRAP
bool
getBool
(
const
string
&
name
)
const
;
void
set
(
const
string
&
name
,
const
Mat
&
value
);
CV_WRAP
string
getString
(
const
string
&
name
)
const
;
void
set
(
const
string
&
name
,
const
vector
<
Mat
>&
value
);
CV_WRAP
Mat
getMat
(
const
string
&
name
)
const
;
void
set
(
const
string
&
name
,
const
Ptr
<
Algorithm
>&
value
);
CV_WRAP
vector
<
Mat
>
getMatVector
(
const
string
&
name
)
const
;
CV_WRAP
Ptr
<
Algorithm
>
getAlgorithm
(
const
string
&
name
)
const
;
CV_WRAP_AS
(
setInt
)
void
set
(
const
string
&
name
,
int
value
);
CV_WRAP_AS
(
setDouble
)
void
set
(
const
string
&
name
,
double
value
);
CV_WRAP_AS
(
setBool
)
void
set
(
const
string
&
name
,
bool
value
);
CV_WRAP_AS
(
setString
)
void
set
(
const
string
&
name
,
const
string
&
value
);
CV_WRAP_AS
(
setMat
)
void
set
(
const
string
&
name
,
const
Mat
&
value
);
CV_WRAP_AS
(
setMatVector
)
void
set
(
const
string
&
name
,
const
vector
<
Mat
>&
value
);
CV_WRAP_AS
(
setAlgorithm
)
void
set
(
const
string
&
name
,
const
Ptr
<
Algorithm
>&
value
);
void
set
(
const
char
*
name
,
int
value
);
void
set
(
const
char
*
name
,
int
value
);
void
set
(
const
char
*
name
,
double
value
);
void
set
(
const
char
*
name
,
double
value
);
...
@@ -4297,10 +4306,10 @@ public:
...
@@ -4297,10 +4306,10 @@ public:
void
set
(
const
char
*
name
,
const
vector
<
Mat
>&
value
);
void
set
(
const
char
*
name
,
const
vector
<
Mat
>&
value
);
void
set
(
const
char
*
name
,
const
Ptr
<
Algorithm
>&
value
);
void
set
(
const
char
*
name
,
const
Ptr
<
Algorithm
>&
value
);
string
paramHelp
(
const
string
&
name
)
const
;
CV_WRAP
string
paramHelp
(
const
string
&
name
)
const
;
int
paramType
(
const
char
*
name
)
const
;
int
paramType
(
const
char
*
name
)
const
;
int
paramType
(
const
string
&
name
)
const
;
CV_WRAP
int
paramType
(
const
string
&
name
)
const
;
void
getParams
(
vector
<
string
>&
names
)
const
;
CV_WRAP
void
getParams
(
CV_OUT
vector
<
string
>&
names
)
const
;
virtual
void
write
(
FileStorage
&
fs
)
const
;
virtual
void
write
(
FileStorage
&
fs
)
const
;
...
@@ -4310,8 +4319,8 @@ public:
...
@@ -4310,8 +4319,8 @@ public:
typedef
int
(
Algorithm
::*
Getter
)()
const
;
typedef
int
(
Algorithm
::*
Getter
)()
const
;
typedef
void
(
Algorithm
::*
Setter
)(
int
);
typedef
void
(
Algorithm
::*
Setter
)(
int
);
static
void
getList
(
vector
<
string
>&
algorithms
);
CV_WRAP
static
void
getList
(
CV_OUT
vector
<
string
>&
algorithms
);
static
Ptr
<
Algorithm
>
_create
(
const
string
&
name
);
CV_WRAP
static
Ptr
<
Algorithm
>
_create
(
const
string
&
name
);
template
<
typename
_Tp
>
static
Ptr
<
_Tp
>
create
(
const
string
&
name
);
template
<
typename
_Tp
>
static
Ptr
<
_Tp
>
create
(
const
string
&
name
);
virtual
AlgorithmInfo
*
info
()
const
/* TODO: make it = 0;*/
{
return
0
;
}
virtual
AlgorithmInfo
*
info
()
const
/* TODO: make it = 0;*/
{
return
0
;
}
...
...
modules/core/src/algorithm.cpp
View file @
9213bba4
...
@@ -251,6 +251,41 @@ void Algorithm::set(const char* name, const Ptr<Algorithm>& value)
...
@@ -251,6 +251,41 @@ void Algorithm::set(const char* name, const Ptr<Algorithm>& value)
info
()
->
set
(
this
,
name
,
ParamType
<
Algorithm
>::
type
,
&
value
);
info
()
->
set
(
this
,
name
,
ParamType
<
Algorithm
>::
type
,
&
value
);
}
}
int
Algorithm
::
getInt
(
const
string
&
name
)
const
{
return
get
<
int
>
(
name
);
}
double
Algorithm
::
getDouble
(
const
string
&
name
)
const
{
return
get
<
double
>
(
name
);
}
bool
Algorithm
::
getBool
(
const
string
&
name
)
const
{
return
get
<
bool
>
(
name
);
}
string
Algorithm
::
getString
(
const
string
&
name
)
const
{
return
get
<
string
>
(
name
);
}
Mat
Algorithm
::
getMat
(
const
string
&
name
)
const
{
return
get
<
Mat
>
(
name
);
}
vector
<
Mat
>
Algorithm
::
getMatVector
(
const
string
&
name
)
const
{
return
get
<
vector
<
Mat
>
>
(
name
);
}
Ptr
<
Algorithm
>
Algorithm
::
getAlgorithm
(
const
string
&
name
)
const
{
return
get
<
Algorithm
>
(
name
);
}
string
Algorithm
::
paramHelp
(
const
string
&
name
)
const
string
Algorithm
::
paramHelp
(
const
string
&
name
)
const
{
{
return
info
()
->
paramHelp
(
name
.
c_str
());
return
info
()
->
paramHelp
(
name
.
c_str
());
...
...
modules/python/src2/cv2.cpp
View file @
9213bba4
...
@@ -86,11 +86,13 @@ typedef vector<Rect> vector_Rect;
...
@@ -86,11 +86,13 @@ typedef vector<Rect> vector_Rect;
typedef
vector
<
KeyPoint
>
vector_KeyPoint
;
typedef
vector
<
KeyPoint
>
vector_KeyPoint
;
typedef
vector
<
Mat
>
vector_Mat
;
typedef
vector
<
Mat
>
vector_Mat
;
typedef
vector
<
DMatch
>
vector_DMatch
;
typedef
vector
<
DMatch
>
vector_DMatch
;
typedef
vector
<
string
>
vector_string
;
typedef
vector
<
vector
<
Point
>
>
vector_vector_Point
;
typedef
vector
<
vector
<
Point
>
>
vector_vector_Point
;
typedef
vector
<
vector
<
Point2f
>
>
vector_vector_Point2f
;
typedef
vector
<
vector
<
Point2f
>
>
vector_vector_Point2f
;
typedef
vector
<
vector
<
Point3f
>
>
vector_vector_Point3f
;
typedef
vector
<
vector
<
Point3f
>
>
vector_vector_Point3f
;
typedef
vector
<
vector
<
DMatch
>
>
vector_vector_DMatch
;
typedef
vector
<
vector
<
DMatch
>
>
vector_vector_DMatch
;
typedef
Ptr
<
Algorithm
>
Ptr_Algorithm
;
typedef
Ptr
<
FeatureDetector
>
Ptr_FeatureDetector
;
typedef
Ptr
<
FeatureDetector
>
Ptr_FeatureDetector
;
typedef
Ptr
<
DescriptorExtractor
>
Ptr_DescriptorExtractor
;
typedef
Ptr
<
DescriptorExtractor
>
Ptr_DescriptorExtractor
;
typedef
Ptr
<
DescriptorMatcher
>
Ptr_DescriptorMatcher
;
typedef
Ptr
<
DescriptorMatcher
>
Ptr_DescriptorMatcher
;
...
@@ -759,6 +761,19 @@ template<> struct pyopencvVecConverter<DMatch>
...
@@ -759,6 +761,19 @@ template<> struct pyopencvVecConverter<DMatch>
}
}
};
};
template
<>
struct
pyopencvVecConverter
<
string
>
{
static
bool
to
(
PyObject
*
obj
,
vector
<
string
>&
value
,
const
char
*
name
=
"<unknown>"
)
{
return
pyopencv_to_generic_vec
(
obj
,
value
,
name
);
}
static
PyObject
*
from
(
const
vector
<
string
>&
value
)
{
return
pyopencv_from_generic_vec
(
value
);
}
};
static
inline
bool
pyopencv_to
(
PyObject
*
obj
,
CvTermCriteria
&
dst
,
const
char
*
name
=
"<unknown>"
)
static
inline
bool
pyopencv_to
(
PyObject
*
obj
,
CvTermCriteria
&
dst
,
const
char
*
name
=
"<unknown>"
)
{
{
...
...
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