mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 23:33:05 +04:00
Python: wrap Algorithm::read and Algorithm::write
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user