2012-01-25 04:14:07 +08:00
|
|
|
/*M///////////////////////////////////////////////////////////////////////////////////////
|
2012-05-25 21:16:16 +08:00
|
|
|
//
|
2012-01-25 04:14:07 +08:00
|
|
|
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
|
|
|
|
//
|
|
|
|
// By downloading, copying, installing or using the software you agree to this license.
|
|
|
|
// If you do not agree to this license, do not download, install,
|
|
|
|
// copy or use the software.
|
|
|
|
//
|
|
|
|
//
|
2012-06-09 23:00:04 +08:00
|
|
|
// License Agreement
|
2012-01-25 04:14:07 +08:00
|
|
|
// For Open Source Computer Vision Library
|
|
|
|
//
|
|
|
|
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
|
|
|
|
// Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved.
|
|
|
|
// Third party copyrights are property of their respective owners.
|
|
|
|
//
|
|
|
|
// Redistribution and use in source and binary forms, with or without modification,
|
|
|
|
// are permitted provided that the following conditions are met:
|
|
|
|
//
|
|
|
|
// * Redistribution's of source code must retain the above copyright notice,
|
|
|
|
// this list of conditions and the following disclaimer.
|
|
|
|
//
|
|
|
|
// * Redistribution's in binary form must reproduce the above copyright notice,
|
|
|
|
// this list of conditions and the following disclaimer in the documentation
|
|
|
|
// and/or other materials provided with the distribution.
|
|
|
|
//
|
|
|
|
// * The name of the copyright holders may not be used to endorse or promote products
|
|
|
|
// derived from this software without specific prior written permission.
|
|
|
|
//
|
|
|
|
// This software is provided by the copyright holders and contributors "as is" and
|
|
|
|
// any express or implied warranties, including, but not limited to, the implied
|
|
|
|
// warranties of merchantability and fitness for a particular purpose are disclaimed.
|
|
|
|
// In no event shall the Intel Corporation or contributors be liable for any direct,
|
|
|
|
// indirect, incidental, special, exemplary, or consequential damages
|
|
|
|
// (including, but not limited to, procurement of substitute goods or services;
|
|
|
|
// loss of use, data, or profits; or business interruption) however caused
|
|
|
|
// and on any theory of liability, whether in contract, strict liability,
|
|
|
|
// or tort (including negligence or otherwise) arising in any way out of
|
|
|
|
// the use of this software, even if advised of the possibility of such damage.
|
|
|
|
//
|
|
|
|
//M*/
|
|
|
|
|
|
|
|
#include "precomp.hpp"
|
|
|
|
|
|
|
|
namespace cv
|
|
|
|
{
|
|
|
|
|
|
|
|
Algorithm::Algorithm()
|
|
|
|
{
|
2017-05-25 23:59:01 +08:00
|
|
|
CV_TRACE_FUNCTION();
|
2012-01-25 04:14:07 +08:00
|
|
|
}
|
2012-06-09 23:00:04 +08:00
|
|
|
|
2012-01-25 04:14:07 +08:00
|
|
|
Algorithm::~Algorithm()
|
|
|
|
{
|
2017-05-25 23:59:01 +08:00
|
|
|
CV_TRACE_FUNCTION();
|
2012-01-25 04:14:07 +08:00
|
|
|
}
|
2012-06-09 23:00:04 +08:00
|
|
|
|
2017-07-27 20:34:32 +08:00
|
|
|
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 << "}";
|
|
|
|
}
|
|
|
|
|
2015-04-07 21:44:26 +08:00
|
|
|
void Algorithm::save(const String& filename) const
|
|
|
|
{
|
2017-05-25 23:59:01 +08:00
|
|
|
CV_TRACE_FUNCTION();
|
2015-04-07 21:44:26 +08:00
|
|
|
FileStorage fs(filename, FileStorage::WRITE);
|
|
|
|
fs << getDefaultName() << "{";
|
|
|
|
write(fs);
|
|
|
|
fs << "}";
|
|
|
|
}
|
|
|
|
|
|
|
|
String Algorithm::getDefaultName() const
|
|
|
|
{
|
2017-05-25 23:59:01 +08:00
|
|
|
CV_TRACE_FUNCTION();
|
2015-04-07 21:44:26 +08:00
|
|
|
return String("my_object");
|
|
|
|
}
|
|
|
|
|
2016-03-23 06:19:42 +08:00
|
|
|
void Algorithm::writeFormat(FileStorage& fs) const
|
|
|
|
{
|
2017-05-25 23:59:01 +08:00
|
|
|
CV_TRACE_FUNCTION();
|
2016-03-23 06:19:42 +08:00
|
|
|
fs << "format" << (int)3;
|
|
|
|
}
|
|
|
|
|
2012-01-25 04:14:07 +08:00
|
|
|
}
|
2012-06-09 23:00:04 +08:00
|
|
|
|
2012-01-25 04:14:07 +08:00
|
|
|
/* End of file. */
|