Fix missing format when writing Algorithm-based objects

Added a writeFormat() method to Algorithm which must be called by the
write() method of derived classes.
This commit is contained in:
mvukad
2016-03-22 15:19:42 -07:00
parent fd1b66b37d
commit 695e33b25b
33 changed files with 47 additions and 1 deletions

View File

@@ -217,6 +217,7 @@ namespace cv
void write(FileStorage& fs) const
{
writeFormat(fs);
fs << "descriptor" << descriptor;
fs << "descriptor_channels" << descriptor_channels;
fs << "descriptor_size" << descriptor_size;

View File

@@ -184,6 +184,7 @@ void SimpleBlobDetectorImpl::read( const cv::FileNode& fn )
void SimpleBlobDetectorImpl::write( cv::FileStorage& fs ) const
{
writeFormat(fs);
params.write(fs);
}

View File

@@ -159,6 +159,7 @@ namespace cv
void write(FileStorage& fs) const
{
writeFormat(fs);
fs << "extended" << (int)extended;
fs << "upright" << (int)upright;
fs << "threshold" << threshold;

View File

@@ -1179,6 +1179,7 @@ void FlannBasedMatcher::read( const FileNode& fn)
void FlannBasedMatcher::write( FileStorage& fs) const
{
writeFormat(fs);
fs << "indexParams" << "[";
if (indexParams)