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
6fbf0758
Commit
6fbf0758
authored
Jul 27, 2017
by
Pavel Rojtberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Python: wrap Algorithm::read and Algorithm::write
parent
f071a48e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
4 deletions
+31
-4
core.hpp
modules/core/include/opencv2/core.hpp
+7
-2
algorithm.cpp
modules/core/src/algorithm.cpp
+13
-0
features2d.hpp
modules/features2d/include/opencv2/features2d.hpp
+11
-2
No files found.
modules/core/include/opencv2/core.hpp
View file @
6fbf0758
...
...
@@ -3093,13 +3093,18 @@ public:
*/
virtual
void
write
(
FileStorage
&
fs
)
const
{
(
void
)
fs
;
}
/** @brief simplified API for language bindings
* @overload
*/
CV_WRAP
void
write
(
const
Ptr
<
FileStorage
>&
fs
,
const
String
&
name
=
String
())
const
;
/** @brief Reads algorithm parameters from a file storage
*/
virtual
void
read
(
const
FileNode
&
fn
)
{
(
void
)
fn
;
}
CV_WRAP
virtual
void
read
(
const
FileNode
&
fn
)
{
(
void
)
fn
;
}
/** @brief Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read
*/
virtual
bool
empty
()
const
{
return
false
;
}
CV_WRAP
virtual
bool
empty
()
const
{
return
false
;
}
/** @brief Reads algorithm from the file node
...
...
modules/core/src/algorithm.cpp
View file @
6fbf0758
...
...
@@ -55,6 +55,19 @@ Algorithm::~Algorithm()
CV_TRACE_FUNCTION
();
}
void
Algorithm
::
write
(
const
Ptr
<
FileStorage
>&
fs
,
const
String
&
name
)
const
{
CV_TRACE_FUNCTION
();
if
(
name
.
empty
())
{
write
(
*
fs
);
return
;
}
*
fs
<<
name
<<
"{"
;
write
(
*
fs
);
*
fs
<<
"}"
;
}
void
Algorithm
::
save
(
const
String
&
filename
)
const
{
CV_TRACE_FUNCTION
();
...
...
modules/features2d/include/opencv2/features2d.hpp
View file @
6fbf0758
...
...
@@ -210,11 +210,15 @@ public:
virtual
void
write
(
FileStorage
&
)
const
;
virtual
void
read
(
const
FileNode
&
);
// see corresponding cv::Algorithm method
CV_WRAP
virtual
void
read
(
const
FileNode
&
);
//! Return true if detector object is empty
CV_WRAP
virtual
bool
empty
()
const
;
CV_WRAP
virtual
String
getDefaultName
()
const
;
// see corresponding cv::Algorithm method
CV_WRAP
inline
void
write
(
const
Ptr
<
FileStorage
>&
fs
,
const
String
&
name
=
String
())
const
{
Algorithm
::
write
(
fs
,
name
);
}
};
/** Feature detectors in OpenCV have wrappers with a common interface that enables you to easily switch
...
...
@@ -985,7 +989,8 @@ public:
read
(
fs
.
root
());
}
// Reads matcher object from a file node
virtual
void
read
(
const
FileNode
&
);
// see corresponding cv::Algorithm method
CV_WRAP
virtual
void
read
(
const
FileNode
&
);
// Writes matcher object to a file storage
virtual
void
write
(
FileStorage
&
)
const
;
...
...
@@ -1012,6 +1017,10 @@ public:
CV_WRAP
static
Ptr
<
DescriptorMatcher
>
create
(
int
matcherType
);
// see corresponding cv::Algorithm method
CV_WRAP
inline
void
write
(
const
Ptr
<
FileStorage
>&
fs
,
const
String
&
name
=
String
())
const
{
Algorithm
::
write
(
fs
,
name
);
}
protected
:
/**
* Class to work with descriptors from several images as with one merged matrix.
...
...
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